kernfs: fix missing kernfs_idr_lock to remove an ID from the IDR
authorMuchun Song <songmuchun@bytedance.com>
Tue, 23 May 2023 02:40:17 +0000 (10:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 May 2023 18:03:49 +0000 (19:03 +0100)
commit30480b988f88c279752f3202a26b6fee5f586aef
treefda750c9a4a86d34cfd2f3da57b2fddba9dd2f68
parent6bea9ea6bb21ccee2aad0aa2a845499e0aa2f7f9
kernfs: fix missing kernfs_idr_lock to remove an ID from the IDR

The root->ino_idr is supposed to be protected by kernfs_idr_lock, fix
it.

Fixes: 488dee96bb62 ("kernfs: allow creating kernfs objects with arbitrary uid/gid")
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20230523024017.24851-1-songmuchun@bytedance.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/kernfs/dir.c