Re: [PATCH] drm/i915/hwmon: Fix potential UAF on driver unbind

2024-03-25 Thread Jani Nikula
On Fri, 22 Mar 2024, Ville Syrjälä wrote: > On Fri, Mar 22, 2024 at 07:54:03PM +0100, Janusz Krzysztofik wrote: >> Hwmon is registered as a managed resource of i915. Its functionality >> depends of availability of i915 uncore. > > Instead of polluting all code with this junk I think > either

Re: [PATCH] drm/i915/hwmon: Fix potential UAF on driver unbind

2024-03-22 Thread Ville Syrjälä
On Fri, Mar 22, 2024 at 07:54:03PM +0100, Janusz Krzysztofik wrote: > Hwmon is registered as a managed resource of i915. Its functionality > depends of availability of i915 uncore. Instead of polluting all code with this junk I think either fixing the devm stuff, or just getting rid of it if

[PATCH] drm/i915/hwmon: Fix potential UAF on driver unbind

2024-03-22 Thread Janusz Krzysztofik
Hwmon is registered as a managed resource of i915. Its functionality depends of availability of i915 uncore. On i915 unbind, we now block i915 access to hwmon, but leave i915 uncore still available to hwmon. Since uncore structures may be freed before hwmon is actually unregistered, that may