linux-brain/drivers/hwspinlock
Matthew Wilcox 077b6173a8 drivers/hwspinlock: fix race between radix tree insertion and lookup
commit c6400ba7e1 upstream.

of_hwspin_lock_get_id() is protected by the RCU lock, which means that
insertions can occur simultaneously with the lookup.  If the radix tree
transitions from a height of 0, we can see a slot with the indirect_ptr
bit set, which will cause us to at least read random memory, and could
cause other havoc.

Fix this by using the newly introduced radix_tree_iter_retry().

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 12:01:23 -08:00
..
Kconfig hwspinlock: add a CSR atlas7 driver 2015-06-12 10:44:06 +03:00
Makefile hwspinlock: add a CSR atlas7 driver 2015-06-12 10:44:06 +03:00
hwspinlock_core.c drivers/hwspinlock: fix race between radix tree insertion and lookup 2016-02-25 12:01:23 -08:00
hwspinlock_internal.h hwspinlock/core: register a bank of hwspinlocks in a single API call 2011-09-21 19:45:34 +03:00
omap_hwspinlock.c hwspinlock/omap: add support for dt nodes 2015-05-02 10:05:10 +03:00
qcom_hwspinlock.c hwspinlock: qcom: Correct msb in regmap_field 2015-07-01 16:15:05 +03:00
sirf_hwspinlock.c hwspinlock: add a CSR atlas7 driver 2015-06-12 10:44:06 +03:00
u8500_hsem.c hwspinlock: drop owner assignment from platform_drivers 2014-10-20 16:20:37 +02:00