X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=include%2Fasm-parisc%2Ffutex.h;h=0c705c3a55efc01305dbea4e14eecf63c0f3f05e;hb=a5e8546a8bff5d2047adc279df5753c44ba7b1a1;hp=dbee6e60aa8139e66897ba65ba4ac9155bf00dab;hpb=2685b267bce34c9b66626cb11664509c32a761a5;p=linux-2.6-omap-h63xx.git diff --git a/include/asm-parisc/futex.h b/include/asm-parisc/futex.h index dbee6e60aa8..0c705c3a55e 100644 --- a/include/asm-parisc/futex.h +++ b/include/asm-parisc/futex.h @@ -4,8 +4,8 @@ #ifdef __KERNEL__ #include +#include #include -#include static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) @@ -56,6 +56,12 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) int err = 0; int uval; + /* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is + * our gateway page, and causes no end of trouble... + */ + if (segment_eq(KERNEL_DS, get_fs()) && !uaddr) + return -EFAULT; + if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) return -EFAULT; @@ -67,5 +73,5 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) return uval; } -#endif -#endif +#endif /*__KERNEL__*/ +#endif /*_ASM_PARISC_FUTEX_H*/