]> git.karo-electronics.de Git - karo-tx-linux.git/commit
MIPS: Compat: Use 32-bit wrapper for compat_sys_futex.
authorYong Zhang <yong.zhang@windriver.com>
Tue, 16 Aug 2011 01:54:54 +0000 (09:54 +0800)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 17 Sep 2011 00:45:47 +0000 (02:45 +0200)
commit6833598fae02dc7bcd06975a949710fe8ad73bdc
tree8e13244ea5860be25f15f25aae997d72fb4f634e
parent33a7e98dd6b64e837031fde57a8d48d342d62fbb
MIPS: Compat: Use 32-bit wrapper for compat_sys_futex.

We can't trust userspace to pass signed-extend arguments.  Not correctly
sign-extended arguments to futex-wait result in architecturally undefined
operation of 32-bit arithmetic instructions.

For example, if 'val' is too big and bit-31 is 1, the caller may enter
endless loop at:

futex_wait_setup()
{
...

if (uval != val) {
queue_unlock(q, *hb);
ret = -EWOULDBLOCK;

...
}

Signed-off-by: Yong Zhang <yong.zhang@windriver.com>
To: linux-mips@linux-mips.org
To: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/2714/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/linux32.c
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S