From: Jeffin Philip <jeffinphilip14@gmail.com>
To: stern@rowland.harvard.edu
Cc: christophe.jaillet@wanadoo.fr, felipe.balbi@linux.intel.com,
gregkh@linuxfoundation.org, jeffinphilip14@gmail.com,
kees@kernel.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org, stable@vger.kernel.org,
syzbot+791be35f1fbcc85d06d7@syzkaller.appspotmail.com
Subject: [PATCH] usb: gadget: f_mass_storage: fix null pointer dereference in fsg_common_set_num_buffers()
Date: Mon, 17 Aug 2026 21:33:19 +0530 [thread overview]
Message-ID: <20260817160319.28251-1-jeffinphilip14@gmail.com> (raw)
In-Reply-To: <e52c5913-9210-47cd-9a97-ab00547f53c4@rowland.harvard.edu>
On Mon, 17 Aug 2026 10:01:36 -0400, Alan Stern wrote:
>In fe5a6c48fd95 ("usb: gadget: storage: get rid of
>fsg_num_buffers_validate()"), the code that was changed originally
>required the number to lie between 2 and 32. Even 1 was not acceptable.
Kconfig currently sets the limit from 2 to 256 with default as 2. However,
we use that only at build time. So, if we enter during runtime via configfs,
we set page content to 0\0 and get the null pointer dereference. So we will
need to add the check for num < 2 in fsg_opts_num_buffers_store() and return
EINVAL? Upper bound is 256 which is below what kstrtou8() can return anyway.
Thanks,
Jeffin.
next prev parent reply other threads:[~2026-08-17 16:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 11:08 [PATCH] usb: gadget: f_mass_storage: fix null pointer dereference in fsg_common_set_num_buffers() Jeffin Philip
2026-08-17 11:10 ` Greg KH
2026-08-17 13:02 ` Jeffin Philip
2026-08-17 13:15 ` Greg KH
2026-08-17 14:01 ` Alan Stern
2026-08-17 16:03 ` Jeffin Philip [this message]
2026-08-17 16:09 ` Jeffin Philip
2026-08-17 16:49 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260817160319.28251-1-jeffinphilip14@gmail.com \
--to=jeffinphilip14@gmail.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=syzbot+791be35f1fbcc85d06d7@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox