Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp748531ybv; Fri, 7 Feb 2020 07:51:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzLvkdRiG4yXi1PpdQqdxpi0P/3pBJDgcDOngxOvG7LCjCoUXYYN/mxZ1F1eo6AxmDatRn+ X-Received: by 2002:a9d:7493:: with SMTP id t19mr15657otk.332.1581090705217; Fri, 07 Feb 2020 07:51:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581090705; cv=none; d=google.com; s=arc-20160816; b=ycAA5gvxZKtXcEMvkDyxkEtgtlpEHhSXIWOHz3Upyc5L+pZnztBxbJM5e55NpofRmS s4mv8UTJmFWUDTiZ2kf+0W61QLsLFyTFRCYJ05gT3kDKnvnbkT6hiZOuWeoneehThsLu bmaT/YmtYZKFR9g+PFIU6jmp/n/JbR4UyLupeyjx3DauXBVCr3W8YMjMPjLKJkwwOmdO hTzT+oJ4azqXmE4MwAD7E+jTX7b0TDL0O6sr4oVty/QKyMYZoFfWJWunnJM718jfgpif OTE2vpF4u9m64LNKI/nf9ZcXWkr//sYljsbvvubdGJkT2X6ZrFB2y1eVSI70Ez6aTUDz 6HWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=h3qfQ9LRi5N0qigJWfoGv8msgYMXUxdJ6Wg38GofYCI=; b=p3fDw1UcP/r18RwsocB3S5zdC8HMD6t87dKxTGQZMlBMTR7VJZ9FlFcaP6nj2fKdo/ cMIUbAPy7Oo1+1W58Z0W7DEoG04IPe79O8K2PhImXuroMFjGIhocnP8sPLFgLg7hNxHF sCAvE/odslXPlrcV4m+qQoqrIEawjGHbKJbZY1R8tXJPgL+i4GeM/44N5YyMbc1zcnFI EWyXymyTFJhchRV1pXDQ8BlHt7CJMqvXn/TSUknCo73ujkpaq1QhzLzxpeBnJ5RyUTnS TCs8EYr/WjrVvYv2DPC1c5bUJYhkL+B+Nh/5siQgDbtvsyr8W7MZRSsMYPMKcVFfByMQ RwaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YkjiS+ME; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si3916615oie.148.2020.02.07.07.51.32; Fri, 07 Feb 2020 07:51:45 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=YkjiS+ME; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727392AbgBGPta (ORCPT + 99 others); Fri, 7 Feb 2020 10:49:30 -0500 Received: from mail-pl1-f201.google.com ([209.85.214.201]:37470 "EHLO mail-pl1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726874AbgBGPt3 (ORCPT ); Fri, 7 Feb 2020 10:49:29 -0500 Received: by mail-pl1-f201.google.com with SMTP id t12so1494832plo.4 for ; Fri, 07 Feb 2020 07:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=h3qfQ9LRi5N0qigJWfoGv8msgYMXUxdJ6Wg38GofYCI=; b=YkjiS+MEPCnpLguXWANVXOvT1xbFH5YPK5MdfmeJSjIaA+ULWbqphdPx0y9EkX01ra OFai7qOEOYfahypi895lsPxS5Hm452ZHqgjnbFNiAyWabGFSH7u4tVc6DBRGtiXgG0uI q8RswqxiiK+Xt5Ggu7zVj5mqDZr1a/Sf53rz0kJ5DVxTbEKAaR3D/13IysrzUVYmqQjk RrCe08X1sTdiYxxJie2tmqfNabIZwMZVi8BxLNsLeMn5HnatiL/PU2rYHYDp6W2Kf9rJ kaJIGy0SAiNJ2eu6wnKX1yImCzkERnX/ks7TNmHzyo9cjaZsONpQLcqyRsSXGKM5LcRG BywQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=h3qfQ9LRi5N0qigJWfoGv8msgYMXUxdJ6Wg38GofYCI=; b=c/0veMDnaVctdq80bSjLyOUcHUEewlg2OYTDeNsip+7vRjN2eQyNuofO/EEKUet3LV +EZg1NLAhRRDAdt1aq8TiYsFUUVEuCtwOo5HuWGTO+NipTEdq/1ecJ/+DCn78MYldYbf hEYf32V11FWYv5ze9GxvqQAcEVLIihe61gR0jtx05Mu9wWNc48AIRNE0U+uZ5pOacIxi CSXr7AnNUbiQbpJ+BEtesWGb5pXXi8Mhn1GeS/Diop9P5AqSEG5G7dIr2ArIQ82tAmdi BLNZJpJR4gGiYymL0qN/JEW16/PGpPpm0W4vIs2IwyJn47+e53wx2qELYyHH7Qk7bF6/ J4YQ== X-Gm-Message-State: APjAAAWQwK2w8OeFrSPmOohhfoqk6SbzsJ5WLW1hLw7bZqnu/9GLQpSx zhYFkeQx94f1u9bO7nQJN5Yfeoc43U+9wg== X-Received: by 2002:a63:131e:: with SMTP id i30mr10159891pgl.43.1581090568932; Fri, 07 Feb 2020 07:49:28 -0800 (PST) Date: Fri, 7 Feb 2020 07:49:15 -0800 Message-Id: <20200207154915.83739-1-edumazet@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog Subject: [PATCH v2] x86/traps: do not hash pointers in handle_stack_overflow() From: Eric Dumazet To: Ingo Molnar Cc: linux-kernel , Eric Dumazet , Eric Dumazet , Andy Lutomirski , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mangling stack pointers in handle_stack_overflow() is moot, as registers (including RSP/RBP) are clear anyway. Also switch to pr_emerg() as suggested by Thomas. BUG: stack guard page was hit at 0000000063381e80 (stack is 000000008edc5696..0000000012256c50) kernel stack overflow (double-fault): 0000 [#1] PREEMPT SMP KASAN ... RSP: 0018:ffffc90002c1ffc0 EFLAGS: 00010802 RAX: 1ffff11004a0094c RBX: ffff888025004180 RCX: c9d82d1007bb146c RDX: dffffc0000000000 RSI: ffff888025004a40 RDI: ffff888025004180 RBP: ffffc90002c201c0 R08: dffffc0000000000 R09: fffffbfff1405915 R10: fffffbfff1405915 R11: 0000000000000000 R12: ffff888025004a60 R13: ffff888025004a10 R14: c9d82d1007bb146c R15: ffff888025004180 ... Signed-off-by: Eric Dumazet Cc: Andy Lutomirski Cc: Thomas Gleixner --- 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 6ef00eb6fbb925e86109f86845e2b3ccef4023ec..318df13e267638c4888f1c3f611aff34818b3bd2 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -296,7 +296,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", + pr_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.25.0.341.g760bfbb309-goog