diff options
| author | Stefan Metzmacher <metze@samba.org> | 2026-10-23 19:26:09 +0900 |
|---|---|---|
| committer | Namjae Jeon <linkinjeon@kernel.org> | 2026-10-26 19:15:10 +0900 |
| commit | 7193241a49c958782ba4b8df06da3734d1e317d2 (patch) | |
| tree | 1fe0a126020a000ed585a0fd0221e6649d28f5a3 /scripts/basic/split-include.c | |
| parent | 6b4b543fa18757297ac756a6fe6e64f506b7844a (diff) | |
| download | linux-7193241a49c958782ba4b8df06da3734d1e317d2.tar.gz linux-7193241a49c958782ba4b8df06da3734d1e317d2.zip | |
smb: smbdirect: fix buffer length underflow in RDMA transfers
When a remote buffer descriptor is larger than the remaining local
buffer, smbdirect_connection_rdma_xmit() clamps its length and sets
buf_len to zero. The common accounting code then subtracts the clamped
length from buf_len, causing it to underflow. If another descriptor
follows, the loop processes it with a wrapped remaining length and
includes memory beyond the local buffer in the RDMA transfer.
A client can trigger an out-of-bounds kernel write with an SMB WRITE
request, or an out-of-bounds kernel read with an SMB READ request, by
supplying multiple RDMA buffer descriptors with an oversized descriptor
before the last one.
Remove the premature assignment to buf_len. Subtracting the clamped length
already consumes the remaining buffer, so the next iteration stops and
only descriptors within the local buffer are used to build work requests.
Fixes: e628bf939aaf ("ksmbd: reduce descriptor size if remaining bytes is less than request size")
Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-33549
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
