diff options
| author | Jeffin Philip <jeffinphilip14@gmail.com> | 2026-08-18 09:29:04 +0530 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-09-01 16:49:23 +0200 |
| commit | 2c0f5ca48674a5b5f9fa4a9c3325aa48053af0bc (patch) | |
| tree | a5b3c539794b43eb2bb05fc0f310faa4d5b9df65 /scripts/Makefile.thinlto | |
| parent | 9f6f095beec82a80daa666a3b2186a5b95841e9a (diff) | |
| download | linux-2c0f5ca48674a5b5f9fa4a9c3325aa48053af0bc.tar.gz linux-2c0f5ca48674a5b5f9fa4a9c3325aa48053af0bc.zip | |
usb: gadget: f_mass_storage: fix null pointer dereference in fsg_common_set_num_buffers()
Previously fsg_num_buffers_validate() was removed as it was not
necessary due to Kconfig setting the limits for n from 2 to 256 with
default as 2. However, setting the page content in such a way that
kstrtou8() reflects n value as either 0 or 1 bypasses these
restrictions leading to a null pointer dereference if n is 0. Fix
this by adding a check for n < 2 and returning -EINVAL if n is
either 0 or 1 consistent with Kconfig logic.
Reported-by: syzbot+791be35f1fbcc85d06d7@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=791be35f1fbcc85d06d7
Fixes: fe5a6c48fd95 ("usb: gadget: storage: get rid of fsg_num_buffers_validate()")
Cc: stable <stable@kernel.org>
Signed-off-by: Jeffin Philip <jeffinphilip14@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://patch.msgid.link/20260818035904.10324-1-jeffinphilip14@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
