summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJordy Zomer <jordyzomer@google.com>2024-11-28 01:33:25 +0100
committerSteve French <stfrench@microsoft.com>2024-12-02 00:31:19 +0100
commit313dab082289e460391c82d855430ec8a28ddf81 (patch)
treec55ea9c544c2ce7d79d45a7fa183e0c1d4d963c3 /fs
parentksmbd: fix Out-of-Bounds Read in ksmbd_vfs_stream_read (diff)
downloadlinux-313dab082289e460391c82d855430ec8a28ddf81.tar.xz
linux-313dab082289e460391c82d855430ec8a28ddf81.zip
ksmbd: fix Out-of-Bounds Write in ksmbd_vfs_stream_write
An offset from client could be a negative value, It could allows to write data outside the bounds of the allocated buffer. Note that this issue is coming when setting 'vfs objects = streams_xattr parameter' in ksmbd.conf. Cc: stable@vger.kernel.org # v5.15+ Reported-by: Jordy Zomer <jordyzomer@google.com> Signed-off-by: Jordy Zomer <jordyzomer@google.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/smb/server/smb2pdu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 7b6a3952f228..23879555880f 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6882,6 +6882,8 @@ int smb2_write(struct ksmbd_work *work)
}
offset = le64_to_cpu(req->Offset);
+ if (offset < 0)
+ return -EINVAL;
length = le32_to_cpu(req->Length);
if (req->Channel == SMB2_CHANNEL_RDMA_V1 ||