From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751565AbdJ0OPd (ORCPT ); Fri, 27 Oct 2017 10:15:33 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:46615 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751326AbdJ0OPZ (ORCPT ); Fri, 27 Oct 2017 10:15:25 -0400 Date: Fri, 27 Oct 2017 16:15:02 +0200 From: Peter Zijlstra To: Borislav Petkov Cc: zhouchengming , mhiramat@kernel.org, ananth@linux.vnet.ibm.com, anil.s.keshavamurthy@intel.com, davem@davemloft.net, hpa@zytor.com, tglx@linutronix.de, jkosina@suse.cz, rostedt@goodmis.org, mjurczyk@google.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kprobes, x86/alternatives: use text_mutex to protect smp_alt_modules Message-ID: <20171027141502.GA3165@worktop.lehotels.local> References: <1509096884-22993-1-git-send-email-zhouchengming1@huawei.com> <20171027111527.GD1305@nazgul.tnic> <59F31BB5.90905@huawei.com> <20171027123348.GE1305@nazgul.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171027123348.GE1305@nazgul.tnic> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 27, 2017 at 02:33:48PM +0200, Borislav Petkov wrote: > On Fri, Oct 27, 2017 at 07:42:45PM +0800, zhouchengming wrote: > > This is a real bug happened on one of our machines, below is the calltrace. > > We can see the trigger is at alternatives_text_reserved+0x20/0x80, and > > encounter a deleted (poisoned) list_head. > > Looks like some out-of-tree, old kernel thing. We don't have > mlx4_stats_sysfs_create() upstream and looking at the boot timestamps, > it could be that register_jprobe() is not ready yet. > > Looking at the Code, though: > > 20: 74 59 je 0x7b > 22: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1) > 29: 00 00 > 2b:* 48 3b 71 20 cmp 0x20(%rcx),%rsi <-- trapping instruction > 2f: 72 3a jb 0x6b > 31: 48 3b 79 28 cmp 0x28(%rcx),%rdi > 35: 77 34 ja 0x6b > > %rcx is 0xdead0000000000d0 and that is POISON_POINTER_DELTA + 0xd0 so > that looks more like smp_alt_modules is not initialized yet but I could > could very well be wrong because this is an old kernel. So trigger that > with the upstream kernel without out of tree modules. Not to mention that we're about (or just have) yanked jprobes out of the kernel entirely.