mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ksmbd: fix Out-of-Bounds Write in ksmbd_vfs_stream_write
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@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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
de4d790dcf
commit
8cd7490fc0
@@ -6587,6 +6587,8 @@ int smb2_write(struct ksmbd_work *work)
|
|||||||
}
|
}
|
||||||
|
|
||||||
offset = le64_to_cpu(req->Offset);
|
offset = le64_to_cpu(req->Offset);
|
||||||
|
if (offset < 0)
|
||||||
|
return -EINVAL;
|
||||||
length = le32_to_cpu(req->Length);
|
length = le32_to_cpu(req->Length);
|
||||||
|
|
||||||
if (req->Channel == SMB2_CHANNEL_RDMA_V1 ||
|
if (req->Channel == SMB2_CHANNEL_RDMA_V1 ||
|
||||||
|
|||||||
Reference in New Issue
Block a user