linux-hardened/drivers/sh/intc
Johannes Weiner 6d75f366b9 lib: radix-tree: check accounting of existing slot replacement users
The bug in khugepaged fixed earlier in this series shows that radix tree
slot replacement is fragile; and it will become more so when not only
NULL<->!NULL transitions need to be caught but transitions from and to
exceptional entries as well.  We need checks.

Re-implement radix_tree_replace_slot() on top of the sanity-checked
__radix_tree_replace().  This requires existing callers to also pass the
radix tree root, but it'll warn us when somebody replaces slots with
contents that need proper accounting (transitions between NULL entries,
real entries, exceptional entries) and where a replacement through the
slot pointer would corrupt the radix tree node counts.

Link: http://lkml.kernel.org/r/20161117193021.GB23430@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Suggested-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox <mawilcox@linuxonhyperv.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-12-12 18:55:08 -08:00
..
access.c sh: Fix up more fallout from pointless ARM __iomem churn. 2012-10-15 14:08:48 +09:00
balancing.c sh: intc: remove dependency on NR_IRQS 2012-01-25 20:37:48 -06:00
chip.c sh/irq: Use access helper irq_data_get_affinity_mask() 2015-07-29 10:08:08 +02:00
core.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
handle.c SuperH updates for 3.4 merge window 2012-03-30 00:09:17 -07:00
internals.h sh: Kill off set_irq_flags usage 2015-09-16 16:53:39 +02:00
irqdomain.c sh: intc: initial irqdomain support. 2012-08-01 17:13:46 +09:00
Kconfig sh: intc: Confine SH_INTC to platforms that need it 2014-08-22 12:28:16 +09:00
Makefile sh: intc: initial irqdomain support. 2012-08-01 17:13:46 +09:00
userimask.c sh: intc - convert sysdev_class to a regular subsystem 2011-12-21 15:09:52 -08:00
virq-debugfs.c
virq.c lib: radix-tree: check accounting of existing slot replacement users 2016-12-12 18:55:08 -08:00