Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2333183yba; Sun, 7 Apr 2019 15:46:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqziAGf/RQ8rBYec0ZYxUQyd6wx2/nWCJeJxqKqlK3veFS7KvT7p/3AzgA1THp7wz+clFyRe X-Received: by 2002:a65:5682:: with SMTP id v2mr25452955pgs.100.1554677204689; Sun, 07 Apr 2019 15:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554677204; cv=none; d=google.com; s=arc-20160816; b=Wz/RCAPN2hY+RDnqGMC5kSmtAKZXnuAPNst7TQ5u1noMrbv01VkKo8m46hN6kCzt5a aziG+iAuMuCkUXlsn4DFIo/BSEcQl0dNMyW2JWILf/e0FY/+TAqKzo/dbpUdVkKiWg8L hka9IMNmDU9erZmQ5ddlJBbBuG/th6q5At+IMdTUN8oXg7RqUNX3L6AG6DZ/gpeeiRZY JzHwcgj0TKWZPmKn/rzovvS7PlmxafNiMnhVoQA/SD6eJ212wF84qXEuOX8CAdZQCEab 6+vclqPHsFIch1nXr1m3x9WNsVhGn/gnpFkdFiFtLi10DpjSe6/9uCf5+EhG2z7Ddrhy BXNQ== 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=ZP4lvArzHiS5HXsPzBmWxeaKnkSq1ZlhTtOk9j9cLM4=; b=BPcAuJx/28h5PnnlnD9pr68XI8dN/Yy7AwyWbJGod5P40P7mpbwuv/2yxuKduRWqen jDoeBIgcIWN6nN3eyHVBIlE9w8Sv8LeOjq10ZpCKfzj8Cn55xgQ5N5uiaVnQE4kiRTvW zQeqzwXgEo4zOVEea0J+vl4Yxq+YXVioteKs3PQmt9Xb0afX9/KDgEeD4wAPOYpWq92x wvidzclmJqKpUERCBAJH42P+JK6NpcHOYaBIHl9H28J91h2DmIjzIJpKIblU5OWfqtC+ okDS/maBaUv8VCl/STmYYCpBxhU9ycdOl70vugAt1mRTc//XuY15qWtZM/Tk9UlKCfPI KLWA== 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 m17si25939472pff.130.2019.04.07.15.46.28; Sun, 07 Apr 2019 15:46:44 -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 S1726504AbfDGWoa (ORCPT + 99 others); Sun, 7 Apr 2019 18:44:30 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:51040 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbfDGWoa (ORCPT ); Sun, 7 Apr 2019 18:44:30 -0400 Received: from p5492ee6e.dip0.t-ipconnect.de ([84.146.238.110] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hDGWW-0004bB-LY; Mon, 08 Apr 2019 00:44:24 +0200 Date: Mon, 8 Apr 2019 00:44:24 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski cc: LKML , X86 ML , Josh Poimboeuf , Sean Christopherson Subject: Re: [patch V2 28/29] x86/irq/64: Remap the IRQ stack with guard pages In-Reply-To: Message-ID: References: <20190405150658.237064784@linutronix.de> <20190405150930.967389183@linutronix.de> 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 Sat, 6 Apr 2019, Andy Lutomirski wrote: > On Fri, Apr 5, 2019 at 8:11 AM Thomas Gleixner wrote: > > > > From: Andy Lutomirski > > > > 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. > > The 0day bot noticed that this dies with DEBUG_PAGEALLOC on. This is > because the store_stackinfo() function is utter garbage and this patch > correctly detects just how broken it is. The attached patch "fixes" > it. (It also contains a reliability improvement that should probably > get folded in, but is otherwise unrelated.) > > A real fix would remove the generic kstack_end() function entirely > along with __HAVE_ARCH_KSTACK_END and would optionally replace > store_stackinfo() with something useful. Josh, do we have a generic > API to do a little stack walk like this? Otherwise, I don't think it > would be the end of the world to just remove the offending code. Actually we have: save_stack_trace()