Commit a3f6cf1
Herton R. Krzesinski
Merge: kernfs: fix use-after-free in __kernfs_remove
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2020
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2143947
Upstream status: Linus
Syzkaller triggered concurrent calls to kernfs_remove_by_name_ns()
for the same file resulting in a KASAN detected use-after-free. The
race occurs when the root node is freed during kernfs_drain().
The change prevents this by acquiring an additional reference for
the root of the sub-tree of kernfs nodes that is being removed
before calling __kernfs_remove().
Signed-off-by: Ian Kent <ikent@redhat.com>
Approved-by: Bill O'Donnell <bodonnel@redhat.com>
Approved-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1569 | 1569 | | |
1570 | 1570 | | |
1571 | 1571 | | |
1572 | | - | |
| 1572 | + | |
| 1573 | + | |
1573 | 1574 | | |
| 1575 | + | |
| 1576 | + | |
1574 | 1577 | | |
1575 | 1578 | | |
1576 | 1579 | | |
| |||
0 commit comments