[PATCH] drm/i915/hwmon: Get rid of devm

Dixit, Ashutosh ashutosh.dixit at intel.com
Sun Apr 14 23:23:53 UTC 2024


On Fri, 12 Apr 2024 17:10:31 -0700, Ashutosh Dixit wrote:
>
> When both hwmon and hwmon drvdata (on which hwmon depends) are device
> managed resources, the expectation, on device unbind, is that hwmon will be
> released before the drvdata. However, it appears devres does not do this
> consistently, so that we occasionally see drvdata being released before
> hwmon itself. This results in a uaf if hwmon sysfs is accessed during
> device unbind.
>
> The only way out of this seems to be do get rid of devm_ and release/free
> everything explicitly during device unbind.
>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10366
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>

Please don't review this patch yet, I will send a v2 tomorrow. Please
review the v2. Thanks.


More information about the Intel-gfx mailing list