From: Randy Dunlap <rdunlap@infradead.org>
To: Enrik Berkhan <Enrik.Berkhan@inka.de>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: "Sven Zühlsdorf" <sven.zuehlsdorf@vigem.de>,
"Rishi Gupta" <gupt21@gmail.com>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: NULL pointer dereferences in hid-mcp2221
Date: Thu, 3 Nov 2022 09:13:54 -0700 [thread overview]
Message-ID: <d9bbc0ab-2541-6490-d852-c7e73e1f45fb@infradead.org> (raw)
In-Reply-To: <cc8a0aa304a15fbdf2f433f98c645b7e962450f1.camel@inka.de>
On 11/3/22 08:22, Enrik Berkhan wrote:
> On Thu, 2022-11-03 at 13:16 +0100, Benjamin Tissoires wrote:
>> On Nov 02 2022, Randy Dunlap wrote:
>>> Hi--
>>>
>>> [adding linux-input mailing list]
>>>
>>> On 10/25/22 00:39, Sven Zühlsdorf wrote:
>>>> Hi,
>>>>
>>>> I've run into two NULL pointer dereferences when loading the MCP2221 driver.
>>>> Initially I observed them running the kernel used by yocto kirkstone
>>>> (currently 5.15.68) but can reproduce them with a vanilla 6.1-rc1 as well.
>>>> All line numbers below are for hid-mcp2221.c, taken from 6.1-rc1.
>>>>
>>>> The first one was easy to identify, in mcp2221_probe line 874 `hdev->hidraw`
>>>> was NULL since I compiled the kernel without CONFIG_HIDRAW enabled. Should
>>>> CONFIG_HID_MCP2221 perhaps depend on or imply CONFIG_HIDRAW?
>>>
>>> Looks to me like it should. Hopefully the HID people can chime in here.
>>
>> I actually don't see why this driver (and hid-cp2112.c FWIW) should
>> depend on hidraw. To me, the reference to hidraw is just a nicer logging
>> message, but I have a hard time understanding how hidraw should be
>> involved in the driver, and if it were, how it could not break
>> everything.
>>
>> So IMO, we should probably change that line from the 2 drivers and
>> replace the hidraw part with the hid->id number which is unique.
>
> Exactly. See also
> https://lore.kernel.org/linux-input/20220926202239.16379-2-Enrik.Berkhan@inka.de/
Great. Thanks.
--
~Randy
next prev parent reply other threads:[~2022-11-03 16:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 7:39 Sven Zühlsdorf
2022-10-25 7:46 ` NULL pointer dereferences in hid-mcp2221 -- kernel config Sven Zühlsdorf
2022-10-25 7:47 ` NULL pointer dereferences in hid-mcp2221 -- full dmesg Sven Zühlsdorf
2022-11-03 0:31 ` NULL pointer dereferences in hid-mcp2221 Randy Dunlap
2022-11-03 12:16 ` Benjamin Tissoires
2022-11-03 15:22 ` Enrik Berkhan
2022-11-03 16:13 ` Randy Dunlap [this message]
2022-12-13 14:00 ` Sven Zühlsdorf
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=d9bbc0ab-2541-6490-d852-c7e73e1f45fb@infradead.org \
--to=rdunlap@infradead.org \
--cc=Enrik.Berkhan@inka.de \
--cc=benjamin.tissoires@redhat.com \
--cc=gupt21@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sven.zuehlsdorf@vigem.de \
/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
all inboxes | Powered by JetHome®