Re: [PATCH] kernfs: fix potential NULL dereference in __kernfs_remove
From: Katrin Jo
Date: Thu Jun 30 2022 - 04:16:24 EST
On Thu, Jun 30, 2022 at 3:28 PM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> 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
Sorry for the formatting issue. I'll submit a new patch soon.
This problem is found via static code analysis, and by now
I have not reproduced / tested it.
Best regards,
Katrin