From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033907AbdEYKex (ORCPT ); Thu, 25 May 2017 06:34:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:33238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934543AbdEYKew (ORCPT ); Thu, 25 May 2017 06:34:52 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F21823955 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mhiramat@kernel.org Date: Thu, 25 May 2017 19:34:43 +0900 From: Masami Hiramatsu To: Masami Hiramatsu Cc: Steven Rostedt , Thomas Gleixner , Kees Cook , LKML , x86@kernel.org, "Luis R. Rodriguez" , Peter Zijlstra Subject: Re: [PATCH] x86/ftrace: Make sure that ftrace trampolines are not RWX Message-Id: <20170525193443.0a829e456d8c26102d18a435@kernel.org> In-Reply-To: <20170525180910.0a19b5de03a86ad764e8ed6b@kernel.org> References: <20170524134728.61a896c9@vmware.local.home> <20170524182547.5c085dc7@vmware.local.home> <20170525180910.0a19b5de03a86ad764e8ed6b@kernel.org> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 May 2017 18:09:10 +0900 Masami Hiramatsu wrote: > On Wed, 24 May 2017 18:25:47 -0400 > Steven Rostedt wrote: > > > On Wed, 24 May 2017 21:13:27 +0200 (CEST) > > Thomas Gleixner wrote: > > > > > > > > Oops: 0003 [#1] SMP > > > > Modules linked in: > > > > CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc2-test+ #42 > > > > Hardware name: MSI MS-7823/CSM-H87M-G43 (MS-7823), BIOS V1.6 > > > > 02/22/2014 task: ffff8802153a8000 task.stack: ffffc90000c74000 > > > > RIP: 0010:new_slab+0x1e8/0x2b4 > > > > RSP: 0000:ffffc90000c77b28 EFLAGS: 00010282 > > > > RAX: 0000000040040000 RBX: ffff880216003f00 RCX: ffff880214f5c058 > > > > RDX: 0000000000000000 RSI: ffff880214f5c000 RDI: ffff880216003f00 > > > > RBP: ffffc90000c77b70 R08: 000000000000002a R09: 0000000000000000 > > > > R10: 00000000000201e2 R11: 0000000000020190 R12: ffff880214f5c000 > > > > R13: 000000000000002e R14: 0000000000000001 R15: ffffea000853d700 > > > > FS: 0000000000000000(0000) GS:ffff88021eb80000(0000) > > > > knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: > > > > 0000000080050033 CR2: ffff880214f5c000 CR3: 000000000221d000 CR4: > > > > 00000000001406e0 Call Trace: > > > > ? interleave_nodes+0x29/0x40 > > > > ___slab_alloc+0x2e8/0x49e > > > > > > That does not make any sense, but I'm digging into it. > > > > The trampolines uses the module allocation, and it appears, that needs > > to become rw before freeing again. > > Oops, I also have to fix kprobes side, because it has same issue. OK, I've ensured that following command hits same BUG. grep t /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \ head -n 256 | while read i; do echo p $i+5 ; done > tracing/kprobe_events echo 1 > tracing/events/kprobes/enable echo 0 > tracing/events/kprobes/enable echo > tracing/kprobe_events sleep 5 I'll send a bugfix asap. Thank, -- Masami Hiramatsu