]> www.infradead.org Git - users/jedix/linux-maple.git/commit
powerpc/mm: fix mmap_lock bad unlock
authorLaurent Dufour <ldufour@linux.ibm.com>
Mon, 6 Mar 2023 15:42:44 +0000 (16:42 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 28 Mar 2023 23:24:56 +0000 (16:24 -0700)
commit1aee067170a30293cde19c45c7b9a84ca96a7b32
tree31cfef2f8237c708f974fb1abcd13f5b146b684f
parente70af31d17d406076e14ed303c3ec3bad260e6da
powerpc/mm: fix mmap_lock bad unlock

When page fault is tried holding the per VMA lock, bad_access_pkey() and
bad_access() should not be called because it is assuming the mmap_lock is
held.  In the case a bad access is detected, fall back to the default
path, grabbing the mmap_lock to handle the fault and report the error.

Link: https://lkml.kernel.org/r/20230306154244.17560-1-ldufour@linux.ibm.com
Fixes: 169db3bb4609 ("powerc/mm: try VMA lock-based page fault handling first")
Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Link: https://lore.kernel.org/linux-mm/842502FB-F99C-417C-9648-A37D0ECDC9CE@linux.ibm.com
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/mm/fault.c