]> 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 08:57:55 +0000 (10:57 +0200)
commit4793d76b829a86310537445e5ed65c0472218804
treed6cf525893596e6ff035b9e6d1c661ccd2539dd3
parent9eeafc9fd196ae95689c721451864a452b1aed6b
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