]> Git Repo - linux.git/commit
ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16()
authorNamjae Jeon <[email protected]>
Wed, 20 Dec 2023 06:52:11 +0000 (15:52 +0900)
committerSteve French <[email protected]>
Thu, 28 Dec 2023 04:55:36 +0000 (22:55 -0600)
commitd10c77873ba1e9e6b91905018e29e196fd5f863d
treea12180e41c83d8a43e1e1ea4ff7ab02208c5856e
parentceb6a6f023fd3e8b07761ed900352ef574010bcb
ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16()

If ->NameOffset/Length is bigger than ->CreateContextsOffset/Length,
ksmbd_check_message doesn't validate request buffer it correctly.
So slab-out-of-bounds warning from calling smb_strndup_from_utf16()
in smb2_open() could happen. If ->NameLength is non-zero, Set the larger
of the two sums (Name and CreateContext size) as the offset and length of
the data area.

Reported-by: Yang Chaoming <[email protected]>
Cc: [email protected]
Signed-off-by: Namjae Jeon <[email protected]>
Signed-off-by: Steve French <[email protected]>
fs/smb/server/smb2misc.c
This page took 0.056648 seconds and 4 git commands to generate.