Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1241187rdb; Fri, 16 Feb 2024 09:16:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUhbIwLUNSa7s7poBMIw/gGp6GQdPx3GKbbfkRsduEVa+Ld1zj6vgBdYYfIs9j7listOiByw32IJBm4EFSa/1spjI2lxn/4azu20J/d1Q== X-Google-Smtp-Source: AGHT+IFATA/ZFnsJUDY2UbGKlxlrnpGI/WtqujdHARhHuxak5nUimc8L7EuAoDgU0OiGWjZIUm6N X-Received: by 2002:aa7:c142:0:b0:561:ad3f:a0a6 with SMTP id r2-20020aa7c142000000b00561ad3fa0a6mr4224157edp.10.1708103809178; Fri, 16 Feb 2024 09:16:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708103809; cv=pass; d=google.com; s=arc-20160816; b=H28IWABaHXlztl2PIi9l3I/AtXdwOTW16tKB3VAg/1Sr6cyPoUfhYYmvpumclI9mkV wJFeYOi5rb1kCq//QreSngz7ggHle5G0djn4rjNSgL4rES+T/JEvxBcUTH6FEYrH9Xmx G6E8BDgsJRX6jT/4szG2M+m9ctofzfkK3viHF6KpUts4KEuALDP+p8pgsYlvgdHq7ip5 /f4+5DRACrDnI2ntp9JZ4Z+sssyusDomOFaFq8cNuH5sjTBf/92u+DawqSRCWC8bMaNP hhgD23f5rpu29XJt2aCUIIgP1Ro7WskPoyUk3fed2o/0wJtVvnPhNf+OSWpGOLg9il6D DSkQ== 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=CTKIzxvvqvoKkpaLileEBMPn/QtgsXCFVF8YQmrsEaE=; fh=Ar1T9knHlzutYC2o5BTG6ovufQZYmTw02TxlbtTLXtI=; b=hWILc8yUMYOp9/D6WJkFfmsOHFVeNFGlEBZaI4d57C7Kk+ByCPIIq5s5uyzP9UroXb ttG1M8zaw2rJWTEruCESoBWzai6E98Kz2g9iBaSmAdk0gjce6mdSB9CDy0I9s/PQPOZD fXG0pGJJGACEfeCnttdx+gzAtFY4FPqL1dwVY46Msl+h99PIwXQySOMjn0wRQbMv/nLy kZBGWZDD5Tk8EGyNhDVrZmwfvxbiTlOsInonAV4QLxnQe1L7y2laZRVaX7ZHoe9WGxLc zRGcbeRVj4LZRF1ZfBbxSf8fiJrwYxPV8RbYUcm/Yh+oQ3LiWXLM0AtF/E6bCCXpN0o0 DEkw==; 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-69054-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69054-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dn27-20020a05640222fb00b00563c5ea4497si143703edb.116.2024.02.16.09.16.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 09:16:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69054-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-69054-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69054-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 am.mirrors.kernel.org (Postfix) with ESMTPS id EA2341F28300 for ; Fri, 16 Feb 2024 17:16:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8EDA7131E43; Fri, 16 Feb 2024 17:14:37 +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 F350F130E2F; Fri, 16 Feb 2024 17:14:33 +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=1708103677; cv=none; b=GHKxYsDTqg/Y1r3r7i5ijqa7hi6VhGWg1q6ugIlsmoU1i2wrMV+R1AhVhHaXD6GcQzOJm8upEqQmhlBvgihJvXy+lC3quqTID5FqOTY8nCt+JOjNPdnnaCFPTiSLB8csUK3Ab5+k8HPf2wDuuwQV3Q7OLdUaNM7iHSct6Ko+AxM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708103677; c=relaxed/simple; bh=rmDRwiwblhwvtwuvm75M2GVP+g+7jtMynVV9YVddlKM=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=E4YLo7lEewiCekvrjejuRDnIOrtTb12/9ei0KmALZ8n35/4qXGr/pMRQ4x48ZjvO0XC/MgE6T9urQmFONUmw39AixzG35+aOKnkgBRl+fpW6CTt2zykwRN0UspL1QmaXy2qNwm+ASBiKNMzwQdeE/bOpVZrhbkX++62Y4rp5lz8= 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.29]) by frasgout13.his.huawei.com (SkyGuard) with ESMTP id 4Tbynt0GgWz9yLtP; Sat, 17 Feb 2024 00:59:14 +0800 (CST) Received: from mail02.huawei.com (unknown [7.182.16.47]) by mail.maildlp.com (Postfix) with ESMTP id ECDE91407B0; Sat, 17 Feb 2024 01:14:20 +0800 (CST) Received: from [127.0.0.1] (unknown [10.204.63.22]) by APP1 (Coremail) with SMTP id LxC2BwA3Lxjal89lNL2hAg--.6264S2; Fri, 16 Feb 2024 18:14:20 +0100 (CET) Message-ID: Subject: Re: [RFC 6/8] KEYS: PGP data parser From: Roberto Sassu To: "H. Peter Anvin" , 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)" , 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 18:13:58 +0100 In-Reply-To: References: <20240216152435.1575-1-petrtesarik@huaweicloud.com> <20240216152435.1575-7-petrtesarik@huaweicloud.com> <5916fa3ac3d0ce2ade71e7ed1c9eb6923e374c1f.camel@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-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID:LxC2BwA3Lxjal89lNL2hAg--.6264S2 X-Coremail-Antispam: 1UD129KBjvJXoW7AFyUtw45JF1xArWDGF18AFb_yoW8XF4Dpr yxGa48tF4vqr4Fvr4qyw1fu34Svw4fJr1DXrn8JrWFyFn09r1akr1Ikr45WF9Fgr4xG3W2 yw4qgryagw1UAaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvY14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVCY1x0267AKxVWxJr 0_GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvEwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2ka 0xkIwI1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67 AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26rWY6r4UJwCI c40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267 AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Wr1j6rW3Jr1lIxAIcVC2z280aVAFwI0_ Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU0xZFpf9x0J Ud8n5UUUUU= X-CM-SenderInfo: purev21wro2thvvxqx5xdzvxpfor3voofrz/1tbiAQAPBF1jj5pt9QABs4 On Fri, 2024-02-16 at 09:08 -0800, H. 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 > > > >=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 packe= t > > > > sequence (RFC 4880) and if it parses okay, attempts to extract a pu= blic-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. > >=20 > > Sigh, this is a long discussion. > >=20 > > 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. > >=20 > > With the assumptions that: > >=20 > > - 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 > >=20 > > the only available option is to do it in the kernel (that is what I got > > as suggestion). > >=20 > > Roberto > >=20 > >=20 >=20 > Ok, at least one of those assumptions is false, and *definitely* this app= roach seems to be a solution in search of a problem. I'm looking for a solution to this for a long time. Could you please explain? Thanks Roberto