]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lockdep/mm: Fix might_fault() lockdep check of current->mm->mmap_lock
authorPeter Zijlstra <peterz@infradead.org>
Mon, 4 Nov 2024 13:39:10 +0000 (14:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:33:30 +0000 (14:33 +0200)
commit53d472f97235346f77fc2c9305438b9d9a595229
tree7c906552a1c0ca738eb50c7513b41d111642a6d3
parent2380b9f5aa7ac4bc08c80806b2e343744dc02b0a
lockdep/mm: Fix might_fault() lockdep check of current->mm->mmap_lock

[ Upstream commit a1b65f3f7c6f7f0a08a7dba8be458c6415236487 ]

Turns out that this commit, about 10 years ago:

  9ec23531fd48 ("sched/preempt, mm/fault: Trigger might_sleep() in might_fault() with disabled pagefaults")

... accidentally (and unnessecarily) put the lockdep part of
__might_fault() under CONFIG_DEBUG_ATOMIC_SLEEP=y.

This is potentially notable because large distributions such as
Ubuntu are running with !CONFIG_DEBUG_ATOMIC_SLEEP.

Restore the debug check.

[ mingo: Update changelog. ]

Fixes: 9ec23531fd48 ("sched/preempt, mm/fault: Trigger might_sleep() in might_fault() with disabled pagefaults")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: https://lore.kernel.org/r/20241104135517.536628371@infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
mm/memory.c