Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[S390] check addressing mode in s390_enable_sie

The sie instruction requires address spaces to be switched
to run proper. This patch verifies that this is the case
in s390_enable_sie, otherwise the kernel would crash badly
as soon as the process runs into sie.

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Carsten Otte and committed by
Martin Schwidefsky
702d9e58 3324e60a

+4
+4
arch/s390/mm/pgtable.c
··· 258 258 struct task_struct *tsk = current; 259 259 struct mm_struct *mm, *old_mm; 260 260 261 + /* Do we have switched amode? If no, we cannot do sie */ 262 + if (!switch_amode) 263 + return -EINVAL; 264 + 261 265 /* Do we have pgstes? if yes, we are done */ 262 266 if (tsk->mm->context.has_pgste) 263 267 return 0;