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]
Message-ID: <yconjvlgrgqsiyclce426i2u4pqcheqxeqxa6fpduqrxtn7njb@jr4nvqvmad2k>
Date: Mon, 30 Jun 2025 16:03:45 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Nícolas F. R. A. Prado <nfraprado@...labora.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, 
	Louis-Alexis Eyraud <louisalexis.eyraud@...labora.com>, Matthias Brugger <matthias.bgg@...il.com>, kernel@...labora.com, 
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] Input: mtk-pmic-keys: Fix null pointer dereference when
 no compatible data

On Mon, Jun 30, 2025 at 03:59:46PM -0400, Nícolas F. R. A. Prado wrote:
> On Mon, 2025-06-30 at 08:25 -0700, Dmitry Torokhov wrote:
> > On Mon, Jun 30, 2025 at 04:06:53PM +0200, AngeloGioacchino Del Regno
> > wrote:
> > > Il 30/06/25 16:03, Louis-Alexis Eyraud ha scritto:
> > 
> > [... snip ...]
> > 
> > > > @@ -316,6 +316,9 @@ static int mtk_pmic_keys_probe(struct
> > > > platform_device *pdev)
> > > >         const struct of_device_id *of_id =
> > > >                 of_match_device(of_mtk_pmic_keys_match_tbl,
> > > > &pdev->dev);
> > > > +       if (!of_id)
> > > > +               return -EINVAL;
> > > 
> > > Please, change this to `return -ENODEV;`
> > 
> > No, this definitely should not be a "silent" error because it
> > indicates
> > there is something wrong with the kernel.
> > 
> > Stepping back, why do we even enter mtk_pmic_keys_probe() if there is
> > not a matching OF ID? Are there any other patches that are not
> > upstream?
> 
> I'm guessing it's because the driver can be probed by a parent MFD
> driver, drivers/mfd/mt6397-core.c, and the compatibles defined in the
> MFD don't necessarily match the ones in the pmic-keys driver, for
> instance 'mediatek,mt6359-keys' is only listed in the MFD. Adding the
> missing compatibles to the pmic-keys driver should fix this.

I think if we stop using the generic "mtk-pmic-keys" in MFD core it
should solve the issue. I just sent out a patch...

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ