Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp917327yba; Sun, 31 Mar 2019 17:04:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGogH3mgTR2aUu3qfFYkcQ4Y+xPTR+HKrEUvnz3GO/6hhi5qrW83ntrIBp0A/HqK+yHY/m X-Received: by 2002:a62:1c07:: with SMTP id c7mr21494166pfc.159.1554077062516; Sun, 31 Mar 2019 17:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554077062; cv=none; d=google.com; s=arc-20160816; b=FBDVJM4aUQWsmmlJnIuxHCPGrysgnVk0EubJBWT7ruFtBnyLZ/4CzDuo2EbDB7Ljr0 ZfD7GjD0KXI3HLjVcsUDeu8TrIRH2+DQ5OarMr4UVwnSDhOAn1IgZStJOA0uSZNYHtVe 5jBRXQOqeTfvAbRZVj9Q3QOmNGgQBIDwMc66we2MEjU6qpdeergRnwE4nLZsiw31jEhO SfN9FRwNM4+ZR5D2tpEg15QhAH1NDAX8N4TGTR1PrKruRAsKRzhbwbuNAfAFtWqduYn8 NPqUmc9zt/1fi6TXu6MM5bIS0TsTtREPKZVw26veX/xsnJcDKce2zlG3CuF9xnwRzk/A IHIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=kWrdRGJn5dVC50iLYuhO2qdpO+kh39KXcfSk2TUVctg=; b=Mpx81FKDhU5QonTI22zM+sLDUAZX37cnBLbQ4ROrbMlPHRLHvDdhcp52hF5rXbndeB a0Srg0CCEPp0c58YBC43xqBn783x5EHitFVfPAILTVRdrw3rIBF3NO4ONNLIr6bmCgJb 5w4WRTdKNDKjsgntTb01ih3InaZ3cSui7JSjmtPnCNXdWKyprW205eP+OtcxG8AjoaW8 X6QEAfnInXp/beKRols3ah3phc3z7YvHr7mR3dVmPEFcGv1B3479IQpCd+PFbHfSYDEp LM4oD0Eov+xrISQGsOJ/+oCp6SIN25Uk5s/ntiqYOFKk6QW0XBdb5CISkiC8JkgzNlPv iaYA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f32si7924073plf.24.2019.03.31.17.04.07; Sun, 31 Mar 2019 17:04:22 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731527AbfDAADc (ORCPT + 99 others); Sun, 31 Mar 2019 20:03:32 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:39484 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731335AbfDAADc (ORCPT ); Sun, 31 Mar 2019 20:03:32 -0400 Received: by mail-wm1-f68.google.com with SMTP id n25so9182845wmk.4 for ; Sun, 31 Mar 2019 17:03:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kWrdRGJn5dVC50iLYuhO2qdpO+kh39KXcfSk2TUVctg=; b=SjyCDxgtKRNycW8mXX21ytBrpYgmWsRYtaco+0VUahe8ndoSzodNar//d37+NbXPyj 5FyNIWQtiZ3nPffwACNY5Ox+JWN+7X3jIYg78RHMp4Nn2x08uVn1D9e8gB1dja0X5Ahb trSXgguSbnl5OndB6Q+J7F0wqFAdxGKUSuMUERSruuUK5sSVlQZl1Bc63zsJulDLvBdt jesnI5v6Pb85FjZf6XiDBVy/tkz7LPGCfoxcMm8tREisU1hrZBpEXW8edG0cnJSqU/b7 bx7cvZtY05CnAJPqnAMrfZCIgJAwN6t0v0RzpR+PnyoTD8rNPxUkaHxPC9e5jx0CejtR 4Mtw== X-Gm-Message-State: APjAAAVUvpZN3A8t08xpMJ0nmkEg+yvizfJXSIv8vWMQYTOqjglU58AZ 1uNeVTmSQ5pL+8rMvhikOW/oSDgokyo= X-Received: by 2002:a1c:a00a:: with SMTP id j10mr10543430wme.15.1554077010608; Sun, 31 Mar 2019 17:03:30 -0700 (PDT) Received: from raver.teknoraver.net (net-93-70-69-135.cust.vodafonedsl.it. [93.70.69.135]) by smtp.gmail.com with ESMTPSA id w2sm7066694wrm.74.2019.03.31.17.03.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 Mar 2019 17:03:29 -0700 (PDT) From: Matteo Croce To: x86@kernel.org Cc: LKML , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH] x86/traps: print faulty addresses on stack overflow Date: Mon, 1 Apr 2019 02:03:27 +0200 Message-Id: <20190401000327.26742-1-mcroce@redhat.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), when a stack overflow happens "____ptrval____" is printed instead of the real addresses: BUG: stack guard page was hit at (____ptrval____) (stack is (____ptrval____)..(____ptrval____)) Even if leaking kernel layout information is usually a bad thing, probably the system needs to be rebooted anyway past this point, so force the address print as the obfuscation makes the error message useless. Signed-off-by: Matteo Croce --- arch/x86/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index d26f9e9c3d83..0d3695334dfd 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -301,7 +301,7 @@ __visible void __noreturn handle_stack_overflow(const char *message, struct pt_regs *regs, unsigned long fault_address) { - printk(KERN_EMERG "BUG: stack guard page was hit at %p (stack is %p..%p)\n", + printk(KERN_EMERG "BUG: stack guard page was hit at %px (stack is %px..%px)\n", (void *)fault_address, current->stack, (char *)current->stack + THREAD_SIZE - 1); die(message, regs, 0); -- 2.20.1