Skip to content

Commit

Permalink
ksmbd: fix Out-of-Bounds Read in ksmbd_vfs_stream_read
Browse files Browse the repository at this point in the history
An offset from client could be a negative value, It could lead
to an out-of-bounds read from the stream_buf.

Reported-by: Jordy Zomer <[email protected]>
Signed-off-by: Jordy Zomer <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
namjaejeon committed Nov 28, 2024
1 parent 47f2f72 commit d9302c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -7205,6 +7205,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);

Expand Down

0 comments on commit d9302c3

Please sign in to comment.