lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 26 Jan 2024 18:53:17 +0100 (CET)
From: Jiri Kosina <jikos@...nel.org>
To: Doug Anderson <dianders@...omium.org>
cc: Johan Hovold <johan+linaro@...nel.org>, 
    Benjamin Tissoires <benjamin.tissoires@...hat.com>, 
    linux-input@...r.kernel.org, linux-kernel@...r.kernel.org, 
    stable@...r.kernel.org
Subject: Re: [PATCH] HID: i2c-hid-of: fix NULL-deref on failed power up

On Fri, 26 Jan 2024, Doug Anderson wrote:

> > A while back the I2C HID implementation was split in an ACPI and OF
> > part, but the new OF driver never initialises the client pointer which
> > is dereferenced on power-up failures.
> >
> > Fixes: b33752c30023 ("HID: i2c-hid: Reorganize so ACPI and OF are separate modules")
> > Cc: stable@...r.kernel.org      # 5.12
> > Cc: Douglas Anderson <dianders@...omium.org>
> > Signed-off-by: Johan Hovold <johan+linaro@...nel.org>
> > ---
> >  drivers/hid/i2c-hid/i2c-hid-of.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/hid/i2c-hid/i2c-hid-of.c b/drivers/hid/i2c-hid/i2c-hid-of.c
> > index c4e1fa0273c8..8be4d576da77 100644
> > --- a/drivers/hid/i2c-hid/i2c-hid-of.c
> > +++ b/drivers/hid/i2c-hid/i2c-hid-of.c
> > @@ -87,6 +87,7 @@ static int i2c_hid_of_probe(struct i2c_client *client)
> >         if (!ihid_of)
> >                 return -ENOMEM;
> >
> > +       ihid_of->client = client;
> 
> Good catch and thanks for the fix. FWIW, I'd be OK w/
> 
> Reviewed-by: Douglas Anderson <dianders@...omium.org>

I've now queued this as a fix for 6.8 ....

> That being said, I'd be even happier if you simply removed the "client" 
> from the structure and removed the error printout. 
> regulator_bulk_enable() already prints error messages when a failure 
> happens and thus the error printout is redundant and wastes space.

.. and this can be done for 6.9.

Thanks,

-- 
Jiri Kosina
SUSE Labs


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ