ksmbd: fix sd_ndr.data memory leak in ksmbd_vfs_set_sd_xattr
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 303fff2b8c77a85c62dbde3b27c24b084144c04c · < d4d56b00c7df88cd5751e7415bdfabc9fdbc82a7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix sd_ndr.data memory leak in ksmbd_vfs_set_sd_xattr
ndr_encode_v4_ntacl() allocates sd_ndr.data via kzalloc() at entry. If any subsequent ndr_write_*() call returns error during encoding, the allocated sd_ndr.data won't be freed and causes memory leak.
Move kfree(sd_ndr.data) into out label to ensure the buffer gets released on all success and error return paths.
From the CVE record · Linux
The Linux kernel's ksmbd component can leak memory while encoding a security descriptor if an encoding operation fails. The input does not specify whether an attacker can trigger this condition or what access it would require.
Engineers running the Linux kernel with ksmbd should check their deployments; affected versions were not provided.