smb/client: validate new EOF for zero range
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
smb/client: validate new EOF for zero range
When FALLOC_FL_ZERO_RANGE is used without FALLOC_FL_KEEP_SIZE, smb3_zero_range() may extend EOF without checking RLIMIT_FSIZE, allowing the file to grow beyond the caller's file-size limit.
Fix this by calling inode_newsize_ok() before sending the zero-range request when the operation would extend EOF.
Reproducer, using a file on a CIFS mount:
bash -c ' FILE=/mnt/cifs/repro
trap "" SIGXFSZ ulimit -f 3072
truncate -s 2M "$FILE" fallocate --zero-range -o 0 -l 4M "$FILE" echo "fallocate rc=$?" stat -c "file size=%s" "$FILE" '
From the CVE record · Linux
The Linux kernel SMB client can extend a file on a CIFS mount beyond the caller’s RLIMIT_FSIZE limit. A local caller can trigger this by using FALLOC_FL_ZERO_RANGE without FALLOC_FL_KEEP_SIZE when the operation extends the file; authentication requirements are not specified.
Operators running Linux kernels with CIFS mounts should check whether their kernel includes this fix; affected versions are not specified.