Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp660713rwi; Mon, 10 Oct 2022 05:46:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5a8zLZvKg10w2ol3mqCtxS/YHQZFpNqwzXJscvq9GJoygq+iPeQHuUCBbPNTEhOTY7+7mc X-Received: by 2002:a17:907:6088:b0:78d:8e24:40d0 with SMTP id ht8-20020a170907608800b0078d8e2440d0mr10894991ejc.590.1665405968314; Mon, 10 Oct 2022 05:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665405968; cv=none; d=google.com; s=arc-20160816; b=veG24+s7gxCpOPG/DLhF1l9Rpk11XE8B4oXsvDxHsonjjlh/Z+cnJsxHzuXO8mI3H3 /66vI2I9pRMMjvagLP4oDSMAb6+c+NeqI58tnEQGVVZgk40esjZibiLkq/5jKeppN8D+ vSEhA+84ezbVANKZpEZg1eZ/MYOKhqfzQq3ZaK8hf4VBBHxht3k6o261UT6vap5RHKlT d9dfx6zvzn0biLHiDgeem1VS13vmxN0HTe7Csz6UIGF9RmHQtbioYT3z/imn4uzL3rcm 1yuuHmWym9/u+ZqUzmVM3OjS12w0z9FZoyaRXKdx4iSNVqLVGASY4FryxgClKiRIZi0a XCNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=QA6f2HlVW1NJBZ3C2GoKq9SiJ7l5EStNIWPvZ+GnIV8=; b=skW1+e+o/p7Mp0ojtu0dQthz4jdQHha7a4bjSQNBCGFaz63Nc1BM3wO9pn2iQXikmE KgGWGpl8NL4aJccZya5m7WoGL/tdL/jf1qqSLkQl9VwkrX+I+4z/IxpsWBXU8G+FZfx4 ruqM/JchwFM3c7T0VVI6LLOsBIqJyMHfnZKinxkQzpsmZOsdD6lqqLb4+5tPovHG4+zS 5zEJ07QHB5bMCv9NBcpouYzssirLT9ldMfPO70vs3QBipTE2rwuX8MA0p4/DQOW4xM0+ YFlMn3aX2YXmYFww7exX3bJNYXRdbHXPXWwFOLJgTDrhoTZH92oRJxJx/jBW/V+mR3Ev CEzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PIon4rHa; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz20-20020a1709077d9400b0078d473448afsi9834634ejc.233.2022.10.10.05.45.42; Mon, 10 Oct 2022 05:46:08 -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=@redhat.com header.s=mimecast20190719 header.b=PIon4rHa; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232034AbiJJMfJ (ORCPT + 99 others); Mon, 10 Oct 2022 08:35:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230463AbiJJMfG (ORCPT ); Mon, 10 Oct 2022 08:35:06 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 170A715A00 for ; Mon, 10 Oct 2022 05:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665405301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QA6f2HlVW1NJBZ3C2GoKq9SiJ7l5EStNIWPvZ+GnIV8=; b=PIon4rHaOshMl+hWKo7mYNaSr8EU69hlP9f/kNJmuh+cjSt0BhvvACNiOHZ5sNcBnankDS +gVaPBywPVGfmJ1dSlweFsow7cyydKR0NuRMMs5qi9AX7iUsNRQgyZfr2YqxEVPCjohUG3 5odEjiZ2FKW7txD01+Tv6M1gx8059oY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-2-wRjZH-_IOo-OjcM7dr5rog-1; Mon, 10 Oct 2022 08:33:41 -0400 X-MC-Unique: wRjZH-_IOo-OjcM7dr5rog-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F1E57185A792; Mon, 10 Oct 2022 12:33:39 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B496C2C8D6; Mon, 10 Oct 2022 12:33:32 +0000 (UTC) From: Florian Weimer To: Andrew Cooper Cc: Kees Cook , Rick Edgecombe , "x86@kernel.org" , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-mm@kvack.org" , "linux-arch@vger.kernel.org" , "linux-api@vger.kernel.org" , Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , "H . J . Lu" , Jann Horn , Jonathan Corbet , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V . Shankar" , Weijiang Yang , "Kirill A . Shutemov" , "joao.moreira@intel.com" , John Allen , "kcc@google.com" , "eranian@google.com" , "rppt@kernel.org" , "jamorris@linux.microsoft.com" , "dethoma@microsoft.com" , Yu-cheng Yu Subject: Re: [PATCH v2 18/39] mm: Add guard pages around a shadow stack. References: <20220929222936.14584-1-rick.p.edgecombe@intel.com> <20220929222936.14584-19-rick.p.edgecombe@intel.com> <202210031127.C6CF796@keescook> <37ef8d93-8bd2-ae5e-4508-9be090231d06@citrix.com> Date: Mon, 10 Oct 2022 14:33:30 +0200 In-Reply-To: <37ef8d93-8bd2-ae5e-4508-9be090231d06@citrix.com> (Andrew Cooper's message of "Wed, 5 Oct 2022 02:30:56 +0000") Message-ID: <87bkqj26zp.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE 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 * Andrew Cooper: > You don't actually need a hole to create a guard.=C2=A0 Any mapping of ty= pe > !=3D shstk will do. > > If you've got a load of threads, you can tightly pack stack / shstk / > stack / shstk with no holes, and they each act as each other guard pages. Can userspace read the shadow stack directly? Writing is obviously blocked, but reading? GCC's stack-clash probing uses OR instructions, so it would be fine with a readable mapping. POSIX does not appear to require PROT_NONE mappings for the stack guard region, either. However, the pthread_attr_setguardsize manual page pretty clearly says that it's got to be unreadable and unwriteable. Hence my question. Thanks, Florian