Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1589877pxb; Tue, 8 Feb 2022 23:19:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeWJTz8P+1g0xU5YJ04TpBuhCU+4cx4tv+bK0bY5x+p7Jcf4rjVGvzz1WU7U+dMsQJw8c6 X-Received: by 2002:a05:6402:430e:: with SMTP id m14mr1026167edc.86.1644391195337; Tue, 08 Feb 2022 23:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644391195; cv=none; d=google.com; s=arc-20160816; b=JKr4Xo0pXA/dicbTdAwY189kD13oIWR2fynTC2PK1FrNyaWRCgGMXdzKHwrYvTCSg1 K5nvmdOzSGT57lQkd+kjsHiSsnZmAOJoNTit4rXyDXJlySQq6Rk0Acb+JBIcfK8PIbTs IvB9PdTAL9FEF7QGBicpjNUU6SZylweLN0AAZafri6svDayiO0HOonEmwseaUqpTY/Cu cWP2qAvdgb069nkvC9MHYX/DAoHmCtic6ik7WSHZQWXcGeulQbdbh5gsEG4sBwXDLBxP sUqDwDmZdNqxqxNsfqP0Z34qpdMjyHE+zaL6O6U8Hcis2E1T9CH+RpXcR3EjRexdQnwd miOA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WEOlOoEMuPk0vObNrlEXF1L+1SgCTqBD+hTrs4SUw4w=; b=o4nKECnGQi0PLqso/YAZEaP2caJ6phCpGahLPLE+EnxSxxvY7JWgRRp0mLihnnKjEN fY1ThUsvjuVd4oc4J8c4qYcT1/SJInbkjH76FTULcLWXoYcnz8yt9AXL1WgN3dj0JCAv /6GTyb7XUXKt04UiGi8S9fG84/Ipr+wcAWHuevgMWBvW39FXs4+y2FMmvx9f+170m5qe LrLJ7XMq5ojSZnJb6n/9NcB8a4YzbnHxH0pdYLg2Ub3GOROvGhzmel7TF4bZZTrwDBEP Gudyb4W67QlHOlp5QeOi3j4PUQTkWG+TipMOuNjJXO6R8pqZfggp97lmauEbk2u3Ashu w3xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B3EKAJXr; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds7si12536095ejc.603.2022.02.08.23.19.30; Tue, 08 Feb 2022 23:19:55 -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=@kernel.org header.s=k20201202 header.b=B3EKAJXr; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353659AbiBHJR1 (ORCPT + 99 others); Tue, 8 Feb 2022 04:17:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350674AbiBHJRW (ORCPT ); Tue, 8 Feb 2022 04:17:22 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CA2FC03FEDA; Tue, 8 Feb 2022 01:17:19 -0800 (PST) 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 2EF1E61479; Tue, 8 Feb 2022 09:17:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D140C340ED; Tue, 8 Feb 2022 09:17:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644311838; bh=BRQppVmJemnXXpfZXfcxyJ76Uix+mNSFNn+dOUBit+Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B3EKAJXrMGa7sLQ/UIGqVwvEhckiwK7KbAYqdpGASMWBfI35qyTU08kJM7VInr/u7 L3HW1aG+k1r2XrAoYTgGpNICjfxqai3FcsJnTbxo86tYp1wj+Lde7V60xIX006sEyW w09Bzpsf6vUTpugq2l6spY1jKstIAX00/fA4FVKSIgpKT8VVKnfmsCzaZnWrOOkBuZ ZDGUROkTnlT3AX2stNNHZlSY1kqNoYYReLMvuXDSyWKrcWommrFseWqRFSjPujgbYj mceqt8Wcr0mdJ9QEWbQ+WTEH7UJPk61Et2a1RF9hTSjIIBGoS0jwmY4WoekJXtIegp mM1Lptsk/sLWA== Date: Tue, 8 Feb 2022 11:16:51 +0200 From: Mike Rapoport To: Dave Hansen Cc: Adrian Reber , Rick Edgecombe , x86@kernel.org, "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H . J . Lu" , 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 , kcc@google.com, eranian@google.com, Andrei Vagin , Dmitry Safonov <0x7f454c46@gmail.com> Subject: Re: [PATCH 00/35] Shadow stacks for userspace Message-ID: References: <20220130211838.8382-1-rick.p.edgecombe@intel.com> <8f96c2a6-9c03-f97a-df52-73ffc1d87957@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8f96c2a6-9c03-f97a-df52-73ffc1d87957@intel.com> X-Spam-Status: No, score=-7.1 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 Mon, Feb 07, 2022 at 08:30:50AM -0800, Dave Hansen wrote: > On 2/6/22 23:20, Adrian Reber wrote: > >>> CRIU Support > >>> ------------ > >>> In the past there was some speculation on the mailing list about > >>> whether CRIU would need to be taught about CET. It turns out, it does. > >>> The first issue hit is that CRIU calls sigreturn directly from its > >>> “parasite code” that it injects into the dumper process. This violates > >>> this shadow stack implementation’s protection that intends to prevent > >>> attackers from doing this. > ... > >>From the CRIU side I can say that I would definitely like to see this > > resolved. CRIU just went through a similar exercise with rseq() being > > enabled in glibc and CI broke all around for us and other projects > > relying on CRIU. Although rseq() was around for a long time we were not > > aware of it but luckily 5.13 introduced a way to handle it for CRIU with > > ptrace. An environment variable existed but did not really help when > > CRIU is called somewhere in the middle of the container software stack. > > > >>From my point of view a solution not involving an environment variable > > would definitely be preferred. > > Have there been things like this for CRIU in the past? Something where > CRIU needs control but that's also security-sensitive? Generally CRIU requires (almost) root privileges to work, but I don't think it handles something as security sensitive and restrictive as shadow stacks. > Any thoughts on how you would _like_ to see this resolved? Ideally, CRIU will need a knob that will tell the kernel/CET machinery where the next RET will jump, along the lines of restore_signal_shadow_stack() AFAIU. But such a knob will immediately reduce the security value of the entire thing, and I don't have good ideas how to deal with it :( -- Sincerely yours, Mike.