From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751500AbdEOWGx (ORCPT ); Mon, 15 May 2017 18:06:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:53438 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751068AbdEOWGv (ORCPT ); Mon, 15 May 2017 18:06:51 -0400 Date: Tue, 16 May 2017 00:06:50 +0200 From: "Luis R. Rodriguez" To: Stephen Smalley , Ingo Molnar Cc: Andy Lutomirski , Michal Hocko , Andrew Morton , Kees Cook , "Eric W. Biederman" , Mateusz Guzik , mcgrof@kernel.org, linux-kernel@vger.kernel.org Subject: next-20170515: WARNING: CPU: 0 PID: 1 at arch/x86/mm/dump_pagetables.c:236 note_page+0x630/0x7e0 Message-ID: <20170515220650.GD17314@wotan.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For a few kernel releases now I have managed to trigger the warning added via commit e1a58320a38dfa ("x86/mm: Warn on W^X mappings", merged upstream since v4.4) on my KVM qemu x86_64 system. Since I just booted into the shiny new linux-next tag next-20170515 (based on v4.12-rc1) and this is still triggering I figured its time to tackle this. Let me know if this is already known or what can be done to try to fix this. Using QEMU emulator version 2.7.94 (v2.8.0-rc4-dirty) I will try updating my distro package for qemu and see if perhaps its this and for the other odd fork issue I reported [0]. [0] https://lkml.kernel.org/r/CAB=NE6VZXq3y-3pfouYTBUco2Cq2xqoLZrgDFdVx+_=_=SwG_Q@mail.gmail.com My config: http://drvbp1.linux-foundation.org/~mcgrof/2017/05/15/configs/piggy-x86_64_qemu_fork_kmemleak.config The splat: [ 0.911209] x86/mm: Found insecure W+X mapping at address ffffffffc0288000/0xffffffffc0288000 [ 0.912066] ------------[ cut here ]------------ [ 0.912544] WARNING: CPU: 0 PID: 1 at arch/x86/mm/dump_pagetables.c:236 note_page+0x630/0x7e0 [ 0.913381] Modules linked in: [ 0.913672] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc1-next-20170515+ #144 [ 0.914434] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.10.1-0-g8891697-prebuilt.qemu-project.org 04/01/2014 [ 0.915595] task: ffff98d43a5eac80 task.stack: ffffad22c0630000 [ 0.916174] RIP: 0010:note_page+0x630/0x7e0 [ 0.916595] RSP: 0018:ffffad22c0633df0 EFLAGS: 00010286 [ 0.917101] RAX: 0000000000000051 RBX: ffffad22c0633e88 RCX: ffffffff91256708 [ 0.917805] RDX: 0000000000000000 RSI: 0000000000000096 RDI: 0000000000000246 [ 0.918511] RBP: ffffad22c0633e28 R08: 6666666666666678 R09: 0000000000000160 [ 0.919214] R10: ffffad22c0633dd8 R11: 3030303838323063 R12: 0000000000000000 [ 0.919917] R13: 0000000000000004 R14: 0000000000000000 R15: 0000000000000000 [ 0.920615] FS: 0000000000000000(0000) GS:ffff98d43fc00000(0000) knlGS:0000000000000000 [ 0.921384] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 0.921943] CR2: 0000000000000000 CR3: 00000000a3a09000 CR4: 00000000000006f0 [ 0.922657] Call Trace: [ 0.922901] ptdump_walk_pgd_level_core+0x3e7/0x490 [ 0.923354] ? 0xffffffff90600000 [ 0.923662] ptdump_walk_pgd_level_checkwx+0x17/0x20 [ 0.924145] mark_rodata_ro+0xf4/0x100 [ 0.924536] ? rest_init+0x80/0x80 [ 0.924862] kernel_init+0x2f/0x100 [ 0.925197] ret_from_fork+0x2c/0x40 [ 0.925552] Code: 48 c7 43 28 00 00 00 00 48 89 43 20 e9 05 fd ff ff 48 8b 73 10 48 c7 c7 c8 34 fe 90 c6 05 c8 eb bc 00 01 48 89 f2 e8 8d fc 11 00 <0f> ff e9 1f fa ff ff 48 8b 70 20 48 c7 c7 05 b1 fe 90 e8 76 fc [ 0.927368] ---[ end trace 97137ae213b9cb25 ]--- [ 0.927830] x86/mm: Checked W+X mappings: FAILED, 1 W+X pages found. Luis