diff options
| author | Heiko Carstens <hca@linux.ibm.com> | 2026-07-20 10:58:32 +0200 |
|---|---|---|
| committer | Vasily Gorbik <gor@linux.ibm.com> | 2026-07-30 00:29:10 +0200 |
| commit | da1f5a7dcf1826d90b8dffe7a2fb6c280d15227a (patch) | |
| tree | 1ddf0c58b7e8e8157d3650f9aff28901e604e757 | |
| parent | ecb00aa6fb7f473136fb2e496ad91116a568fc7f (diff) | |
| download | linux-next-da1f5a7dcf1826d90b8dffe7a2fb6c280d15227a.tar.gz linux-next-da1f5a7dcf1826d90b8dffe7a2fb6c280d15227a.zip | |
s390/mm: Use handle_fault_error() in do_secure_storage_access()
Similar to the normal exception handler use handle_fault_error() which
handles accesses from user space and kernel space differently.
This also addresses failing kernel accesses via e.g. copy_from_user() to
user space: instead of an endless loop, the fixup handling is performed.
Even though this could only happen if arch_make_folio_accessible() would
permanently fail, which is not realistic.
Therefore this is rather a cleanup patch.
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
| -rw-r--r-- | arch/s390/mm/fault.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 776549d55c94..2a9b9fb30d09 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -427,10 +427,8 @@ void do_secure_storage_access(struct pt_regs *regs) * was not supposed to do, e.g. branching into secure * memory. Trigger a segmentation fault. */ - if (user_mode(regs)) { - send_sig(SIGSEGV, current, 0); - return; - } + if (user_mode(regs)) + return handle_fault_error_nolock(regs, SEGV_ACCERR); /* * The kernel should never run into this case and * there is no way out of this situation. @@ -465,7 +463,7 @@ void do_secure_storage_access(struct pt_regs *regs) folio_put(folio); folio_walk_end(&fw, vma); if (rc) - send_sig(SIGSEGV, current, 0); + return handle_fault_error(regs, SEGV_ACCERR); mmap_read_unlock(mm); } } |
