Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2379147rdb; Wed, 21 Feb 2024 06:05:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXSn9hiQ+5K8pHqIUIMDLvOfe/5p/gFvq/6mc2Q2KMTmMIu0mUt8ADCYFrLiQ5vqFuhrlhJTJr8EkbO0lizepMQb3ks4yWShq1V+UqCMA== X-Google-Smtp-Source: AGHT+IGs0COLjh0yxJTb9iUZzHhQCSPX/ljfn2v3RMTm1NGXluVpgqyOiUMhf4AvCkdJ+7H32i/W X-Received: by 2002:a6b:c304:0:b0:7c4:95ba:31c5 with SMTP id t4-20020a6bc304000000b007c495ba31c5mr20020775iof.17.1708524337818; Wed, 21 Feb 2024 06:05:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708524337; cv=pass; d=google.com; s=arc-20160816; b=lOkNlvPxdTTys+it/LPopuV6aaJ1sh+eoBoFJ8W9fxDLsjF3C3cP1a9K70bHydyGyh RYB6CJUp6veScrpWFojW9bt4GZzrNoeGIMQHENfEyKMNfn46hQLR6VbQlJVCfVmipBGw EWs/01jSjaKMud/yqj7qZ7nfSoUG9wMkQHgW8DEq4NEGI5//ZIyTEUnFmqDP8vhxYBtJ lUhyNjueTxW3AIjAk1APZxmDwT7XdmDwhwJ7ybttFkRfbLuzUIOUN9LQ6d7EyCnICXnK wHIlE+inH6tHiJGijFMQhuyDBXNb11Jh1OG3xX3JsAeajL1ieVNHgWOS4KrLqGCTbdSX w8zA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:references:in-reply-to :user-agent:subject:cc:to:from:date:dkim-signature:dkim-filter; bh=F8smVVCqOcx2eQeGpp+uPqQ1cqFR564JCusQLeNYovA=; fh=fWwZVvelLUEnOeL4xKNe66GUBvq31bymeqN4rp3k/xY=; b=ltLNQ2Ncn6RSXLa2bhWYuHqCsHN7Kclz7i5JvDhYKGJPXAig03V5vzBIPGpL2Pxbn/ LWANb68jDXGqVeDzbgVlQV1cl4M9KiYTmLuoj9P++hdZOurYStl8H2N/gt+CLbfAyHae 7lCTFTh8qzXg1CdfiP7XX76MEvKWvlIDNw/3MAbohyMpcJDhFK0n++ZxW4BbGnTiSNt7 wKPhpHqJAptaX2huwShq6NLYsQFnlOzdM9etexuwNtkw3Y9tf2ZdIx3QyuJ3KGf525Gj MLgh8pOdFuF5XYUuFSX5nTOkSgNbiRb182GXue8ht4cHSQHFMlNYjzXPDlGu5NEl7QjD ASOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024021201 header.b=hMPZjQiP; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-74850-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74850-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id gu10-20020a0566382e0a00b00470e8b2df7bsi3218843jab.171.2024.02.21.06.05.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 06:05:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74850-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2024021201 header.b=hMPZjQiP; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-74850-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74850-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7311F281E4F for ; Wed, 21 Feb 2024 14:05:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FE057EF01; Wed, 21 Feb 2024 14:04:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="hMPZjQiP" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C02E762C1; Wed, 21 Feb 2024 14:04:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708524276; cv=none; b=KAPNZzhebzNjH/Oiy7Pr2Rc1QyvuAaJqlhn0dmpEggjTjeZU7qANse9mBOm3gOkQPfGIe6LUilEH1w/cuTd9Cn5oxSlZlhZ6pvqJjZXsLgVKa9XCweExRZrSiifk/DKHJ4IOjZUedATYCDsVvcyHMYlEBEoFZXAR1kjr1VSHBK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708524276; c=relaxed/simple; bh=kNEIz7DluXXh2TDoFbuW54XyZrWn7/EUT/Q4+LwUoBs=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=InIwWDxiq9F9+p+vKvyXSNGYldti2ro7PUPDG7ulCs15rI2vfmKS4RxGFVnZypGHGyofMUML+rOmWgRMpa89h/OEJ5XEENtB4itzAFLuNLhE+j81pIBHXuR4U9F10BqdrO9MrtIXSWLYY2cb9G9H/ipkXaDQGZCjxT/87eT78VU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=hMPZjQiP; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from [127.0.0.1] ([76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 41LE2W5O4032626 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Wed, 21 Feb 2024 06:02:33 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 41LE2W5O4032626 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024021201; t=1708524157; bh=F8smVVCqOcx2eQeGpp+uPqQ1cqFR564JCusQLeNYovA=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=hMPZjQiPo0IXyXhQ+XmIdKygX3w7dHdoubyXEZ6mQt2adBYxofhlGC6MzfmfGSVxc hB4TIDljjzrBYPeqbuhtXMlHBW+BnSrems13Pi1i9sMY+JGT6ulxcYN1tO5jmRjiPL mbUWt9qW0N1U8DRdh78jm3Ir6mEkld740nOjUMsZ8f667NsbDRgXgexyl4hIb3jKDq ZAVOoQ9AfYmPKKntUpJi2U8471nHwC+jbNdQj8hWKa8SlzPTh5dlsE8BLjOKfRMF+9 tRTQn7Dc9t5psqS1H1Tdcw1cvm60NJ53KzjkeS6eqX15hjSkSHVS6G/AnnEEdylaY/ mhnU3LEJAB9Sw== Date: Wed, 21 Feb 2024 06:02:30 -0800 From: "H. Peter Anvin" To: Petr Tesarik , Roberto Sassu , Matthew Wilcox , Petr Tesarik CC: Dave Hansen , =?UTF-8?Q?Petr_Tesa=C5=99=C3=ADk?= , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Andy Lutomirski , Oleg Nesterov , Peter Zijlstra , Xin Li , Arnd Bergmann , Andrew Morton , Rick Edgecombe , Kees Cook , "Masami Hiramatsu (Google)" , Pengfei Xu , Josh Poimboeuf , Ze Gao , "Kirill A. Shutemov" , Kai Huang , David Woodhouse , Brian Gerst , Jason Gunthorpe , Joerg Roedel , "Mike Rapoport (IBM)" , Tina Zhang , Jacob Pan , "open list:DOCUMENTATION" , open list , David Howells Subject: Re: [RFC 6/8] KEYS: PGP data parser User-Agent: K-9 Mail for Android In-Reply-To: <773dd9fb-e668-4652-8b24-712553bb7ab1@huawei-partners.com> References: <20240216152435.1575-1-petrtesarik@huaweicloud.com> <20240216152435.1575-7-petrtesarik@huaweicloud.com> <5916fa3ac3d0ce2ade71e7ed1c9eb6923e374c1f.camel@huaweicloud.com> <773dd9fb-e668-4652-8b24-712553bb7ab1@huawei-partners.com> Message-ID: <70F9F1E7-4803-46C8-AB6E-AC1CF345F03E@zytor.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On February 20, 2024 2:55:12 AM PST, Petr Tesarik wrote: >On 2/16/2024 6:08 PM, H=2E Peter Anvin wrote: >> On February 16, 2024 8:53:01 AM PST, Roberto Sassu wrote: >>> On Fri, 2024-02-16 at 16:44 +0000, Matthew Wilcox wrote: >>>> On Fri, Feb 16, 2024 at 04:24:33PM +0100, Petr Tesarik wrote: >>>>> From: David Howells >>>>> >>>>> Implement a PGP data parser for the crypto key type to use when >>>>> instantiating a key=2E >>>>> >>>>> This parser attempts to parse the instantiation data as a PGP packet >>>>> sequence (RFC 4880) and if it parses okay, attempts to extract a pub= lic-key >>>>> algorithm key or subkey from it=2E >>>> >>>> I don't understand why we want to do this in-kernel instead of in >>>> userspace and then pass in the actual key=2E >>> >>> Sigh, this is a long discussion=2E >>> >>> PGP keys would be used as a system-wide trust anchor to verify RPM >>> package headers, which already contain file digests that can be used a= s >>> reference values for kernel-enforced integrity appraisal=2E >>> >>> With the assumptions that: >>> >>> - In a locked-down system the kernel has more privileges than root >>> - The kernel cannot offload this task to an user space process due to >>> insufficient isolation >>> >>> the only available option is to do it in the kernel (that is what I go= t >>> as suggestion)=2E >>> >>> Roberto >>> >>> >>=20 >> Ok, at least one of those assumptions is false, and *definitely* this a= pproach seems to be a solution in search of a problem=2E > >As a matter of fact, there is some truth to this observation=2E > >The frustrating story of Roberto's PGP parser sparked the idea, but it >would clearly be overkill to add all this code just for this one parser= =2E >I started looking around if there are other potential uses of a sandbox >mode, which might justify the effort=2E I quickly found out that it is >difficult to find a self-contained part of the kernel=2E > >Now I believe that these dependencies among different parts of the >kernel present an issue, both to kernel security and to maintainability >of the source code=2E Even if sandbox mode as such is rejected (hopefully >with an explanation of the reasons), I believe that it is good to split >the kernel into smaller parts and reduce their interdependencies=2E In >this sense, sandbox mode is a way to express and enforce the remaining >dependencies=2E > >Petr T Congratulations=2E You just reinvented the microkernel=2E