Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp742696yba; Wed, 15 May 2019 09:10:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxONyLPBfhEy4urwS2+FYEPjmTFczwMo5EOq+6wsHOTJCFMGamPQzrOW3G0QDavaqWfWxFZ X-Received: by 2002:a62:36c1:: with SMTP id d184mr26102535pfa.49.1557936628054; Wed, 15 May 2019 09:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557936628; cv=none; d=google.com; s=arc-20160816; b=LOyyt/WfqejS7/lchoPMCgc3ErWyKzro71z/9pMLUP2Orswyt4FAalChPngtnxK9uI 7eB7UqRYbS/cf/V2Yi7FnHGZTY/1zK3b2kL1DlDr7lWeCHXYieptpQMIc2vYObquas0U DveyJbTnE5rPpxY0MXxcI+8iIGlfgMSGkNExfZ3QPGsND0eihg9Xed4Vs4tqxTIMxQUd 3sLZ7Lkjk+hfXVxGPwfdnAB/qbHeUuIFRqN4TIoJRqDjBCzKDuSTZsiOtEjUohq6qig3 hwCYSxhf0Z3z0WXV0C/hN3IDQhBel7QXd9GVZdh1OR7xdXBp5U2b6Kf4pLGe7ViawfLU N3Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=rDzDXjuWrp9NigrMtjTMJdSWxU9Nebxe8lEb+hdgCeM=; b=XvZihGxwOWAyT9e7iM8IduksJNKCyX87wFwlYO8YYSkuq9J15abfvDeQcXTlRPfjie JBA4hZjbIySLeCwft90oSTzhyDkHSAvoLw17ZtiPwIedHRlTK4psusfrpMhbNSS5Pm/f D1WldsOMqCrDnSbw6eAEKPEM/PhQfMSZu+BO9LAo04lxDRGlxCUJLqavYrRa+D8TVhec 9Y7+JH2rk2IybWOrp9gORzlfC7vEAvRgoj540gnCD+E49MJQrsrCZ9/l/LZkboYn9bsb KoGtXW1+hGA89sRYEliCIP6Bkme66H/k7/lZHTJPK+63cDbfkTztBvN9o1CWYDt3X+tA IzVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=VHn9zykA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si2018823plz.301.2019.05.15.09.10.08; Wed, 15 May 2019 09:10:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=VHn9zykA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726906AbfEOQIl (ORCPT + 99 others); Wed, 15 May 2019 12:08:41 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:43265 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726168AbfEOQIl (ORCPT ); Wed, 15 May 2019 12:08:41 -0400 Received: by mail-qk1-f194.google.com with SMTP id z6so298502qkl.10; Wed, 15 May 2019 09:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rDzDXjuWrp9NigrMtjTMJdSWxU9Nebxe8lEb+hdgCeM=; b=VHn9zykAWaopBAUtLYpZi2AwAslx4LYXUZC6gIWm3y3oTwtX1uqctoyNvZdojuOpa2 vGA20hlW+frZp52TTjJKD9a3KSfubK9jQGL/jOGj5EswmKpBa4bimDk8B25CApqyoT5P Nloc1fl83rg5n0HzsjceJf9wFDSOJmkoLRsdp5v7AxQGhFBO+t34gBdvgXXEIuxoetZe UZ5msDMVecVGJqPN6AynIdMkPzlx9U5dcg5tXSGWpK91Hnuj7E5GacEpvXKNcm2mdCa/ ujzPDsvL4SQRaOSNpzvae2YSNesTKPMELO6xwduxu4zBaW/RwXBTQ3OWrDeRMW8k+7nb hQfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=rDzDXjuWrp9NigrMtjTMJdSWxU9Nebxe8lEb+hdgCeM=; b=ot5TBcHfGpioosB7KpPYfZO2EAiCt+/WueNpbnr1NaGO4wsn2N5vrXeaeS1859acrZ Ul2w134WAAa+4/Jv3gUplWqp+QEHhBoJ5Egg7/bftJwqUPhHiCEmyXglbczm5ZC+P2rH HBbH3gtQJmkVHJv5h2OLGVI8yeLthIcciR13nABFhojI7fa8WC8RrKXCQMkxb++1jhpX 6nHCqP44yojMsmNHSB3OCrgmUAp4PRiXeO2u/0ZvYxdV7BTlPMuBzcK8KpUygwXIDbjS lxIM0Irf6jyxo0Q0CLl4VTFpUav3/WoyrXcjOTti1YInpg3BqnYo2QID9hs5fkDDmRDe jPyg== X-Gm-Message-State: APjAAAWLWL71XOoVJrjh9kNRUXuQ25+3YkPIjtNSdfzhLOU9C/UWuD8j kXN9HjjLk25i1UpYbly7HcQ= X-Received: by 2002:a37:6c84:: with SMTP id h126mr35184313qkc.168.1557936519219; Wed, 15 May 2019 09:08:39 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id o24sm1249308qtp.94.2019.05.15.09.08.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 09:08:38 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Wed, 15 May 2019 12:08:36 -0400 To: Roberto Sassu Cc: Arvind Sankar , James Bottomley , Rob Landley , Andy Lutomirski , Arvind Sankar , LKML , Linux API , Linux FS Devel , linux-integrity , initramfs@vger.kernel.org, Silviu Vlasceanu Subject: Re: [PATCH v2 0/3] initramfs: add support for xattrs in the initial ram disk Message-ID: <20190515160834.GA81614@rani.riverdale.lan> References: <20190512194322.GA71658@rani.riverdale.lan> <3fe0e74b-19ca-6081-3afe-e05921b1bfe6@huawei.com> <4f522e28-29c8-5930-5d90-e0086b503613@landley.net> <1557861511.3378.19.camel@HansenPartnership.com> <4da3dbda-bb76-5d71-d5c5-c03d98350ab0@landley.net> <1557878052.2873.6.camel@HansenPartnership.com> <20190515005221.GB88615@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 15, 2019 at 01:19:04PM +0200, Roberto Sassu wrote: > On 5/15/2019 2:52 AM, Arvind Sankar wrote: > > You can specify multiple initrd's to the boot loader, and they get > > loaded in sequence into memory and parsed by the kernel before /init is > > launched. Currently I believe later ones will overwrite the earlier > > ones, which is why we've been talking about adding an option to prevent > > that. You don't have to mess with manually finding/parsing initramfs's > > which wouldn't even be feasible since you may not have the drivers > > loaded yet to access the device/filesystem on which they live. > > > > Once that's done, the embedded /init is just going to do in userspace > > wht the current patch does in the kernel. So all the files in the > > external initramfs(es) would need to have IMA signatures via the special > > xattr file. > > So, the scheme you are proposing is not equivalent: using the distro key > to verify signatures, compared to adding a new user key to verify the > initramfs he builds. Why would it be necessary for the user to share > responsibility with the distro, if the only files he uses come from the > distro? > I don't understand what you mean? The IMA hashes are signed by some key, but I don't see how what that key is needs to be different between the two proposals. If the only files used are from the distro, in my scheme as well you can use the signatures and key provided by the distro. If they're not, then in your scheme as well you would have to allow for a local signing key to be used. Both schemes are using the same .xattr-list file, no? If the external initramfs is to be signed, and it is built locally, in both schemes there will have to be a provision for a local signing key, but this key in any case is verified by the bootloader so there can't be a difference between the two schemes since they're the same there. What is the difference you're seeing here? > > > Note that if you want the flexibility to be able to load one or both of > > two external initramfs's, the current in-kernel proposal wouldn't be > > enough -- the xattr specification would have to be more flexible (eg > > reading .xattr-list* to allow each initramfs to specifiy its own > > xattrs. This sort of enhancement would be much easier to handle with the > > userspace variant. > > Yes, the alternative solution is to parse .xattr-list at the time it is > extracted. The .xattr-list of each initramfs will be processed. Also, > the CPIO parser doesn't have to reopen the file after all other files > have been extracted. > > Roberto Right, I guess this would be sort of the minimal "modification" to the CPIO format to allow it to support xattrs. > > -- > HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 > Managing Director: Bo PENG, Jian LI, Yanli SHI