Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp901418pxb; Tue, 1 Feb 2022 12:47:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxP1xTaPU42JMGROVDb1ZwgyVKnebo1P0dQHRzOuoPlfVMBq6ij0igqeXxX6wDemDgbLecB X-Received: by 2002:a17:903:41ca:: with SMTP id u10mr19900712ple.74.1643748449577; Tue, 01 Feb 2022 12:47:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643748449; cv=none; d=google.com; s=arc-20160816; b=c+R3TwWjzFQwuEC04rzwyhhtKnWj+JH0cb0jZP5KHDYJ9/AjA0DW3SqDNGWLG1rVtz kiF0ZMbQ/5ajrm0QBd1+N4qh9gRSL1UWHzNj3Ljyle+8rgZdpq7a3om6yQkYaU8eXQcE aC0qU+F9p477CbMMiABkJwUniweO3hXQ60xHGbtOWyAwK7kimk86IGg2zIrXabcZ8c1m jCSutrnkpaeQ5/kjJvjupEwIQ4elCJuUX2gRH92rJ7URQk87I7vb5OeODYy22UMBpaUW dTZs72vQ/N9DOjY0z4a3hmiibINouc6iS+AlZWEIG6ravu4ZFAwjyMPRLhloDvzxuIXH QoIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=vtLdnydhSAxPSqAH4Eff+DcCHxcUpx4pphU3ycHuRAA=; b=maFokEgeJBLrbG5/uhbTcmW2u0OSyQRbmWIZziRQ/hEcFlD/NK1FzA7ngBaL5tpKlJ j4jj0XiNk1T6CnOqgaX/MC3zFf4sBNERow8ZXA0zZQvq65K2kDS75yjHT9wOx0DlEAfa cGsgFF2QEUK09zLYHPUm2a9M8n8Gbi5HmB4s3Xyj2PH6vBJTcJmHldElPsbyFitvd0uy 8Frx+bj9Z/b2HTakqTZFZGxVBYC/rkgIB9IYwM2M4ycKTnZlxoqbcs4ysb+VA0kQYYdH 95yizhFB0P/6/mHdfaVXez8aEmTdWB2rEGoABzwDGreUSHcXwFBB1s7S7csfOU/pVVpX WPkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F8RHP4PD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bb4si15405938plb.228.2022.02.01.12.47.18; Tue, 01 Feb 2022 12:47:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F8RHP4PD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1357337AbiAaSp3 (ORCPT + 99 others); Mon, 31 Jan 2022 13:45:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:33876 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357318AbiAaSp1 (ORCPT ); Mon, 31 Jan 2022 13:45:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643654726; 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=F8RHP4PDheT8vRCH7jAa9+p7kRmYpHs+8gYXnCfcbOznv89LMGpFm8CPdEKs5FtDBMPxzF p+ungUpoSZcVzy4JytulTDg5lk+IgctmUDHY/Ig5+AwYYVQdil/6CXiCGxVb1IQqCtaZzD xGeoKwAYNlExlVK5zfFNgVyEw8BicNQ= 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-kernel@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