diff options
author | Brad Mouring <bmouring@ni.com> | 2015-01-14 15:11:38 -0600 |
---|---|---|
committer | Anders Roxell <anders.roxell@linaro.org> | 2015-06-26 22:31:38 +0200 |
commit | 66ad78ff0b5b2baacd8e1a13767a2dd369fc63c2 (patch) | |
tree | c308e18371dd272a2f3266f4bdf17b5556f29a94 | |
parent | 6e2a00525a3267c0afc87fc9506686ef26c06055 (diff) |
rtmutex.c: Fix incorrect waiter check
In task_blocks_on_lock, there's a null check on pi_blocked_on
of the task_struct. This pointer can encode the fact that the
task that contains the pointer is waking (preventing requeuing)
and therefore is non-null. Use the inline function to avoid
dereferencing an invalid "pointer"
Signed-off-by: Brad Mouring <brad.mouring@ni.com>
Reported-by: Ben Shelton <ben.shelton@ni.com>
Reviewed-by: T Makphaibulchoke <tmac@hp.com>
Tested-by: T Makphaibulchoke <tmac@hp.com>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/locking/rtmutex.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index ec72272ab73a..74a824523d3a 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -361,7 +361,8 @@ int max_lock_depth = 1024; static inline struct rt_mutex *task_blocked_on_lock(struct task_struct *p) { - return p->pi_blocked_on ? p->pi_blocked_on->lock : NULL; + return rt_mutex_real_waiter(p->pi_blocked_on) ? + p->pi_blocked_on->lock : NULL; } /* |