Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1228841yba; Sat, 6 Apr 2019 06:59:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0B1/WRGgEimhjMrP/MM+yWpFJnjCXcN38AXCdvALhG6ssdM3dhSwbTwxDt24tnF2pqyLG X-Received: by 2002:a65:5549:: with SMTP id t9mr8159867pgr.388.1554559150247; Sat, 06 Apr 2019 06:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554559150; cv=none; d=google.com; s=arc-20160816; b=D6hFEvanrtdOgYq/xansdlS++I+I1knjYu9aXva6sU+mc9kQ/IKk1KReQJj7supBOB rB+6qlrztnBoNtfCgT7AoNERSHIa4Ob+V1sCFEsc/bGJsVLSJZDspGNa9VJsXDFep8BM XORCvTu77ZKZRt/kiOAuRiXSmchUzSEFkFawmDgcH3HX26hIuWN0p4AIjydV8E13ysPq qN1Q2sPXz7i6fwdjk6THjOnm1I53qBEj1yOf4eV3YNZ0TI+FsLdp/Za4I/QjxH5yOIKS Nd1Zf0mHE0dfstxdmfCWqyodip0z6O+ZS4hRwh4Pvh453hQXcMNcjrijx8pwvR/DR62m +3Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:cc:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZvQESchuDwg8h6En8G3R4KeLV0GJSLmXlEqCwd+TC6U=; b=t6LTWh3KR0LHIeCrYm4PNAt24g1MlfUR4U3BRuOvHvF9482Wpdda51GmUE8chnBc7U rvgI1NXy7R8Jf6mXiIz+lVTZHR6vOFNUqqgxm2fLHHS/ToUA+hmHIxm8gMzfIzZYJFQY KoOBdmub4/GxOv5s3WN0kmDFGxOJfdDALiYeGFE+g0xDLsCwzUV8z6sMqyAOvAUt27z8 ggSRHrkJlH+kwSgjMxwxQb6PHr8pPSLSvYGmDRYhBYVkIww2cFw4Kl5+9Kp1K60BQZYJ VDG+sMoUTxT8kuZr5dm0/yuHJCXTOvxoU+b57GkCkEspy4qGaOADEdJ5c7vlyHOy8IEc L55A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="uJ/r2afx"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20si5991224pfi.96.2019.04.06.06.58.19; Sat, 06 Apr 2019 06:59:10 -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; dkim=pass header.i=@kernel.org header.s=default header.b="uJ/r2afx"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726559AbfDFNy5 (ORCPT + 99 others); Sat, 6 Apr 2019 09:54:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:45060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726493AbfDFNy4 (ORCPT ); Sat, 6 Apr 2019 09:54:56 -0400 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E92702146F for ; Sat, 6 Apr 2019 13:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554558896; bh=jSFrrAEs1h8h/8E9ud8jE/CZdvDayVE1sUrDDxcZk/0=; h=References:In-Reply-To:From:Date:Subject:Cc:From; b=uJ/r2afxYA93aOnSJScm/XZHBAU+yAB8KFaldiwhUp9U3gGwtoobyHKl/oHpkvOK5 F3B8ylG9R8mDA9H9NLbVF7Yrel0fW7SwLdZhVsnNYwt3PkxW0diGz5JMgV+Fqb9gcg rHSc/ENUhrt17qVtCRxn8k0eNHdpkQcf25IVq6+c= Received: by mail-wr1-f45.google.com with SMTP id s15so11091627wra.12 for ; Sat, 06 Apr 2019 06:54:55 -0700 (PDT) X-Gm-Message-State: APjAAAWW9OhLFB1Ghmw8JIqPxP50xPXiE8j+9K2+dXHBVMR+SdfTLOwh FxpxzSfQe+XsfD6xtnUJqGq/GHyeDH4FO9RbGnftwQ== X-Received: by 2002:adf:eb84:: with SMTP id t4mt4592456wrn.43.1554558894492; Sat, 06 Apr 2019 06:54:54 -0700 (PDT) MIME-Version: 1.0 References: <5ca84952.hpEqUp6kap0tafzR%lkp@intel.com> In-Reply-To: <5ca84952.hpEqUp6kap0tafzR%lkp@intel.com> From: Andy Lutomirski Date: Sat, 6 Apr 2019 06:54:43 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: 8b275b3754 ("x86/irq/64: Remap the IRQ stack with guard pages"): BUG: unable to handle kernel paging request at ffffb659000a1000 Cc: Andy Lutomirski , LKML , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 5, 2019 at 11:38 PM kernel test robot wrote: > > Greetings, > > 0day kernel testing robot got the below dmesg and the first bad commit is > > https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/stackguards > > commit 8b275b3754465d502d393f8ae8dd355b7067e73f > Author: Andy Lutomirski > AuthorDate: Fri Jul 13 19:01:23 2018 -0700 > Commit: Thomas Gleixner > CommitDate: Fri Apr 5 17:04:10 2019 +0200 > > x86/irq/64: Remap the IRQ stack with guard pages > > The IRQ stack lives in percpu space, so an IRQ handler that overflows it > will overwrite other data structures. > > Use vmap() to remap the IRQ stack so that it will have the usual guard > pages that vmap/vmalloc allocations have. With this the kernel will panic > immediately on an IRQ stack overflow. > > [ tglx: Move the map code to a proper place and invoke it only when a CPU > is about to be brought online. No point in installing the map at > early boot for all possible CPUs. Fail the CPU bringup if the vmap > fails as done for all other preparatory stages in cpu hotplug. ] > > Signed-off-by: Andy Lutomirski > Signed-off-by: Thomas Gleixner I haven't spotted the actual bug yet, but the faulting instruction is: 2a: 65 8b 35 09 ca 75 63 mov %gs:*0x6375ca09(%rip),%esi # 0x6375ca3a <-- trapping instruction This seems to be faulting just above the top of the stack (the thing in RSP), so I suspect that there is some path that is shoving the remapped value into GSBASE, which is wrong. Also, FWIW, there was some reason that I initialized all the virtual mappings for all possible CPUs early. I don't remember what it was, and it may not have been a good reason, but I put at least some nonzero amount of thought into it :) --Andy