mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
ksmbd: fix Out-of-Bounds Read in ksmbd_vfs_stream_read
commit fc342cf86e
upstream.
An offset from client could be a negative value, It could lead
to an out-of-bounds read from the stream_buf.
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:
parent
1aece96620
commit
81eed63193
@ -6651,6 +6651,10 @@ int smb2_read(struct ksmbd_work *work)
|
||||
}
|
||||
|
||||
offset = le64_to_cpu(req->Offset);
|
||||
if (offset < 0) {
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
length = le32_to_cpu(req->Length);
|
||||
mincount = le32_to_cpu(req->MinimumCount);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user