Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12394388rwd; Fri, 23 Jun 2023 05:41:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7uAT/w8Xw1dm2pGHjEYqujzXqlYR1RelZWFgyUBj9mREiSmxpDKPcM6NpWwiP38ECzJ8QY X-Received: by 2002:a05:6a20:7f84:b0:10f:f672:6e6b with SMTP id d4-20020a056a207f8400b0010ff6726e6bmr12456998pzj.5.1687524086339; Fri, 23 Jun 2023 05:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687524086; cv=none; d=google.com; s=arc-20160816; b=cn2eR4aUPtMARlFOgIVwjqvs62DIYKctWYSJWTKDdVA1jEDnJjXpT/+QqWVmnsz1WT FlCc9hEsBUDCA9L7JUvK4E+q3UJooHcJDo7QL04VmowyB1jDCPadRCYvTXcaHT1Gw+PM f0I7tLh2bx+Nd8zUT9gcAdp2LSkR4eCj1rhR1ZLxABt6HVt0ygJdS1koqRvV67arL8Tj I/7eZCtD9imQen40ApMVgzy+eMOyCFMbg5rGGj61ii5WDudGIT+uSN/mSCDbErfJUJQ8 Cqu942TiB39n5d8p6TIFQZL/vhtCqNCWWr2pgz1JWxiU3QeA8wtAPYmPhKkK3TOoo88U R8NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=akQ5LM2kZ15r5wYk0nrURYOsNMjO2oyEVPCccL8a6qc=; b=u2TUWHKiiiHpUcIEowcSG7s7kSAF6WdzYEQ3RLiNWVaf55NBmNQtaY6/Nz5t0oNkqg BUlG1yK8Sr2t9zbI4w0Q7ZW7ljFaBkw/Luiun1nuZHhS7f7W1LWWViM5La6WjVIszUFi GWmK2LZqdWZRMgtYz9+c3djjLfvVu7sq42XabmL/J0kF3jFuoa0YOgx/khuQzg07UhBg THgWe3bxbo1N5F35bVvSplk4ZC5+eKOpLt8v1QPZa6muz6F4qrpGq42o9d5oTtjGvRW/ zjZSeJJoN1z4n64MEbrKhxBUGF6qpuQ3Xl9RKSZ5umeun6OS7oASUeXDBN6vKYqf4DRe R5ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hDEa6UrV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k5-20020a056a00134500b0066a48cbde7asi6195643pfu.190.2023.06.23.05.41.10; Fri, 23 Jun 2023 05:41:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hDEa6UrV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230180AbjFWMRg (ORCPT + 99 others); Fri, 23 Jun 2023 08:17:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjFWMRf (ORCPT ); Fri, 23 Jun 2023 08:17:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E70931BE4; Fri, 23 Jun 2023 05:17:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 767EF61A39; Fri, 23 Jun 2023 12:17:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BAB1C433C0; Fri, 23 Jun 2023 12:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687522653; bh=+7+qY2pMjJYzB9xElhuCVbaU19w3qgAqAoglFmxdPOA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hDEa6UrV+PRl4gVbTIs/hZdUDvZIr/H1xBTlK856m60e8pDuMAFgtOA4E3Z+w3z2D L5qHQY1QuSFJyDb835gTkZn9vNoLgcUDeS567rvnfVqqQmxnm/U87TD/gujZr5Sawj W10+cvRXWfs9IHCtOP66qOmtqejcXkPuYGHArVW+bdHP9aRvqAkXM0pDMmVl6Df3If +SXba9qDA+VmFbFbl1P5my5mcIug+uUU/y6LYNbRZ+HRwXY55CCmpQk5FAd/mQA6V6 RfNnSnFbUxxfGDa4ALqAaV256v8TnBRhKXif0TKoHSuCMYPNVzOMh8o7h99c36o31G Jt4nQ1NE2izFA== Date: Fri, 23 Jun 2023 13:17:29 +0100 From: Mark Brown To: Mike Rapoport Cc: "Edgecombe, Rick P" , "willy@infradead.org" , "akpm@linux-foundation.org" , "Xu, Pengfei" , "tglx@linutronix.de" , "linux-arch@vger.kernel.org" , "kcc@google.com" , "Lutomirski, Andy" , "nadav.amit@gmail.com" , "kirill.shutemov@linux.intel.com" , "david@redhat.com" , "Schimpe, Christina" , "Torvalds, Linus" , "peterz@infradead.org" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "jannh@google.com" , "dethoma@microsoft.com" , "mike.kravetz@oracle.com" , "pavel@ucw.cz" , "bp@alien8.de" , "rdunlap@infradead.org" , "linux-api@vger.kernel.org" , "john.allen@amd.com" , "arnd@arndb.de" , "jamorris@linux.microsoft.com" , "bsingharora@gmail.com" , "x86@kernel.org" , "oleg@redhat.com" , "fweimer@redhat.com" , "keescook@chromium.org" , "gorcunov@gmail.com" , "Yu, Yu-cheng" , "andrew.cooper3@citrix.com" , "hpa@zytor.com" , "mingo@redhat.com" , "szabolcs.nagy@arm.com" , "hjl.tools@gmail.com" , "debug@rivosinc.com" , "linux-mm@kvack.org" , "Syromiatnikov, Eugene" , "Yang, Weijiang" , "linux-doc@vger.kernel.org" , "dave.hansen@linux.intel.com" , "Eranian, Stephane" Subject: Re: [PATCH v9 16/42] mm: Add guard pages around a shadow stack. Message-ID: References: <20230613001108.3040476-1-rick.p.edgecombe@intel.com> <20230613001108.3040476-17-rick.p.edgecombe@intel.com> <20230623074000.GG52412@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6xcRS/HNRY4aTkhh" Content-Disposition: inline In-Reply-To: <20230623074000.GG52412@kernel.org> X-Cookie: Slow day. Practice crawling. X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --6xcRS/HNRY4aTkhh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 23, 2023 at 10:40:00AM +0300, Mike Rapoport wrote: > On Thu, Jun 22, 2023 at 06:27:40PM +0000, Edgecombe, Rick P wrote: > > Yes, I couldn't find another place for it. This was the reasoning: > > https://lore.kernel.org/lkml/07deaffc10b1b68721bbbce370e145d8fec2a494.c= amel@intel.com/ > > Did you have any particular place in mind? > Since it's near CONFIG_X86_USER_SHADOW_STACK the comment in mm.h could be= =20 > /* > * VMA is used for shadow stack and implies guard pages. > * See arch/x86/kernel/shstk.c for details > */ > and the long reasoning comment can be moved near alloc_shstk in > arch/x86/kernel/shstk.h This isn't an x86 specific concept, arm64 has a very similar extension called Guarded Control Stack (which I should be publishing changes for in the not too distant future) and riscv also has something. For arm64 I'm using the generic mm changes wholesale, we have a similar need for guard pages around the GCS and while the mechanics of accessing are different the requirement ends up being the same. Perhaps we could just rewrite the comment to say that guard pages prevent over/underflow of the stack by userspace and that a single page is sufficient for all current architectures, with the details of the working for x86 put in some x86 specific place? --6xcRS/HNRY4aTkhh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSVjVUACgkQJNaLcl1U h9BV1ggAgSOn8u1kb6HeUhHTldAbqy+XWNhMN9/fILZ0CP9sw4vUhTHZa0SfygRu BJ/QiMVJ00xJd26NTnXoK5gLBGmz3qDSpX6JxHhytRM2zLh1KS8tZkEYS9kehwrl Iiqgg53zg31Ir/5LJ7PsBQ6SAd4rfE5aZKG8NAR653jLr2SRMEd3BUx8ZJj6/Re/ MpKQfBwU9ltLLEOS6xI0+f0YibTkxPcKp9+zMXWi5+xDCCxdhPxpcFok7ZcBpaOj 2ay7LhRYRsKziXpV3Y4RorbiXt7zgehqryMShTvoTswU2LbkxdP95Ob3nHVTRW+s P+ACzWi6uNUFXQ1Ko44YzoQboSpPPA== =ssEI -----END PGP SIGNATURE----- --6xcRS/HNRY4aTkhh--