ksmbd: Fix acl.sd_buf memory leak and invalid sd_size error handling
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8f0541186e9ad1b62accc9519cc2b7a7240272a7 · < d708a36634bb7b6f94d0e76d587d2ec50b2b93b5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: Fix acl.sd_buf memory leak and invalid sd_size error handling
1. When ndr_decode_v4_ntacl() fails, the code jumped to free_n_data which only freed n.data, skipping kfree(acl.sd_buf) and leaking the buffer. Zero-initialize struct xattr_ntacl acl, reorder error labels to out_free to release acl.sd_buf on all error paths.
2. if (acl.sd_size < sizeof(struct smb_ntsd)) is true, original code returned success without freeing sd_buf and left stale *pntsd. Set rc = -EINVAL before jumping to out_free to return error code and free buffer.
From the CVE record · Linux
The Linux kernel's ksmbd component can leak an ACL buffer when NTACL decoding fails. An undersized security descriptor can also incorrectly return success and leave a stale pointer; the input does not establish attacker access requirements or whether user interaction is needed.
Engineers running Linux kernels with ksmbd should check their kernel versions; affected versions were not provided.