Skip to content

Commit fc342cf

Browse files
JordyZomersmfrench
authored andcommitted
ksmbd: fix Out-of-Bounds Read in ksmbd_vfs_stream_read
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: [email protected] # v5.15+ Reported-by: Jordy Zomer <[email protected]> Signed-off-by: Jordy Zomer <[email protected]> Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent e18655c commit fc342cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6663,6 +6663,10 @@ int smb2_read(struct ksmbd_work *work)
66636663
}
66646664

66656665
offset = le64_to_cpu(req->Offset);
6666+
if (offset < 0) {
6667+
err = -EINVAL;
6668+
goto out;
6669+
}
66666670
length = le32_to_cpu(req->Length);
66676671
mincount = le32_to_cpu(req->MinimumCount);
66686672

0 commit comments

Comments
 (0)