summaryrefslogtreecommitdiff
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-11-04 14:06:23 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-11-04 18:06:14 +0100
commit9d820f68b2bdba5b2e7bf135123c3f57c5051d05 (patch)
tree5bffbaa5d0616b2ba79f0d4194876730a22fdeca /kernel/audit.c
parent3cea11cd5e3b00d91caf0b4730194039b45c5891 (diff)
entry: Fix the incorrect ordering of lockdep and RCU check
When an exception/interrupt hits kernel space and the kernel is not currently in the idle task then RCU must be watching. irqentry_enter() validates this via rcu_irq_enter_check_tick(), which in turn invokes lockdep when taking a lock. But at that point lockdep does not yet know about the fact that interrupts have been disabled by the CPU, which triggers a lockdep splat complaining about inconsistent state. Invoking trace_hardirqs_off() before rcu_irq_enter_check_tick() defeats the point of rcu_irq_enter_check_tick() because trace_hardirqs_off() uses RCU. So use the same sequence as for the idle case and tell lockdep about the irq state change first, invoke the RCU check and then do the lockdep and tracer update. Fixes: a5497bab5f72 ("entry: Provide generic interrupt entry/exit code") Reported-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Mark Rutland <mark.rutland@arm.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/87y2jhl19s.fsf@nanos.tec.linutronix.de
Diffstat (limited to 'kernel/audit.c')
0 files changed, 0 insertions, 0 deletions