Commit 313dab08 authored by Jordy Zomer's avatar Jordy Zomer Committed by Steve French
Browse files

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: default avatarJordy Zomer <jordyzomer@google.com>
Signed-off-by: default avatarJordy Zomer <jordyzomer@google.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent fc342cf8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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 ||