Skip to content

Commit

Permalink
[S390] futex: let futex_atomic_cmpxchg_pt survive early functional te…
Browse files Browse the repository at this point in the history
…sts.

a0c1e90 "futex: runtime enable pi and
robust functionality" introduces a test wether futex in atomic stuff
works or not.
It does that by writing to address 0 of the kernel address space. This
will crash on older machines where addressing mode switching is enabled
but where the mvcos instruction is not available. Page table walking is
done by hand and therefore the code tries to access current->mm which
is NULL.
Therefore add an extra check, so we survive the early test.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Mar 20, 2008
1 parent 457fb60 commit 504e75d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/s390/lib/uaccess_pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ int futex_atomic_cmpxchg_pt(int __user *uaddr, int oldval, int newval)
{
int ret;

if (!current->mm)
return -EFAULT;
spin_lock(&current->mm->page_table_lock);
uaddr = (int __user *) __dat_user_addr((unsigned long) uaddr);
if (!uaddr) {
Expand Down

0 comments on commit 504e75d

Please sign in to comment.