Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1226425rdb; Fri, 16 Feb 2024 08:54:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWCs3vDl6Q+e0d9l6a3J8BfrV6rDDNC4dMJF7hx/fw+T2lTyU5A7OVMlCmZ4TDwfTXwB+0LoXDdkNYPHDiMguw6fpv5tyA1TYsQDHo8Vg== X-Google-Smtp-Source: AGHT+IGHi6dWEGwIYESnqOQCZCrYSRX/F0wxA8f2H2Ct7RrqLjGMAqt/Z6Fu7FIyHeOu95jMSytr X-Received: by 2002:a17:902:7888:b0:1d9:5cfc:ac6a with SMTP id q8-20020a170902788800b001d95cfcac6amr5391100pll.69.1708102466132; Fri, 16 Feb 2024 08:54:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708102466; cv=pass; d=google.com; s=arc-20160816; b=x5UZPR15WoR6TKBj8CimNHWEW4oeCoXiyUAALbnO4xS/DowlrwejnnqxQakN7yjjdW MMAYQaCMiLi4z+Kwj3grJqr6tXyf8Cd+iAOSG+BjXNqdjf2x+ooMQsukZabbHJQx9+13 NYJ5jU9TdJO+s1GeUgW0RG5o/FlZJmDUUaCNQVQrfr7ob0ccobhWiFUKij5hMNQIUqCj 7C3eBopoHRxCFwC8MbHJbonsAopgBEV90dOSoeRQw4IrWT8WukzW0BnDfMUrtBjljWBb efg3yQqGngNFfabl3CVERbyKWvbU0hKnDHzRMI7dHPgEKiEK3KP8w0mqtaBucvvS3A05 gdeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id; bh=kPwIGLJYtNVnDgdQmURv8flV0LqJUUJTI1U0J8dKmAY=; fh=ieQYACqE65N4Ctx/dmBt5KxBSKVAP5fHMQ8sgjKhcy4=; b=rWH2+lEMQ0qNkdhkMO2VSYvYgnJPiRRd7D4OwhX/LKRoj+UQo5ZRKoOpdNH7IGUb3A kYInqPsZs+GKBASuUUfpNR50jqyi6fNn5eQtxUmj3aY+qr5gZqGns/DN/gqj7w2/VLSd wf6CK1bZ6IqgbuJFKOZiTY+/kjQYVyZ9RJsEW64NvUYzIIbD06mTgUoaxK9okxBtAAR4 g2/2JELTdAza11SIA5l2bDcn6BoS9r0UIWr0D75w7mliwrUScDKOCNtw20Teevtz/vZG P4WF0QGh6Qb28x5DfmTiWgBbK2i6yqzcjuSDzM4ZZActakMa3NE/Zb8k0ch7x/rnT3Eu 9h9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-68990-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68990-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id j14-20020a170903024e00b001d95fa9bf07si112773plh.428.2024.02.16.08.54.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 08:54:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68990-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-68990-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68990-linux.lists.archive=gmail.com@vger.kernel.org" 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 D423A284FDB for ; Fri, 16 Feb 2024 16:54:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E934C132C1C; Fri, 16 Feb 2024 16:53:38 +0000 (UTC) Received: from frasgout13.his.huawei.com (frasgout13.his.huawei.com [14.137.139.46]) (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 278B1130E2B; Fri, 16 Feb 2024 16:53:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=14.137.139.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708102418; cv=none; b=Zu66BY4xl0rrT5AM5zvXzgV7AaSl5PsOWcjTaysncTvoxJqGEGgTqeUlpF1aCtpSNs6hd3lBssdIMCmF/6BI1xAyR77krJAAU3oZIn0WYtE3haUlNRX0mmhtpS1U1R6Mb8naeK2ywL/UHbcoXW5aBa9Hvh8MKcT53nxflJPJz9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708102418; c=relaxed/simple; bh=p+T7UhwuH1nBkWMxDYvNjDDJXqUPMgBVuhPNeXJWCME=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=E4cSg50v4hHWe+NZ5SU1PO5Fuwf21hmGRdlM3m+0mk9wbfiMVsDZOalk5XFMVPI6dTzZRBMEuHGbJu9OuXp8C07xbKWCzYEqtIk0KFngCggoXUeWsErwJk0LWSewjs+91PGnANQMr7HFvI/zqjhSLCXQuby1kBoBiqc52XsXGE4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=14.137.139.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.18.186.51]) by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4TbyKh0XDHz9xFH8; Sat, 17 Feb 2024 00:38:16 +0800 (CST) Received: from mail02.huawei.com (unknown [7.182.16.27]) by mail.maildlp.com (Postfix) with ESMTP id ECBB614059D; Sat, 17 Feb 2024 00:53:22 +0800 (CST) Received: from [127.0.0.1] (unknown [10.204.63.22]) by APP2 (Coremail) with SMTP id GxC2BwCX0SXwks9lALGbAg--.29869S2; Fri, 16 Feb 2024 17:53:22 +0100 (CET) Message-ID: <5916fa3ac3d0ce2ade71e7ed1c9eb6923e374c1f.camel@huaweicloud.com> Subject: Re: [RFC 6/8] KEYS: PGP data parser From: Roberto Sassu To: Matthew Wilcox , Petr Tesarik Cc: Dave Hansen , Petr =?UTF-8?Q?Tesa=C5=99=C3=ADk?= , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , 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 , Petr Tesarik Date: Fri, 16 Feb 2024 17:53:01 +0100 In-Reply-To: References: <20240216152435.1575-1-petrtesarik@huaweicloud.com> <20240216152435.1575-7-petrtesarik@huaweicloud.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List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wI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUd8n 5UUUUU= X-CM-SenderInfo: purev21wro2thvvxqx5xdzvxpfor3voofrz/1tbiAgAPBF1jj5ZtzAABsO 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 > >=20 > > Implement a PGP data parser for the crypto key type to use when > > instantiating a key. > >=20 > > This parser attempts to parse the instantiation data as a PGP packet > > sequence (RFC 4880) and if it parses okay, attempts to extract a public= -key > > algorithm key or subkey from it. >=20 > I don't understand why we want to do this in-kernel instead of in > userspace and then pass in the actual key. Sigh, this is a long discussion. 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 as reference values for kernel-enforced integrity appraisal. 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 got as suggestion). Roberto