Re: [PATCH] kernfs: fix potential NULL dereference in __kernfs_remove

From: Greg KH
Date: Thu Jun 30 2022 - 03:28:15 EST


On Thu, Jun 30, 2022 at 12:00:47PM +0800, zys.zljxml@xxxxxxxxx wrote:
> From: katrinzhou <katrinzhou@xxxxxxxxxxx>
>
> When lockdep is enabled, lockdep_assert_held_write would
> cause potential NULL pointer dereference.
>
> Fix the folloeing smatch warnings:
>
> fs/kernfs/dir.c:1353 __kernfs_remove() warn: variable dereferenced before check 'kn' (see line 1346)
>
> Signed-off-by: katrinzhou <katrinzhou@xxxxxxxxxxx>

Can you please submit this with your legal name that you use to sign
documents?

Also, what commit id does this fix? Did you actually hit this with a
real workload? How can this be reproduced and tested?

thanks,

greg k-h