Re: [PATCH 5.5 066/189] driver core: Call sync_state() even if supplier has no consumers

From: Greg Kroah-Hartman
Date: Wed Mar 25 2020 - 10:07:15 EST


On Wed, Mar 25, 2020 at 02:42:27PM +0100, Jiri Slaby wrote:
> On 10. 03. 20, 13:38, Greg Kroah-Hartman wrote:
> > From: Saravana Kannan <saravanak@xxxxxxxxxx>
> >
> > commit 21eb93f432b1a785df193df1a56a59e9eb3a985f upstream.
> >
> > The initial patch that added sync_state() support didn't handle the case
> > where a supplier has no consumers. This was because when a device is
> > successfully bound with a driver, only its suppliers were checked to see
> > if they are eligible to get a sync_state(). This is not sufficient for
> > devices that have no consumers but still need to do device state clean
> > up. So fix this.
> >
> > Fixes: fc5a251d0fd7ca90 (driver core: Add sync_state driver/bus callback)
>
> This causes NULL ptr dereferences (in 5.5 only). It is enough to load
> the mac80211_hwsim module.
>
> The backport to 5.5 needs at least these two commits:
> commit ac338acf514e7b578fa9e3742ec2c292323b4c1a
> Author: Saravana Kannan <saravanak@xxxxxxxxxx>
> Date: Fri Feb 21 00:05:09 2020 -0800
>
> driver core: Add dev_has_sync_state()
>
> commit 77036165d8bcf7c7b2a2df28a601ec2c52bb172d
> Author: Saravana Kannan <saravanak@xxxxxxxxxx>
> Date: Fri Feb 21 00:05:10 2020 -0800
>
> driver core: Skip unnecessary work when device doesn't have sync_state()
>
>
> and playing with includes.
>
> I am not sure if a revert wouldn't be better -- leaving up to maintainers.
>
> https://bugzilla.suse.com/show_bug.cgi?id=1167245

These are already queued up, I think I'll push out an update in a bit
with them in a release...

thanks,

greg k-h