• Darren Hart's avatar
    futex: Check for NULL keys in match_futex · 6d57fbdd
    Darren Hart authored
    commit 2bc87203 upstream.
    
    If userspace tries to perform a requeue_pi on a non-requeue_pi waiter,
    it will find the futex_q->requeue_pi_key to be NULL and OOPS.
    
    Check for NULL in match_futex() instead of doing explicit NULL pointer
    checks on all call sites.  While match_futex(NULL, NULL) returning
    false is a little odd, it's still correct as we expect valid key
    references.
    Signed-off-by: default avatarDarren Hart <dvhltc@us.ibm.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Ingo Molnar <mingo@elte.hu>
    CC: Eric Dumazet <eric.dumazet@gmail.com>
    CC: Dinakar Guniguntala <dino@in.ibm.com>
    CC: John Stultz <johnstul@us.ibm.com>
    LKML-Reference: <4AD60687.10306@us.ibm.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    6d57fbdd
futex.c 66.8 KB