Re: Re: [PATCH net v4] nfc: ... device_is_registered() is data race-able

From: Lin Ma
Date: Thu Apr 28 2022 - 23:17:43 EST


Hello there,

>
> That is what proper reference counting is supposed to be for. Perhaps
> you are running into a driver subsystem that is not doing that well, or
> at all?
>
> Try adding the needed references and the use-after-free should almost be
> impossible to happen.
>

That's true, if all the relevant resources are managed properly by the reference
count, everything will be easier.

> thanks,
>
> greg k-h

Thanks
Lin Ma