Re: [PATCH] sbitmap: Protect swap_lock from softirqs

From: Linus Torvalds
Date: Mon Jan 14 2019 - 14:33:22 EST


On Tue, Jan 15, 2019 at 5:25 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> The swap_lock used by sbitmap has a chain with locks taken from
> softirq, but the swap_lock is not protected from being preempted by
> softirqs.
>
> A chain exists of:
>
> sbq->ws[i].wait -> dispatch_wait_lock -> swap_lock
>
> Where the sbq->ws[i].wait lock can be taken from softirq context, which
> means all locks below it in the chain must also be protected from
> softirqs.
>
> Cc: stable@xxxxxxxxxxxxxxx

Ack and applied, except for the "stable" tag.

Both the original buggy code, and the incorrect "shut up lockdep" were
only merged after 4.20.

Linus