From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2499CA9EBC for ; Wed, 23 Oct 2019 18:43:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 75B6A20663 for ; Wed, 23 Oct 2019 18:43:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="utNSMy9s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75B6A20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1131B6B0003; Wed, 23 Oct 2019 14:43:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C4086B0006; Wed, 23 Oct 2019 14:43:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF4606B0007; Wed, 23 Oct 2019 14:43:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id CDC3E6B0003 for ; Wed, 23 Oct 2019 14:43:40 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 33EB7181AEF39 for ; Wed, 23 Oct 2019 18:43:40 +0000 (UTC) X-FDA: 76075923000.04.toy48_1ff08bf41361c X-HE-Tag: toy48_1ff08bf41361c X-Filterd-Recvd-Size: 4268 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Oct 2019 18:43:39 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id c4so7077398lja.11 for ; Wed, 23 Oct 2019 11:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ik1E3MEvEZSziI+iKa0yGe//Q0fMeFPrafPgekteUjI=; b=utNSMy9sMZtCeVIT91rkTSMc0qGjklgzwWr1fu48dn+qeTXT0G7ASGN0BPwlueUcEk ScUe63yVwJOK++LUYtRJIpKCiEA3+YW9CC65IPRQ4h7dCYjlVQ/x2ZNwSN+jXXWx9087 tH42TIOqPq+yLxpxBN8zONMdo/nAb1CVNXHvvnHKuZPwTtTUrPzWA0vwIwgOKwwgzSXh O9d/TF6xD4Dc7oUESAaVxehfnOrhNcZOUzrzBVG4XfEraq2UIFBtoluFt8dTDn4cd0+q OpQfAXKVY8UkIZqPmvBJ3S/Tq8KcSuFXqcznCtfZTiw5HxxMlS3rUoA0sgkBGi7KwnwS KT3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ik1E3MEvEZSziI+iKa0yGe//Q0fMeFPrafPgekteUjI=; b=mI03YbrNYkCRaHQCRRR0qgu1veL2jHvMWTWWxXYBiOWpr+8i1rGh5HrPttBsYX4Lzh 9xxOCTCs+57vGBlLEyxGKaPffRMdlX+HLH0ILersYVYgTWWrhzB/6i0ric4JSLD2TAcd jz2Y4quFttFJXhczyFzRtAXAH++bdUevMCdCNy5VOjhPgMbRwCHS1qhqgA74bIQq5c5m 7jfQDDAy98rTEcuDu6A2rYdXx8fyQJFVixEFVMjDxGPX2+GITQxKx5Jtj9GpZSEYBySn 1fSx3iqGQ/N5V4qmuwJ3lSHD3WgAQ0VF7knFTSYblMYmxyXYKRsAJnXeese+hR6RfSlw GiEA== X-Gm-Message-State: APjAAAUKmyPpmLp9VnSsn6+EYoXjZIDHSy+OxEZ682uEDB4Gm6VZihSm /We82yoU15go3QY36YuXwEk= X-Google-Smtp-Source: APXvYqzz2G0VgawaCxiiPyHf9IAfT94XNVIjsDbWUffoNnW615HCW5ug3I/5Q+tUCpoTC3NfQPesoQ== X-Received: by 2002:a2e:b52b:: with SMTP id z11mr6498271ljm.29.1571856217645; Wed, 23 Oct 2019 11:43:37 -0700 (PDT) Received: from uranus.localdomain ([5.18.199.94]) by smtp.gmail.com with ESMTPSA id l24sm2542452lfc.53.2019.10.23.11.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 11:43:36 -0700 (PDT) Received: by uranus.localdomain (Postfix, from userid 1000) id 122F64610AC; Wed, 23 Oct 2019 21:43:36 +0300 (MSK) Date: Wed, 23 Oct 2019 21:43:36 +0300 From: Cyrill Gorcunov To: Matthew Wilcox Cc: Thomas Gleixner , 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 Message-ID: <20191023184336.GL12121@uranus.lan> References: <20191019114421.GK9698@uranus.lan> <20191022142325.GD12121@uranus.lan> <20191022145619.GE12121@uranus.lan> <20191023135943.GK12121@uranus.lan> <20191023183140.GC2963@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191023183140.GC2963@bombadil.infradead.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Oct 23, 2019 at 11:31:40AM -0700, 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. As to me this would be a hack and fragile :/ In turn the current explicit test Thomas made is a way more readable.