CVE-2026-99295: smb: client: stop processing a read response after a receive error
In the Linux kernel, the following vulnerability has been resolved:
smb: client: stop processing a read response after a receive error
cifsreaditerfromsocket() may call cifsreconnect() before returning an error. The reconnect path aborts pending mids and invokes their callbacks. The callback can then release the cifsiosubrequest containing rdata.
cifsreadvreceive() nevertheless continues after a negative return and may dereference rdata in cifsreadvdiscard(). KASAN reports the resulting UAF:
BUG: KASAN: slab-use-after-free in cifsreadvreceive Read of size 4 by task cifsd cifsreadvreceive (fs/smb/client/transport.c:1284) cifsdemultiplexthread (fs/smb/client/connect.c:1355) kthread (kernel/kthread.c:436) retfromfork (arch/x86/kernel/process.c:158)
Freed by task 148: netfsputsubrequest (fs/netfs/objects.c:267) netfsreadcollection (fs/netfs/readcollect.c:460) netfswaitforinprogress (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 totalread.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In cifs_readv_receive, return the socket error immediately after a receive error and stop processing the read response.