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)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 5 May 2025 08:24:58 +0000 (10:24 +0200)
commit6767e8784cd2e8b386a62330ea6864949d983a3e
tree35ea55cb2abcd0e78da3901fe9dc2d0b4f78c833
parent49caacf1004d1e1fc40cfab165f104d051867c6e
um: use proper care when taking mmap lock during segfault

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>
arch/um/kernel/trap.c