]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
um: use proper care when taking mmap lock during segfault
authorBenjamin Berg <benjamin.berg@intel.com>
Tue, 8 Apr 2025 07:45:24 +0000 (09:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Jul 2025 09:00:07 +0000 (11:00 +0200)
commit8dbc01f09cadb8b5ef7fc4fc9b4cceca5fbb7c92
tree61f2a981a75c9b137f70b8638475d0a8eb39a6b5
parent265ca1741075c8d17dae94b25c8439188be66b0a
um: use proper care when taking mmap lock during segfault

[ Upstream commit 6767e8784cd2e8b386a62330ea6864949d983a3e ]

Segfaults can occur at times where the mmap lock cannot be taken. If
that happens the segfault handler may not be able to take the mmap lock.

Fix the code to use the same approach as most other architectures.
Unfortunately, this requires copying code from mm/memory.c and modifying
it slightly as UML does not have exception tables.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250408074524.300153-2-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/kernel/trap.c