Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6357056imm; Wed, 27 Jun 2018 06:32:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL0QX2EECQYJ3B8/KdZYshzi9kr3dds9fON5UYTvGIxd9lRLa5TdUZfsF3vGdt8vKHpkpEh X-Received: by 2002:a17:902:8ecb:: with SMTP id x11-v6mr6313578plo.308.1530106336391; Wed, 27 Jun 2018 06:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530106336; cv=none; d=google.com; s=arc-20160816; b=osaQGQopHOTWYDqgHNndA98d7sEe5tEDOCUNccne2eksXEXwDALqHZhOXChe4jp3Rg kaztbLCqgXfU45c/+eng4nEjWo4LDC70aFigMh6+8cLsBKZk4n1ob7eL7/odz6wcN1+q eX758Y2/IjYJVqFCFBAME6Cy/eAmijXwttZqoegsPH5oUc+fmf1Yw/Czn+AfgeRv2G4l ixM75/71e2pWOxwz6PoC8o3rZy1+BbGU60Smksrgu+VvLofqDov/Wcw9QxCyY+prMo4e LGm3RlT1ooZzeqz4xfQ8CCPOkbOVS9JbHvNIurGMsGzAfhkugnDt8nB7RHASuH/YUUJi LOeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=7owoaH7GhqFc/Kbx0KUorqJY96fdXwrRiKMBFrBdCms=; b=pIYxzUEV6F/cp1E0uAQcRE5H9jHuyOIesvn9rbd7zYRn/XroXTiMc3WkJMieXjlHgq YLar0AuI607yILVPWchNGgTVa3egErhM5M+tba9Rlip7hEEK4Nv3+PUpTbp69KzImqYs Qco4OadI9o7Dlu4RBY6ZKOFfVczY3BJHWrutffJ6P6B6s8p6rdRQlOlJdonkcTX685FH Q9wlqduHCsd/eJS6P8RnbLzqGb9JRtjl0LJiALYQl1BtKpU5nIXlj5eUr/EnVwfSlguF +3x3/hbzdCWg8Lvw22alD0LmNFTBAqbpcCsCkgH4PsG9SUZmTeVE6P7TufslpTuS8HI5 Aehw== 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 u1-v6si3493810pga.170.2018.06.27.06.31.58; Wed, 27 Jun 2018 06:32:16 -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 S965360AbeF0NTX (ORCPT + 99 others); Wed, 27 Jun 2018 09:19:23 -0400 Received: from terminus.zytor.com ([198.137.202.136]:41027 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933051AbeF0NTV (ORCPT ); Wed, 27 Jun 2018 09:19:21 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5RDIpVx2088917 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 27 Jun 2018 06:18:51 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5RDIpaX2088914; Wed, 27 Jun 2018 06:18:51 -0700 Date: Wed, 27 Jun 2018 06:18:51 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Dmitry Vyukov Message-ID: Cc: torvalds@linux-foundation.org, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, joe@perches.com, dvyukov@google.com, peterz@infradead.org Reply-To: peterz@infradead.org, dvyukov@google.com, joe@perches.com, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, mingo@kernel.org In-Reply-To: <20180627090715.28076-1-dvyukov@gmail.com> References: <20180627090715.28076-1-dvyukov@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/mm: Clean up the printk()s in show_fault_oops() Git-Commit-ID: d79d0d8ad0cb3d782b41631dfeac8eb05e414bcd X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d79d0d8ad0cb3d782b41631dfeac8eb05e414bcd Gitweb: https://git.kernel.org/tip/d79d0d8ad0cb3d782b41631dfeac8eb05e414bcd Author: Dmitry Vyukov AuthorDate: Wed, 27 Jun 2018 11:07:15 +0200 Committer: Ingo Molnar CommitDate: Wed, 27 Jun 2018 14:08:11 +0200 x86/mm: Clean up the printk()s in show_fault_oops() - Remove 'nx_warning' and 'smep_warning', which are just pointless obfuscation. - Also convert to pr_crit(). Suggested-by: Joe Perches Signed-off-by: Dmitry Vyukov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180627090715.28076-1-dvyukov@gmail.com Signed-off-by: Ingo Molnar --- arch/x86/mm/fault.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index ee85766e6329..2aafa6ab6103 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -641,11 +641,6 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) return 0; } -static const char nx_warning[] = KERN_CRIT -"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n"; -static const char smep_warning[] = KERN_CRIT -"unable to execute userspace code (SMEP?) (uid: %d)\n"; - static void show_fault_oops(struct pt_regs *regs, unsigned long error_code, unsigned long address) @@ -664,11 +659,13 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, pte = lookup_address_in_pgd(pgd, address, &level); if (pte && pte_present(*pte) && !pte_exec(*pte)) - printk(nx_warning, from_kuid(&init_user_ns, current_uid())); + pr_crit("kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n", + from_kuid(&init_user_ns, current_uid())); if (pte && pte_present(*pte) && pte_exec(*pte) && (pgd_flags(*pgd) & _PAGE_USER) && (__read_cr4() & X86_CR4_SMEP)) - printk(smep_warning, from_kuid(&init_user_ns, current_uid())); + pr_crit("unable to execute userspace code (SMEP?) (uid: %d)\n", + from_kuid(&init_user_ns, current_uid())); } pr_alert("BUG: unable to handle kernel %s at %px\n",