Re: [syzbot] KASAN: use-after-free Read in kernfs_next_descendant_post (2)

From: Tejun Heo
Date: Tue Nov 15 2022 - 17:14:16 EST


On Tue, Nov 15, 2022 at 11:35:10AM -0800, Luis Chamberlain wrote:
> request_firmware_nowait() is documented as requiring the caller to
> ensure to maintain the the reference count of @device during the
> lifetime of the call to request_firmware_nowait() and the callback.

My reading was that just holding the ref isn't enough. The code expects the
device to be not destroyed independent of the refcnt. I don't see how this
would be fixed by diddling with refcnt.

Thanks.

--
tejun