]> git.baikalelectronics.ru Git - kernel.git/commit
ksmbd: validate length in smb2_write()
authorMarios Makassikis <mmakassikis@freebox.fr>
Wed, 4 May 2022 13:40:10 +0000 (15:40 +0200)
committerSteve French <stfrench@microsoft.com>
Tue, 10 May 2022 03:23:01 +0000 (22:23 -0500)
commit4e4b40b8eff5137e536871e6fdd2a2acdfa156fc
treea6ff034adb6b5418e71b4eadfd9e854ac9763695
parentb9709d509d8eb2efeface07efe223f0f9d621b03
ksmbd: validate length in smb2_write()

The SMB2 Write packet contains data that is to be written
to a file or to a pipe. Depending on the client, there may
be padding between the header and the data field.
Currently, the length is validated only in the case padding
is present.

Since the DataOffset field always points to the beginning
of the data, there is no need to have a special case for
padding. By removing this, the length is validated in both
cases.

Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smb2pdu.c