diff options
author | Jordy Zomer <jordyzomer@google.com> | 2024-11-28 01:33:25 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-12-02 00:31:19 +0100 |
commit | 313dab082289e460391c82d855430ec8a28ddf81 (patch) | |
tree | c55ea9c544c2ce7d79d45a7fa183e0c1d4d963c3 /fs | |
parent | ksmbd: fix Out-of-Bounds Read in ksmbd_vfs_stream_read (diff) | |
download | linux-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.c | 2 |
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 || |