diff options
| author | Weiming Shi <bestswngs@gmail.com> | 2026-10-25 02:07:30 -0700 |
|---|---|---|
| committer | Paulo Alcantara <pc@manguebit.org> | 2026-10-27 10:53:21 -0300 |
| commit | 51efca72345acdbedc4af76782d464bd15ba50ff (patch) | |
| tree | 918b25ae1cbf8e2ac26047d85313ee012d460389 /tools/perf/scripts/python/bin/task-analyzer-record | |
| parent | d58e7b40908a8a57755811d5b37af1df3380278f (diff) | |
| download | linux-51efca72345acdbedc4af76782d464bd15ba50ff.tar.gz linux-51efca72345acdbedc4af76782d464bd15ba50ff.zip | |
smb: client: stop processing a read response after a receive error
cifs_read_iter_from_socket() may call cifs_reconnect() before returning an
error. The reconnect path aborts pending mids and invokes their callbacks.
The callback can then release the cifs_io_subrequest containing rdata.
cifs_readv_receive() nevertheless continues after a negative return and may
dereference rdata in cifs_readv_discard(). KASAN reports the resulting
UAF:
BUG: KASAN: slab-use-after-free in cifs_readv_receive
Read of size 4 by task cifsd
cifs_readv_receive (fs/smb/client/transport.c:1284)
cifs_demultiplex_thread (fs/smb/client/connect.c:1355)
kthread (kernel/kthread.c:436)
ret_from_fork (arch/x86/kernel/process.c:158)
Freed by task 148:
netfs_put_subrequest (fs/netfs/objects.c:267)
netfs_read_collection (fs/netfs/read_collect.c:460)
netfs_wait_for_in_progress (fs/netfs/misc.c:462)
Return the socket error immediately, as this path did before the iterator
conversion. This also avoids adding a negative length to total_read.
Cc: stable@vger.kernel.org
Fixes: d08089f649a0 ("cifs: Change the I/O paths to use an iterator rather than a page list")
Reported-by: co+24c7c12d69e63c6d@bugs.sh
Assisted-by: LLM
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/task-analyzer-record')
0 files changed, 0 insertions, 0 deletions
