Skip to content

Commit 313dab0

Browse files
JordyZomersmfrench
authored andcommitted
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: [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 fc342cf commit 313dab0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6882,6 +6882,8 @@ int smb2_write(struct ksmbd_work *work)
68826882
}
68836883

68846884
offset = le64_to_cpu(req->Offset);
6885+
if (offset < 0)
6886+
return -EINVAL;
68856887
length = le32_to_cpu(req->Length);
68866888

68876889
if (req->Channel == SMB2_CHANNEL_RDMA_V1 ||

0 commit comments

Comments
 (0)