Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1981419ybg; Thu, 24 Oct 2019 03:12:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCAtKA9cJUm+jZ3frbyGkgrYmZu/WLVuzIcfLAhlgVoAwAsFLQAXx7zHSoH6pyiY5MgYWV X-Received: by 2002:aa7:d915:: with SMTP id a21mr42838012edr.46.1571911943972; Thu, 24 Oct 2019 03:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571911943; cv=none; d=google.com; s=arc-20160816; b=ThA2d7rAexXL+fo9D7MKywJLXWvnmvKSUlzyF358+StjdVBwW5XdHThLjcy6yG0279 /AKnQr2KauDrEgDn3ewPoRi0vJSVA0BH67Qu7RFdyywms1X3XJ7kU1rAsGyFyEEhFm2G DVDd3EXtk4+HJMSYwr/2ELaAxhixZNNJERu3ihMOjkZeHxtSF7iw0LhkJ18vEqfC26W/ g1zDkwBRW+Z7cPYzSkN8shd8YAq/feuE5szXDKxTRuNyUUhSwtxBZHdWOM8ZeAomOoAe 3KlQas8y0joFTv1Y82g99MmEPzkh8WLMN+xo4f82l62O/xL7F9hliu9vpO83qrAvLMca R9ZQ== 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=pNU5c7hgVY8y5/OAMZ0VFkQTSNYSI1XIvCmXBFnnH+g=; b=jsjwpfYs04sseATHkd4ch4WcqDIdHyYjyyoTPdwysjDhgJe6r+R0ZMdT0HxwTLMH1h pbb6qyBn/0236o3/LFG9JKH1GN95v4Hj56tZLxwuCVzzvo4fR0hkh0NArsKrEmMwkqCB K6lxPLHQO8xo0uf4EE6ayCV6hADdnB0pFIEvwGNhfMoae1RBLJOZJJUxAS9g7CgD1Fxl CCCU4NnzIv755ftf5z31L2tSa10OpqOqa33porCyNlVQb7jc8hxtJ7ILANNjpZeW3SIx YEWLzW58AoGVoAyCU0UxG88eSCY6Jkj6sQ/GeXCyOhCRbWMeSI4dt9gayUlf/szQoCia cERg== 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 n12si654646ejy.337.2019.10.24.03.11.59; Thu, 24 Oct 2019 03:12:23 -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 S2392390AbfJWV1f (ORCPT + 99 others); Wed, 23 Oct 2019 17:27:35 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:50918 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733169AbfJWV1f (ORCPT ); Wed, 23 Oct 2019 17:27:35 -0400 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iNOAG-00012f-6l; Wed, 23 Oct 2019 23:27:32 +0200 Date: Wed, 23 Oct 2019 23:27:30 +0200 (CEST) From: Thomas Gleixner To: Matthew Wilcox cc: Cyrill Gorcunov , LKML , Ingo Molnar , Peter Zijlstra , linux-mm@kvack.org, Catalin Marinas , x86@kernel.org, Josh Poimboeuf Subject: Re: [PATCH] x86/dumpstack/64: Don't evaluate exception stacks before setup In-Reply-To: <20191023183140.GC2963@bombadil.infradead.org> Message-ID: References: <20191019114421.GK9698@uranus.lan> <20191022142325.GD12121@uranus.lan> <20191022145619.GE12121@uranus.lan> <20191023135943.GK12121@uranus.lan> <20191023183140.GC2963@bombadil.infradead.org> 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 Wed, 23 Oct 2019, Matthew Wilcox wrote: > On Wed, Oct 23, 2019 at 08:05:49PM +0200, Thomas Gleixner wrote: > > Prevent this by checking the validity of the cea_exception_stack base > > address and bailing out if it is zero. > > Could also initialise cea_exception_stack to -1? That would lead to it > being caught by ... > > > end = begin + sizeof(struct cea_exception_stacks); > > /* Bail if @stack is outside the exception stack area. */ > > if (stk < begin || stk >= end) > > this existing check. Yes thought about that, but then decided to do it in a readable way :)