From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753175AbdDNO2N (ORCPT ); Fri, 14 Apr 2017 10:28:13 -0400 Received: from muru.com ([72.249.23.125]:44496 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028AbdDNO2M (ORCPT ); Fri, 14 Apr 2017 10:28:12 -0400 Date: Fri, 14 Apr 2017 07:28:08 -0700 From: Tony Lindgren To: Peter Zijlstra Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, juri.lelli@arm.com, bigeasy@linutronix.de, xlpang@redhat.com, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jdesfossez@efficios.com, dvhart@infradead.org, bristot@redhat.com Subject: Re: [PATCH] futex: Fix hrtimer oops in futex_lock_pi() Message-ID: <20170414142807.GU5339@atomide.com> References: <20170414140819.20210-1-tony@atomide.com> <20170414142300.z2risazpvpmjkmfp@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170414142300.z2risazpvpmjkmfp@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra [170414 07:25]: > On Fri, Apr 14, 2017 at 07:08:19AM -0700, Tony Lindgren wrote: > > Commit cfafcd117da0 ("futex: Rework futex_lock_pi() to use > > rt_mutex_*_proxy_lock()") caused a regression where things would > > occasionally randomly oops when restarting X: > > > > Unable to handle kernel NULL pointer dereference at virtual address 00000000 > > ... > > Internal error: Oops: 80000005 [#1] SMP ARM > > ... > > PC is at 0x0 > > LR is at __hrtimer_run_queues+0x138/0x58c > > pc : [<00000000>] lr : [] psr: 20000193 > > ... > > [] (__hrtimer_run_queues) from [] > > (hrtimer_interrupt+0xbc/0x210) > > [] (hrtimer_interrupt) from [] > > ... > > > > When this happens, the hrtimer is not properly initialized and it's > > function is NULL. This happens because we now call hrtimer_start_expires() > > in futex_lock_pi() for the timer initialized with hrtimer_init_on_stack(). > > > > To fix it, let's pair the hrtimer_start_expires() with hrtimer_cancel() > > in the same function. > > Already fixed: > > https://lkml.kernel.org/r/tip-97181f9bd57405b879403763284537e27d46963d@git.kernel.org > > Thanks for the patch though. Oh OK thanks. It seems to be missing in Linux next though. Regards, Tony