]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
futex: Handle futex value corruption gracefully
authorThomas Gleixner <tglx@linutronix.de>
Wed, 3 Feb 2010 08:33:05 +0000 (09:33 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:52:16 +0000 (15:52 -0700)
commit268ec2564310a552681bcbfb412c35804c06efad
tree884f6117803642af2e886839090257d8a1e155b1
parent24fce8f6a79db04afef0c6118f6ecdcfec12ffc4
futex: Handle futex value corruption gracefully

commit 59647b6ac3050dd964bc556fe6ef22f4db5b935c upstream.

The WARN_ON in lookup_pi_state which complains about a mismatch
between pi_state->owner->pid and the pid which we retrieved from the
user space futex is completely bogus.

The code just emits the warning and then continues despite the fact
that it detected an inconsistent state of the futex. A conveniant way
for user space to spam the syslog.

Replace the WARN_ON by a consistency check. If the values do not match
return -EINVAL and let user space deal with the mess it created.

This also fixes the missing task_pid_vnr() when we compare the
pi_state->owner pid with the futex value.

Reported-by: Jermome Marchand <jmarchan@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Darren Hart <dvhltc@us.ibm.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/futex.c