summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2026-07-20 10:58:28 +0200
committerVasily Gorbik <gor@linux.ibm.com>2026-07-30 00:29:10 +0200
commit7cf227b2707ed0129018c283ffc8f893945586db (patch)
tree6ad119e9e19c2963753aae0508c43ff9b9282820
parentaab0734094cef631d611e404c389d89f0b869f5d (diff)
downloadlinux-next-7cf227b2707ed0129018c283ffc8f893945586db.tar.gz
linux-next-7cf227b2707ed0129018c283ffc8f893945586db.zip
s390/mm: Add missing mm check to do_secure_storage_access()
Similar like the normal exception handler the secure storage access exception handler needs to verify if mm is not NULL, which may happen with kernel threads. Reported-by: sashiko-bot <sashiko-bot@kernel.org> Closes: https://lore.kernel.org/all/20260717132345.539A11F00A3A@smtp.kernel.org/ Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>> --- Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-rw-r--r--arch/s390/mm/fault.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 028aeb9c48d6..2839d7a64401 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -409,9 +409,9 @@ void do_secure_storage_access(struct pt_regs *regs)
{
union teid teid = { .val = regs->int_parm_long };
unsigned long addr = get_fault_address(regs);
+ struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
struct folio_walk fw;
- struct mm_struct *mm;
struct folio *folio;
int rc;
@@ -453,9 +453,8 @@ void do_secure_storage_access(struct pt_regs *regs)
if (rc)
return handle_fault_error_nolock(regs, 0);
} else {
- if (faulthandler_disabled())
+ if (faulthandler_disabled() || !mm)
return handle_fault_error_nolock(regs, 0);
- mm = current->mm;
mmap_read_lock(mm);
vma = find_vma(mm, addr);
if (!vma)