netfs: Fix uninitialized return value in netfs_unbuffered_write()
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:
netfs: Fix uninitialized return value in netfs_unbuffered_write()
If preparation of the first subrequest fails, netfs_unbuffered_write() exits its loop before ret is initialized. The empty-iterator check can do the same.
For synchronous writes, netfs_unbuffered_write_iter_locked() may then return an unrelated error instead of wreq->error. This is reachable through CIFS if cifs_prepare_write() fails to reopen the file or obtain credits.
Initialize ret to 0 so the caller returns wreq->error if no data was written, or the number of bytes already written otherwise.
Found with Clang's -Wconditional-uninitialized.
From the CVE record · Linux
An uninitialized return value in the Linux kernel's netfs_unbuffered_write() can cause a synchronous write to return an unrelated error. This is reachable through CIFS when write preparation fails to reopen a file or obtain credits; the input does not describe an attacker-controlled trigger.
Engineers running Linux kernels that use CIFS should check whether their kernel includes the netfs fix; affected versions were not provided.