Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9137178ybi; Wed, 10 Jul 2019 05:20:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEqOOjPl4EUjHJVa0vRFAoVlfNJN8KGH68Ho8Vcf4WOW3ztFIKR6NUGRNjQCerP+sVd0kA X-Received: by 2002:a17:90a:376f:: with SMTP id u102mr6735050pjb.5.1562761225590; Wed, 10 Jul 2019 05:20:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562761225; cv=none; d=google.com; s=arc-20160816; b=JQrRzFJ9xD9xYdWah+A49ir5pyEk8aoiWKky7b1AlOZiClqnFiw9Fp3QdUZne3LtJi FOv90Z7jz3xn14d1fcylOFOTK+kw+LtY4H35QY2c7VY7XYPV4yeLTBVV77ax4rbTS3eH C9Jot8GV1Dnnnht9QsVmoMi4BDqeHBHXHgYdOTl8bjiLDarS12ycpFFTiOjcDvqhfSwB lEa4NE3zPoV1SOmhHP/eQR9RdjzPFPH+xt9la8Ng4kpUTSlXRKeai4W4AydPiAJyFVv2 lrlTdCll/93Ng8tLQvc6J2k4MPojVcZW9TOaRALy+Y2KQLPtWbHjSalEHo23YJN1hUj6 c+4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=PzudLaGDdW6l9BwTPWVCO2Lec6SLz68dQTH9TKelBqg=; b=MzmDh3t5/J3ACujZJMpTIqSJXurxHL7T6aaOX5TWJRKunvLuQenn2TJtSeSYHEu+HQ RWJJeErZ0aLZO3SgBFe6LMa4tN4pLqTsf2QuaYa+YmhCpYp++pogtimU+rCdBVIfNxdO rATlwkiX2+Z36DIGfaiZIwwXzJ6s1T1yIUPa5wshfEElUWNymtrNMreJfSQ3xadI6+AX dyYrFyI+1+fFyL3CsHTW7EdbLplzAJCDfh9D36fnfH1VKO2Tqjyc6dDjIfImJBUAboQL 4v7aoynYpzciBmlBwogITDmRC7XCYWd6pdmY+nnUG7XL/hsjDjcMdlA/TMyd5SjTA6Bo UA+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18si1963428plm.292.2019.07.10.05.20.09; Wed, 10 Jul 2019 05:20:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727068AbfGJMTd (ORCPT + 99 others); Wed, 10 Jul 2019 08:19:33 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47545 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbfGJMTd (ORCPT ); Wed, 10 Jul 2019 08:19:33 -0400 Received: from pd9ef1cb8.dip0.t-ipconnect.de ([217.239.28.184] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hlBZI-0001sp-BD; Wed, 10 Jul 2019 14:19:28 +0200 Date: Wed, 10 Jul 2019 14:19:27 +0200 (CEST) From: Thomas Gleixner To: Xi Ruoyao cc: Kees Cook , Linus Torvalds , Ingo Molnar , Linux List Kernel Mailing , Borislav Petkov , Len Brown , Peter Zijlstra , Andrew Morton , "Rafael J. Wysocki" , Tony Luck , Jiri Kosina , Bob Moore , Erik Schmauss , Josh Poimboeuf Subject: Re: [GIT PULL] x86/topology changes for v5.3 In-Reply-To: Message-ID: References: <20190708162756.GA69120@gmail.com> <201907091727.91CC6C72D8@keescook> <1ad2de95e694a29909801d022fe2d556df9a4bd5.camel@mengyan1223.wang> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 10 Jul 2019, Xi Ruoyao wrote: > On 2019-07-10 19:27 +0800, Xi Ruoyao wrote: > > On 2019-07-09 17:31 -0700, Kees Cook wrote: > > > On Wed, Jul 10, 2019 at 01:17:11AM +0200, Thomas Gleixner wrote: > > > > On Wed, 10 Jul 2019, Thomas Gleixner wrote: > > > > > That still does not explain the cr4/0 issue you have. Can you send me > > > > > your > > > > > .config please? > > > > > > > > Does your machine have UMIP support? None of my test boxes has. So that'd > > > > be the difference of bits enforced in CR4. Should not matter because it's > > > > User mode instruction prevention, but who knows. > > > > > > Ew. Yeah, I don't have i9 nor i7 for testing this. I did try everything > > > else I had (and hibernation). Is only Linus able to reproduce this so far? > > > > I can, too. > > > > > To rule out (in?) UMIP, this would remove UMIP from the pinning: > > > > > > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c > > > index 309b6b9b49d4..f3beedb6da8a 100644 > > > --- a/arch/x86/kernel/cpu/common.c > > > +++ b/arch/x86/kernel/cpu/common.c > > > @@ -380,7 +380,7 @@ static void __init setup_cr_pinning(void) > > > { > > > unsigned long mask; > > > > > > - mask = (X86_CR4_SMEP | X86_CR4_SMAP | X86_CR4_UMIP); > > > + mask = (X86_CR4_SMEP | X86_CR4_SMAP); > > > cr4_pinned_bits = this_cpu_read(cpu_tlbstate.cr4) & mask; > > > static_key_enable(&cr_pinning.key); > > > } > > > > I'll try it. > > That doesn't work, sadly. > > My laptop is an old i3-3217u. > > My .config and syslog snip are attached. From the log: BUG: unable to handle page fault for address: ffffffff9edc1598 #PF: supervisor write access in kernel mode #PF: error_code(0x0003) - permissions violation PGD 1a20c067 P4D 1a20c067 PUD 1a20d063 PMD 8000000019e000e1 Oops: 0003 [#1] SMP PTI 2 PID: 151 Comm: systemd-udevd Not tainted 5.2.0+ #54 Hardware name: LENOVO 20175/INVALID, BIOS 66CN54WW 01/21/2013 RIP: 0010:static_key_set_mod.isra.0+0x10/0x30 Code: 48 8b 37 83 e6 03 48 09 c6 48 89 37 c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f0 a8 03 75 0d 48 8b 37 83 e6 03 48 09 c6 <48> 89 37 c3 0f 0b 48 8b 37 83 e6 03 48 09 c6 48 89 37 c3 66 66 2e RSP: 0000:ffffa606c032bc98 EFLAGS: 00010286 RAX: ffff9981ddce30a0 RBX: ffffffff9edc1590 RCX: 0000000000000000 RDX: 0000000000000020 RSI: ffff9981ddce30a0 RDI: ffffffff9edc1598 RBP: ffffffffc06f4000 R08: ffff9981e6003980 R09: ffff9981ddce30a0 R10: 0000000000000000 R11: 0000000000028b56 R12: ffffffffc06f8880 R13: ffff9981ddce3080 R14: ffffffffc06f4008 R15: ffffffffc06f6dc0 FS: 00007f992dd9a680(0000) GS:ffff9981e7080000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffff9edc1598 CR3: 00000002233aa001 CR4: 00000000001606e0 Call Trace: jump_label_module_notify+0x1e7/0x2b0 notifier_call_chain+0x44/0x70 blocking_notifier_call_chain+0x43/0x60 load_module+0x1bcb/0x2490 ? vfs_read+0x11f/0x150 ? __do_sys_finit_module+0xbf/0xe0 __do_sys_finit_module+0xbf/0xe0 do_syscall_64+0x43/0x110 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Josh, didn't you mention that yesterday or so? RIP: 0033:0x7f992e2eeaf9 Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 67 73 0d 00 f7 d8 64 89 01 48 RSP: 002b:00007ffca220d288 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 00000000009b8da0 RCX: 00007f992e2eeaf9 RDX: 0000000000000000 RSI: 00007f992e464885 RDI: 0000000000000010 RBP: 0000000000020000 R08: 0000000000000000 R09: 00000000009c45c0 R10: 0000000000000010 R11: 0000000000000246 R12: 00007f992e464885 R13: 0000000000000000 R14: 00000000009acc50 R15: 00000000009b8da0 Modules linked in: kvm_intel(+) kvm irqbypass hid_sensor_hub crc32_pclmul mfd_core i2c_i801 snd_hda_intel i915(+) intel_gtt snd_hda_codec i2c_algo_bit snd_hwdep snd_hda_core drm_kms_helper snd_pcm syscopyarea sysfillrect sysimgblt fb_sys_fops drm hid_multitouch ideapad_laptop sparse_keymap hid_generic wmi efivarfs CR2: ffffffff9edc1598 [ end trace dbeb7e66daa9bdca ]--- RIP: 0010:static_key_set_mod.isra.0+0x10/0x30 Code: 48 8b 37 83 e6 03 48 09 c6 48 89 37 c3 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f0 a8 03 75 0d 48 8b 37 83 e6 03 48 09 c6 <48> 89 37 c3 0f 0b 48 8b 37 83 e6 03 48 09 c6 48 89 37 c3 66 66 2e RSP: 0000:ffffa606c032bc98 EFLAGS: 00010286 RAX: ffff9981ddce30a0 RBX: ffffffff9edc1590 RCX: 0000000000000000 RDX: 0000000000000020 RSI: ffff9981ddce30a0 RDI: ffffffff9edc1598 RBP: ffffffffc06f4000 R08: ffff9981e6003980 R09: ffff9981ddce30a0 R10: 0000000000000000 R11: 0000000000028b56 R12: ffffffffc06f8880 R13: ffff9981ddce3080 R14: ffffffffc06f4008 R15: ffffffffc06f6dc0 FS: 00007f992dd9a680(0000) GS:ffff9981e7080000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffff9edc1598 CR3: 00000002233aa001 CR4: 00000000001606e0