All of lore.kernel.org
 help / color / mirror / Atom feed
From: Enrik Berkhan <Enrik.Berkhan@inka.de>
To: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Randy Dunlap <rdunlap@infradead.org>
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, 03 Nov 2022 16:22:15 +0100	[thread overview]
Message-ID: <cc8a0aa304a15fbdf2f433f98c645b7e962450f1.camel@inka.de> (raw)
In-Reply-To: <20221103121645.jott66kltaz6bljq@mail.corp.redhat.com>

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/

Cheers,
Enrik




  reply	other threads:[~2022-11-03 15:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25  7:39 NULL pointer dereferences in hid-mcp2221 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 [this message]
2022-11-03 16:13       ` Randy Dunlap
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=cc8a0aa304a15fbdf2f433f98c645b7e962450f1.camel@inka.de \
    --to=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=rdunlap@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.