From: Carsten Otte Date: Thu, 26 Mar 2009 14:23:57 +0000 (+0100) Subject: [S390] check addressing mode in s390_enable_sie X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=702d9e584feb028ed7e2a6d2b103b8ea57622ff2;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 6b6ddc4ea02..9bf86125f6f 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c @@ -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;