Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp717196iol; Thu, 9 Jun 2022 12:23:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx53UcraZVkcY9pfWhNme9JPBKtQlSznZGwoZU7EwAZbmPA2gfoB3ZuaDD0aicCVDaA/wH X-Received: by 2002:a63:221b:0:b0:401:afc8:dbfc with SMTP id i27-20020a63221b000000b00401afc8dbfcmr1643766pgi.482.1654802581494; Thu, 09 Jun 2022 12:23:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654802581; cv=none; d=google.com; s=arc-20160816; b=fjWdIaCy1LoD+pSoIFWbm4MF4hrujhxUEymxHQwAvkA7CtrhPKXWEIyb7pXCsNkDnK 494R+vdxkMgJr8QVWoST4pcViKAOpPfPllleHwsbDnVHb2NlwyqxOobbZnBV2LcPrTkJ Ev5xunW9TfLggvZQm/ds8yiez7KU79kejv+7jbOjsor5ABpciQwP8OQOwfmHds+OsQt6 Qv/uD8Z2TQaFqo9FjD3HMZn35IWGLMLSArwwtNp2WTMCLuzVHirp8viQKwswQlHz1vvi ZfAlh5ZDT8ruzAEBA+SllbwZ06t2WpT4RoJYW7B04mLCnSHNoVWqJDPinffK7DsWqccD IGUA== 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:dkim-signature; bh=yJLc4PH3PDcmAUuph5a46LxnGUE6lrPoxTLqj5RjDkw=; b=k7hJBQB43JcTrViNwUDaxmHxiIJbXaN2bJkjhBqFAvbNpbBeLJixpcd3y9QIz8XFZb 5npfZyQ/O/3Y9WMgY0JdiQi/exYrHgJ5Bb0xN7jtux9X7ugWQzmk0ctOR4eACURPG+IB EjQNhh9abGp2iuNxVFbNeSO+K5XxFNxqmL1HzH5SHsx86XRY1MQbGARKRAHulzwYAttx 8i/yKyQbt6UJsL8y5qEdDJCt1QaOjIsHXMn0ZU+oRGRbpovq7mwRTOp/MsQgTSDOfEro 97j9cGQntLc300ZKs4gbhVaT9TWFf4BJuZ6UylJ1kiqKQn7wa/kPZlDI0bcZDIVJfzID acaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BTB64wyg; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l190-20020a6388c7000000b003db48a0c6ecsi2971669pgd.792.2022.06.09.12.22.48; Thu, 09 Jun 2022 12:23:01 -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=@kernel.org header.s=k20201202 header.b=BTB64wyg; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244589AbiFISFA (ORCPT + 99 others); Thu, 9 Jun 2022 14:05:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238630AbiFISE6 (ORCPT ); Thu, 9 Jun 2022 14:04:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEEDC20014D; Thu, 9 Jun 2022 11:04:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 68E1661D06; Thu, 9 Jun 2022 18:04:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27328C34114; Thu, 9 Jun 2022 18:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654797889; bh=pASgOkIhhI/ZJTQJiOxQQ7BetAsfgOyqGy5+OxBbrvU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BTB64wygOFCsPdDhaQrt8ga2Ig64u/kXZw4tZeGJT0YWnHOFEVrA9wtMwDaA4po75 tHkRwZ4Z1OS5DEp1vz0DLZjhsVFXOj9cWFGJqF8h1e4ExnGDlLM66vc852A7UGTVkV yEz7FlAClMKRrohieUz/v2D/e1sIUfPAptFYdXD6e5jM5B9XSjou+kMB5JSzyCWkav Vy3bM2wpcA65mdDfoHZTzmvQ2m/dzKtFKO6ebtcmQ6ve9Ss5LpTv7FPNvFa0fZq3IE X+WdUzskIEX0iCxmt+US9NfG657DMkWYw8HIeB0mVRrH72fJJ6NrdiTApIn1c/+71Q Z1MZF3k8udZcQ== Date: Thu, 9 Jun 2022 21:04:34 +0300 From: Mike Rapoport To: "Edgecombe, Rick P" Cc: "bsingharora@gmail.com" , "hpa@zytor.com" , "Syromiatnikov, Eugene" , "peterz@infradead.org" , "rdunlap@infradead.org" , "keescook@chromium.org" , "0x7f454c46@gmail.com" <0x7f454c46@gmail.com>, "Eranian, Stephane" , "kirill.shutemov@linux.intel.com" , "dave.hansen@linux.intel.com" , "linux-mm@kvack.org" , "adrian@lisas.de" , "fweimer@redhat.com" , "nadav.amit@gmail.com" , "jannh@google.com" , "avagin@gmail.com" , "kcc@google.com" , "linux-arch@vger.kernel.org" , "pavel@ucw.cz" , "oleg@redhat.com" , "hjl.tools@gmail.com" , "linux-doc@vger.kernel.org" , "Lutomirski, Andy" , "bp@alien8.de" , "arnd@arndb.de" , "Moreira, Joao" , "Yang, Weijiang" , "tglx@linutronix.de" , "mike.kravetz@oracle.com" , "x86@kernel.org" , "john.allen@amd.com" , "dave.martin@arm.com" , "mingo@redhat.com" , "Hansen, Dave" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "gorcunov@gmail.com" , "Shankar, Ravi V" , "linux-api@vger.kernel.org" Subject: Re: [PATCH 00/35] Shadow stacks for userspace Message-ID: References: <40a3500c-835a-60b0-15bf-40c6622ad013@kernel.org> <7c637f729e14f03d0df744568800fc986542e33d.camel@intel.com> <1d77dcab5d5ee7c565cfc62601d3a28ecf5a6bed.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1d77dcab5d5ee7c565cfc62601d3a28ecf5a6bed.camel@intel.com> X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Wed, Jun 01, 2022 at 05:24:26PM +0000, Edgecombe, Rick P wrote: > On Wed, 2022-06-01 at 11:06 +0300, Mike Rapoport wrote: > > > Yea, having something working is really great. My only hesitancy is > > > that, per a discussion on the LAM patchset, we are going to make > > > this > > > enabling API CET only (same semantics for though). I suppose the > > > locking API arch_prctl() could still be support other arch > > > features, > > > but it might be a second CET only regset. It's not the end of the > > > world. > > > > The support for CET in criu is anyway experimental for now, if the > > kernel > > API will be slightly different in the end, we'll update criu. > > The important things are the ability to control tracee shadow stack > > from ptrace, the ability to map the shadow stack at fixed address and > > the > > ability to control the features at least from ptrace. > > As long as we have APIs that provide those, it should be Ok. > > > > > I guess the other consideration is tieing CRIU to glibc > > > peculiarities. > > > Like even if we fix glibc, then CRIU may not work with some other > > > libc > > > or app that force disables for some weird reason. Is it supposed to > > > be > > > libc-agnostic? > > > > Actually using the ptrace to control the CET features does not tie > > criu to > > glibc. The current proposal for the arch_prctl() allows libc to lock > > CET > > features and having a ptrace call to control the lock makes criu > > agnostic > > to libc behaviour. > > From staring at the glibc code, I'm suspicious something was weird with > your test setup, as I don't think it should be locking. But I guess to > be completely proper you would need to save and restore the lock state > anyway. So, ok yea, on balance probably better to have an extra > interface. > > Should we make it a GET/SET interface? Yes, I think so. -- Sincerely yours, Mike.