diff options
| author | Dawei Feng <dawei.feng@seu.edu.cn> | 2026-06-28 14:59:09 +0800 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2026-07-26 17:40:20 -0500 |
| commit | 6a3e16d60e81a4aa3056ab15617036cfbea2e07d (patch) | |
| tree | d32a38738d2c1fcc97398ff131d5a2ddc36fb5b4 /tools/perf/scripts/python/task-analyzer.py | |
| parent | 9349dd0646673964eb9e993050526029fc599677 (diff) | |
smb: client: fix buffer leaks in SMB1 read and write
CIFSSMBRead(), CIFSSMBWrite() and CIFSSMBWrite2() allocate a request
buffer before checking whether tcon->ses->server is NULL. If that
defensive check ever fails, the helper returns -ECONNABORTED without
releasing the request buffer.
Fix these leaks by releasing the allocated request buffer before
returning from these error paths. Use cifs_small_buf_release() for the
buffers allocated by small_smb_init() and cifs_buf_release() for the
buffer allocated by smb_init().
The bug was first flagged by an experimental analysis tool we are
developing for kernel memory-management bugs while analyzing
v6.13-rc1. The tool is still under development and is not yet publicly
available. Manual inspection confirms that the bug is still
present in v7.1.1.
An x86_64 allyesconfig build showed no new warnings.
Runtime validation used a temporary fault-injection hook to force
tcon->ses->server to NULL after request-buffer initialization. On the
unfixed kernel, the harness observed two leaked small request buffers and
one leaked large request buffer, with directed kmemleak dumps confirming
the CIFS buffer allocation stacks. After the fix, no CIFS request-buffer
deltas remained.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions
