ksmbd: don't need 8byte alignment for request length in ksmbd_check_message
Subsystems (2)
Namjae Jeon
maintainerPATCH 1/1 ksmbd: don't need 8byte alignment for request length in ksmbd_check_message
When validating request length in ksmbd_check_message, 8byte alignment is not needed for compound request. It can cause wrong validation of request length.
Signed-off-by Namjae Jeon <[email protected]>
--- fs/ksmbd/smb2misc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
fs/ksmbd/smb2misc.c +2 -4
@@ -353,12 +353,10 @@ int ksmbd_smb2_check_message(struct ksmbd_work *work)__u32 clc_len;/* calculated length */ __u32 len =get_rfc1002_len (pdu); -if (le32_to_cpu (hdr->NextCommand) >0 ) { +if (le32_to_cpu (hdr->NextCommand) >0 ) len =le32_to_cpu (hdr->NextCommand); - }else if (work->next_smb2_rcv_hdr_off) { +else if (work->next_smb2_rcv_hdr_off) len -= work->next_smb2_rcv_hdr_off; - len =round_up (len,8 ); - }if (check_smb2_hdr (hdr))return 1 ;
Signature · 1 line
2.25.1
Acked-by Hyunchul Lee <[email protected]>
2021년 10월 29일 (금) 오전 8:13, Namjae Jeon <[email protected]>님이 작성:
Quoted 32 lines
When validating request length in
ksmbd_check_message, 8byte alignment is not needed for compound request. It can cause wrong validation of request length.Signed-off-by Namjae Jeon <[email protected]>--- fs/ksmbd/smb2misc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)fs/ksmbd/smb2misc.c +2
-5@@ -353,12 +353,10 @@ int ksmbd_smb2_check_message(struct ksmbd_work *work)__u32 clc_len;/* calculated length */ __u32 len =get_rfc1002_len (pdu); -if (le32_to_cpu (hdr->NextCommand) >0 ) { +if (le32_to_cpu (hdr->NextCommand) >0 ) len =le32_to_cpu (hdr->NextCommand); - }else if (work->next_smb2_rcv_hdr_off) { +else if (work->next_smb2_rcv_hdr_off) len -= work->next_smb2_rcv_hdr_off; - len =round_up (len,8 ); - }if (check_smb2_hdr (hdr))return 1 ; --2.25.1
Signature · 2 lines
Thanks, Hyunchul