]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
userfaultfd: disable irqs when taking the waitqueue lock
authorChristoph Hellwig <hch@lst.de>
Fri, 26 Oct 2018 22:02:19 +0000 (15:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:46 +0000 (11:08 -0800)
commitd2e97f026b1b8948a9782c4c42a87a51da455a55
treecf6c38d1fea32b79dded638566b15a3f55386aa8
parent30391e41deef661849d6c2d345a8c87eb4fdcf5a
userfaultfd: disable irqs when taking the waitqueue lock

commit ae62c16e105a869524afcf8a07ee85c5ae5d0479 upstream.

userfaultfd contains howe-grown locking of the waitqueue lock, and does
not disable interrupts.  This relies on the fact that no one else takes it
from interrupt context and violates an invariat of the normal waitqueue
locking scheme.  With aio poll it is easy to trigger other locks that
disable interrupts (or are called from interrupt context).

Link: http://lkml.kernel.org/r/20181018154101.18750-1-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@vger.kernel.org> [4.19.x]
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>
fs/userfaultfd.c