ksmbd: fix Out-of-Bounds Write in ksmbd_vfs_stream_write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jordy Zomer <jordyzomer@xxxxxxxxxx>

commit 313dab082289e460391c82d855430ec8a28ddf81 upstream.

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@xxxxxxxxxxxxxxx # v5.15+
Reported-by: Jordy Zomer <jordyzomer@xxxxxxxxxx>
Signed-off-by: Jordy Zomer <jordyzomer@xxxxxxxxxx>
Signed-off-by: Namjae Jeon <linkinjeon@xxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/smb/server/smb2pdu.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6587,6 +6587,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 ||


Patches currently in stable-queue which might be from jordyzomer@xxxxxxxxxx are

queue-6.1/ksmbd-fix-out-of-bounds-write-in-ksmbd_vfs_stream_write.patch
queue-6.1/ksmbd-fix-out-of-bounds-read-in-ksmbd_vfs_stream_read.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux