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: <aDCmFm5fso98w3AV@smile.fi.intel.com>
Date: Fri, 23 May 2025 19:45:10 +0300
From: Andy Shevchenko <andy@...nel.org>
To: maudspierings@...ontroll.com
Cc: Jonathan Cameron <jic23@...nel.org>,
	David Lechner <dlechner@...libre.com>,
	Nuno Sá <nuno.sa@...log.com>,
	Christian Heusel <christian@...sel.eu>,
	Linus Walleij <linus.walleij@...aro.org>, linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v2] iio: common: st_sensors: Fix use of uninitialize
 device structs

On Thu, May 22, 2025 at 01:18:55PM +0200, Maud Spierings via B4 Relay wrote:
> 
> Throughout the various probe functions &indio_dev->dev is used before it
> is initialized. This caused a kernel panic in st_sensors_power_enable

st_sensors_power_enable()

> when the call to devm_regulator_bulk_get_enable() fails and then calls
> dev_err_probe() with the uninitialized device.
> 
> This seems to only cause a panic with dev_err_probe(), dev_err,

dev_err()

> dev_warn and dev_info don't seem to cause a panic, but are fixed

dev_warn()
dev_info()

> as well.

> Signed-off-by: Maud Spierings <maudspierings@...ontroll.com>
> ---
> When I search for general &indio_dev->dev usage, I see quite a lot more
> hits, but I am not sure if there are issues with those too.
> 
> This issue has existed for a long time it seems and therefore it is
> nearly impossible to find a proper fixes tag. I would love to see it at
> least backported to 6.12 as that is where I encountered it, and I
> believe the patch should apply without conflicts.

> The investigation into this issue can be found in this thread [1]
> 
> [1]: https://lore.kernel.org/all/AM7P189MB100986A83D2F28AF3FFAF976E39EA@AM7P189MB1009.EURP189.PROD.OUTLOOK.COM/

Shouldn't it be moved to the commit message as Link tag?

...

> -		return dev_err_probe(&indio_dev->dev, err,
> +		return dev_err_probe(parent, err,
>  				     "unable to enable supplies\n");

Now it can be put on one line (yes, only 1 or 2 characters longer than 80).

...

> -		dev_info(&indio_dev->dev,
> +		dev_info(parent,
>  			 "interrupts on the rising edge\n");

Ditto.

...

> -		dev_info(&indio_dev->dev,
> +		dev_info(parent,
>  			 "interrupts active high level\n");

Ditto.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ