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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFCE7C433F5 for ; Mon, 31 Jan 2022 18:45:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3CC078D001C; Mon, 31 Jan 2022 13:45:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 37BEE8D0001; Mon, 31 Jan 2022 13:45:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 21D038D001C; Mon, 31 Jan 2022 13:45:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 13EFE8D0001 for ; Mon, 31 Jan 2022 13:45:30 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C6A20182229F8 for ; Mon, 31 Jan 2022 18:45:29 +0000 (UTC) X-FDA: 79091460378.07.82D91C2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf06.hostedemail.com (Postfix) with ESMTP id E37FA180006 for ; Mon, 31 Jan 2022 18:45:28 +0000 (UTC) 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 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Hj/O035T"; spf=none (imf06.hostedemail.com: domain of fweimer@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=fweimer@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: nil X-Rspamd-Queue-Id: E37FA180006 X-Stat-Signature: hw5m4x541uadmzxjm8comtw8np5f9z59 X-Rspamd-Server: rspam12 X-HE-Tag: 1643654728-516027 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: * 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