Commit graph

3 commits

Author SHA1 Message Date
Ksawlii
bfd9345726 Revert "lib/generic-radix-tree.c: Fix rare race in __genradix_ptr_alloc()"
This reverts commit 954db9c08b.
2024-11-24 00:23:38 +01:00
Kent Overstreet
954db9c08b lib/generic-radix-tree.c: Fix rare race in __genradix_ptr_alloc()
[ Upstream commit b2f11c6f3e1fc60742673b8675c95b78447f3dae ]

If we need to increase the tree depth, allocate a new node, and then
race with another thread that increased the tree depth before us, we'll
still have a preallocated node that might be used later.

If we then use that node for a new non-root node, it'll still have a
pointer to the old root instead of being zeroed - fix this by zeroing it
in the cmpxchg failure path.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:21:06 +01:00
Gabriel2392
7ed7ee9edf Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00