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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A45D7C433EF for ; Mon, 31 Jan 2022 18:45:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357419AbiAaSp3 (ORCPT ); Mon, 31 Jan 2022 13:45:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:57409 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355479AbiAaSp3 (ORCPT ); Mon, 31 Jan 2022 13:45:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643654728; 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: in-reply-to:in-reply-to:references:references; bh=vtLdnydhSAxPSqAH4Eff+DcCHxcUpx4pphU3ycHuRAA=; b=Hj/O035TwECiSNxr+AIROuEJ9Mzhi1/r7Mz3W3LcFmg/2nxSF07KNBiYfJu5AnkEiUImNj BF4Ox55NPG03aFwtRCzX3DdBO/TqKKU8ciDKm4wI6O7G/YMg5ohKLfxrotQa8KHohdwGvI wOQ9HCSh3ChqptKDpFRWb3cOA6EEEcU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-145-gIdbnm9XMoie-uVd8V9g0g-1; Mon, 31 Jan 2022 13:45:25 -0500 X-MC-Unique: gIdbnm9XMoie-uVd8V9g0g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 011FF1923B8D; Mon, 31 Jan 2022 18:45:21 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.193.205]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 42C7B7D526; Mon, 31 Jan 2022 18:45:12 +0000 (UTC) From: Florian Weimer To: "H.J. Lu" Cc: Rick Edgecombe , "the arch/x86 maintainers" , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V . Shankar" , Dave Martin , Weijiang Yang , "Kirill A . Shutemov" , joao.moreira@intel.com, John Allen , Kostya Serebryany , Stephane Eranian Subject: Re: [PATCH 34/35] x86/cet/shstk: Support wrss for userspace References: <20220130211838.8382-1-rick.p.edgecombe@intel.com> <20220130211838.8382-35-rick.p.edgecombe@intel.com> <87wnig8hj6.fsf@oldenburg.str.redhat.com> Date: Mon, 31 Jan 2022 19:45:10 +0100 In-Reply-To: (H. J. Lu's message of "Mon, 31 Jan 2022 10:26:49 -0800") Message-ID: <87a6fb7nih.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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org * H. J. Lu: > On Sun, Jan 30, 2022 at 11:57 PM Florian Weimer wrote: >> >> * Rick Edgecombe: >> >> > For the current shadow stack implementation, shadow stacks contents cannot >> > be arbitrarily provisioned with data. This property helps apps protect >> > themselves better, but also restricts any potential apps that may want to >> > do exotic things at the expense of a little security. >> > >> > The x86 shadow stack feature introduces a new instruction, wrss, which >> > can be enabled to write directly to shadow stack permissioned memory from >> > userspace. Allow it to get enabled via the prctl interface. >> >> Why can't this be turned on unconditionally? > > WRSS can be a security risk since it defeats the whole purpose of > Shadow Stack. If an application needs to write to shadow stack, > it can make a syscall to enable it. After the CET patches are checked > in Linux kernel, I will make a proposal to allow applications or shared > libraries to opt-in WRSS through a linker option, a compiler option or > a function attribute. Ahh, that makes sense. I assumed that without WRSS, the default was to allow plain writes. 8-) Thanks, Florian