Skip to content

Commit

Permalink
ksmbd: no response from compound read
Browse files Browse the repository at this point in the history
ksmbd doesn't support compound read. If client send read-read in
compound to ksmbd, there can be memory leak from read buffer.
Windows and linux clients doesn't send it to server yet. For now,
No response from compound read. compound read will be supported soon.

Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21587, ZDI-CAN-21588
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
namjaejeon authored and Steve French committed Jul 23, 2023
1 parent 3df0411 commit e202a1e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/smb/server/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6214,6 +6214,11 @@ int smb2_read(struct ksmbd_work *work)
unsigned int max_read_size = conn->vals->max_read_size;

WORK_BUFFERS(work, req, rsp);
if (work->next_smb2_rcv_hdr_off) {
work->send_no_response = 1;
err = -EOPNOTSUPP;
goto out;
}

if (test_share_config_flag(work->tcon->share_conf,
KSMBD_SHARE_FLAG_PIPE)) {
Expand Down

0 comments on commit e202a1e

Please sign in to comment.