idr test suite: Take RCU read lock in idr_find_test_1
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 1 Apr 2021 11:44:48 +0000 (07:44 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Apr 2021 09:43:21 +0000 (11:43 +0200)
commit9a7552daa93bf38f6975cb47f6f726d3e2b81a60
tree03e407b74f3e8d8ba57d4b97ca6f2c9afe1595c9
parentedd822b6924154c84383c3a9a513a7c9b7c98fd8
idr test suite: Take RCU read lock in idr_find_test_1

[ Upstream commit 703586410da69eb40062e64d413ca33bd735917a ]

When run on a single CPU, this test would frequently access already-freed
memory.  Due to timing, this bug never showed up on multi-CPU tests.

Reported-by: Chris von Recklinghausen <crecklin@redhat.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/radix-tree/idr-test.c