Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1022221pxb; Tue, 8 Feb 2022 07:39:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxS3XBs7PL0R+2AgdMRmSS/GxDris3UxV8kvA78UoZlvvSRupk3xREC/70oZdE5oKNloNuk X-Received: by 2002:a63:6946:: with SMTP id e67mr3931699pgc.535.1644334749022; Tue, 08 Feb 2022 07:39:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644334749; cv=none; d=google.com; s=arc-20160816; b=vF+Z6rJ8vIWbWwWHqJSo1tZIkmWKoYLPwfEkDVLdd3V0k18O5Q+65ObovX+Npc2pTj jU+4dDLgwx19xnWJePHxYjsQ01/pH9rRJLber9Yz40nFirtWAaVuKaxZpXQOOuLfEDpt Cm3Kk4XwPxOnFi5BPyncaW2HVWXpt87zvFrw77TcpxhNBqFRjKrtA7N8PxJrR6ihNU1Y xTrDIFTwMd4OD0W8yw5wd+/L4xGpFNGBj82Z3MelFi0+8U78fwa37UXm+iS+zI6G5scd q8z8AN+o70MOCDVxskqO4O1Zf4bMwTRTyiUxYgd2jeF31uwio7crjWxQMeCpZRgrdTZt 8RLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=H/6XqdlLk396Y2QV/u0CviHdgHbavtEEfHO99e5VpJc=; b=izjXnPeZVNiT7vGCmAlWS4v+ZUV0NvswER53OEagnnlYNJiZY26kRrKa0c7gWJYHiP mIJQijuqWklts6F9tnDazPBjKNuhRyQav9Gs2TTWg9ilTpiueNRgdjFEtkgQOTuAOac0 uDQC0pjL010H6Y2j01Fu+7vinVr3qrzpL1fuxKanARNTIjFr/+f+y5PvwKpLd16pPt9a TSI1hfU2SDgKObKAyhhOlPaGK+xIL/A17qUZn4josO4C2iTdGfBylfTYTndQ5vE1PbvQ 6RLzN1oNgCXL/T4iRrb2OUViJQY1KPx3C8UDqR0897JIS1aAQL02FCW/l0oJF7KnH8lR 9icA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CmLoRoLk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=bHhv8L+M; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v135si7155826pgb.634.2022.02.08.07.38.55; Tue, 08 Feb 2022 07:39:08 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=CmLoRoLk; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=bHhv8L+M; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355155AbiBHJcC (ORCPT + 99 others); Tue, 8 Feb 2022 04:32:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354933AbiBHJb5 (ORCPT ); Tue, 8 Feb 2022 04:31:57 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80DBEC03FECE; Tue, 8 Feb 2022 01:31:41 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1644312700; 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=H/6XqdlLk396Y2QV/u0CviHdgHbavtEEfHO99e5VpJc=; b=CmLoRoLkw9ZPal5/x5vYmdWovEEjkL22TdXDf3Bz5mlZfXlyt/sMLDc0uEJIVAodf+LWrE HgkJZludL/EhO9uJA0YLtM8QVA4heoIJNY1NefW+kfLlckpXfiAP7lO2Dcku6F66XMwMRq o/wVlYgTrmhT2C5SWnBcyAqQGVrrJDAOWdLCmZSb+M5A0ReRjGX/poGxnMwDe8HlVuOzfG HsvCPtALHi0fb0j4MvIFLzL//G/nsR0nxEgLhD0plKyEHHOHFo0+X8BOqt7BaP8TvXZcXA E63QNZ+qJ51B7WlphbW+fJCrUi5OW8k3WD42qk3vQ1PqWrlOfX4PK0b65cozlA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1644312700; 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=H/6XqdlLk396Y2QV/u0CviHdgHbavtEEfHO99e5VpJc=; b=bHhv8L+M3WgmMTbcDFVYRJHeq1WUkvHtzrNL3+LG8QxP8fqsZV0dX9MvnHHnd0sc5AgSIO Oga7MeFeLvO8DpDg== To: Andy Lutomirski , "Edgecombe, Rick P" , "hjl.tools@gmail.com" , "David.Laight@aculab.com" , Adrian Reber , Cyrill Gorcunov , Eugene Syromiatnikov , Dmitry Safonov <0x7f454c46@gmail.com> Cc: "bsingharora@gmail.com" , "hpa@zytor.com" , "Syromiatnikov, Eugene" , "peterz@infradead.org" , "rdunlap@infradead.org" , "keescook@chromium.org" , "Eranian, Stephane" , "kirill.shutemov@linux.intel.com" , "dave.hansen@linux.intel.com" , "linux-mm@kvack.org" , "fweimer@redhat.com" , "nadav.amit@gmail.com" , "jannh@google.com" , "kcc@google.com" , "linux-arch@vger.kernel.org" , "pavel@ucw.cz" , "oleg@redhat.com" , "Yang, Weijiang" , "bp@alien8.de" , "arnd@arndb.de" , "Moreira, Joao" , "mike.kravetz@oracle.com" , "x86@kernel.org" , "linux-doc@vger.kernel.org" , "Dave.Martin@arm.com" , "john.allen@amd.com" , "mingo@redhat.com" , "Shankar, Ravi V" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "gorcunov@gmail.com" Subject: Re: [PATCH 00/35] Shadow stacks for userspace In-Reply-To: <6ba06196-0756-37a4-d6c4-2e47e6601dcd@kernel.org> References: <87fsozek0j.ffs@tglx> <3421da7fc8474b6db0e265b20ffd28d0@AcuMS.aculab.com> <9f948745435c4c9273131146d50fe6f328b91a78.camel@intel.com> <6ba06196-0756-37a4-d6c4-2e47e6601dcd@kernel.org> Date: Tue, 08 Feb 2022 10:31:39 +0100 Message-ID: <87mtj1vh50.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Mon, Feb 07 2022 at 17:31, Andy Lutomirski wrote: > So this leaves altshadowstack. If we want to allow userspace to handle > a shstk overflow, I think we need altshadowstack. And I can easily > imagine signal handling in a coroutine or user-threading evironment (Go? > UMCG or whatever it's called?) wanting this. As noted, this obnoxious > Andy person didn't like putting any shstk-related extensions in the FPU > state. > > For better or for worse, altshadowstack is (I think) fundamentally a new > API. No amount of ucontext magic is going to materialize an entire > shadow stack out of nowhere when someone calls sigaltstack(). So the > questions are: should we support altshadowstack from day one and, if so, > what should it look like? I think we should support them from day one. > So I don't have a complete or even almost complete design in mind, but I > think we do need to make a conscious decision either to design this > right or to skip it for v1. Skipping it might create a fundamental design fail situation as it might require changes to the shadow stack signal handling in general which becomes a nightmare once a non-altstack API is exposed. > As for CRIU, I don't think anyone really expects a new kernel, running > new userspace that takes advantage of features in the new kernel, to > work with old CRIU. Yes, CRIU needs updates, but what ensures that CRIU managed user space does not use SHSTK if CRIU is not updated yet? > Upgrading to a SHSTK kernel should still allow using CRIU with > non-SHSTK userspace, but I don't see how it's possible for CRIU to > handle SHSTK without updates. We should certainly do our best to make > CRIU's life easy, though. Handling CRIU with SHSTK enabled has to be part of the overall design otherwise we'll either end up with horrible hacks or with a requirement to change the V1 UAPI.... Thanks, tglx