Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1136283rdg; Fri, 11 Aug 2023 10:50:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2LKfyhgqjXV4QbZEE5RGnjO+OHi531fKsDAAzTbSJjEuwRRXuobX3jA+K+GIiQSjbxb37 X-Received: by 2002:a17:906:5a57:b0:99a:e756:57bf with SMTP id my23-20020a1709065a5700b0099ae75657bfmr2510464ejc.7.1691776216577; Fri, 11 Aug 2023 10:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691776216; cv=none; d=google.com; s=arc-20160816; b=E9PPI8AyZZshE9icHNTpEg0xdbAkyNmMUJaWW4vIzd6ilBfVZpyCEy409mxldw7ncU yA5Bo6GhH0VAHf1Su0FfLdK9r1yPc3I64qNEHuYxhrhmz6fAJqMjtMLt0Lch2R7bkjcT cuwdBqZSbmrgKD7G0ZL3tRfs95cBp7CTgNxQx3f3RLDBYtUjuJPoSjDCqid5rGFCURgp zQbugfiRUyE2ibIywEtbU8b7gT52QlA7HqvsAnPs/zrn+1vVvRBna514uPP/AurDCnui SpYtIzulHp1L3r5UcB73CDSgyNxVtCPf+wFAX75f6ZyFrp4tDKARbyubkmkIcYIZj+mw augA== 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; bh=aku5mBlEWjIn3HF65aYhbt8EFBdr24wGir9Opl+4J70=; fh=2wxoOguWzzWu+YGUlY4iG2KZkVCU8hdxOZfl5CjkbsQ=; b=tT4U8H6XYVObl5YBxhmaEn1rvrcStqU1d2739X559qVNIKBO6emMM1Q0P9MCdSF8T1 pJImLb7+QUo3WX2zjIl9pLb7XZbM+Wp9ov9iZkg4u7vNs3wZHJgUx+IKmVxKzVnrMeAa ZTP7zq8QctQAHYkkxwPYo23DE/Ee6F6lJjH2j9s6cN6wKahsDsU7SpED4H/EkZhewOGS Iu7e7xdBLS4apc/uH3P3l0dTNotS0cU4fCLvPjzLnF2JtyKLiDfAX2XtlDZj8KbNQJU6 JiNYU5c46W28tKqdpA9ZdVZ5Aidvnfswe9iUNeORy+5LMs/68MlHW96oO87IqXvuhsnN uIWA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p14-20020a17090628ce00b0098d7390816asi4098997ejd.756.2023.08.11.10.49.51; Fri, 11 Aug 2023 10:50:16 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235583AbjHKQid (ORCPT + 99 others); Fri, 11 Aug 2023 12:38:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjHKQic (ORCPT ); Fri, 11 Aug 2023 12:38:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED89718F; Fri, 11 Aug 2023 09:38:31 -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 8C3AC6763F; Fri, 11 Aug 2023 16:38:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73644C433C7; Fri, 11 Aug 2023 16:38:26 +0000 (UTC) Date: Fri, 11 Aug 2023 17:38:24 +0100 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Jonathan Corbet , Andrew Morton , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Kees Cook , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy , "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v4 21/36] arm64/mm: Implement map_shadow_stack() Message-ID: References: <20230807-arm64-gcs-v4-0-68cfa37f9069@kernel.org> <20230807-arm64-gcs-v4-21-68cfa37f9069@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230807-arm64-gcs-v4-21-68cfa37f9069@kernel.org> X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=no 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 On Mon, Aug 07, 2023 at 11:00:26PM +0100, Mark Brown wrote: > As discussed extensively in the changelog for the addition of this > syscall on x86 ("x86/shstk: Introduce map_shadow_stack syscall") the > existing mmap() and madvise() syscalls do not map entirely well onto the > security requirements for guarded control stacks since they lead to > windows where memory is allocated but not yet protected or stacks which > are not properly and safely initialised. Instead a new syscall > map_shadow_stack() has been defined which allocates and initialises a > shadow stack page. I guess I need to read the x86 discussion after all ;). Given that we won't have an mmap(PROT_SHADOW_STACK), are we going to have restrictions on mprotect()? E.g. it would be useful to reject a PROT_EXEC on the shadow stack. -- Catalin