From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756307AbbCLTiZ (ORCPT ); Thu, 12 Mar 2015 15:38:25 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.229]:25912 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754156AbbCLTON (ORCPT ); Thu, 12 Mar 2015 15:14:13 -0400 Message-Id: <20150312191409.880520048@goodmis.org> User-Agent: quilt/0.61-1 Date: Thu, 12 Mar 2015 15:13:24 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-rt-users Cc: Thomas Gleixner , Carsten Emde , Sebastian Andrzej Siewior , John Kacur , Paul Gortmaker , Brad Mouring , Ben Shelton , T Makphaibulchoke , Subject: [PATCH RT 17/39] rtmutex.c: Fix incorrect waiter check References: <20150312191307.081068717@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=0017-rtmutex.c-Fix-incorrect-waiter-check.patch X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.14.34-rt32-rc1 stable review patch. If anyone has any objections, please let me know. ------------------ From: Brad Mouring 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 Reported-by: Ben Shelton Reviewed-by: T Makphaibulchoke Tested-by: T Makphaibulchoke Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Steven Rostedt --- kernel/locking/rtmutex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } /* -- 2.1.4