• Steven Rostedt (VMware)'s avatar
    ring-buffer: Fix recursion protection transitions between interrupt context · b02414c8
    Steven Rostedt (VMware) authored
    The recursion protection of the ring buffer depends on preempt_count() to be
    correct. But it is possible that the ring buffer gets called after an
    interrupt comes in but before it updates the preempt_count(). This will
    trigger a false positive in the recursion code.
    
    Use the same trick from the ftrace function callback recursion code which
    uses a "transition" bit that gets set, to allow for a single recursion for
    to handle transitions between contexts.
    
    Cc: stable@vger.kernel.org
    Fixes: 567cd4da ("ring-buffer: User context bit recursion checking")
    Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    b02414c8
ring_buffer.c 153 KB