Skip to content

Commit

Permalink
[S390] check addressing mode in s390_enable_sie
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Carsten Otte authored and Martin Schwidefsky committed Mar 26, 2009
1 parent 3324e60 commit 702d9e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/s390/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ int s390_enable_sie(void)
struct task_struct *tsk = current;
struct mm_struct *mm, *old_mm;

/* Do we have switched amode? If no, we cannot do sie */
if (!switch_amode)
return -EINVAL;

/* Do we have pgstes? if yes, we are done */
if (tsk->mm->context.has_pgste)
return 0;
Expand Down

0 comments on commit 702d9e5

Please sign in to comment.