Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2586308imw; Wed, 6 Jul 2022 08:24:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vxkJEvKjL4NMTahz+j7zEvB2VfSZxreYAf+xSa1YVbxoNENnL7qo7hQ9159R8ln1rM6udF X-Received: by 2002:a63:df15:0:b0:411:51f2:cc2a with SMTP id u21-20020a63df15000000b0041151f2cc2amr35194117pgg.533.1657121076353; Wed, 06 Jul 2022 08:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657121076; cv=none; d=google.com; s=arc-20160816; b=kp6jyLL7KBEB8SFYAWXdTo4vKpODfgAG017W6M6xeBBDPXp55h9O2nhEXsjFo5KSpm FBwa9xsFhMegFnBT/109JFonh5X062jeHJui7uOUBCvDxVH5TUQ7dS325wlYVkoQIiLq On4G17TIpjPB97frMsA7l90tJ5ojZW1+kqulXzPYA/GY1eMT3vJR1GMqg+U25M9Rl91Z mLqFHqgAs8Dd352SEGj3rAE45/Qvx1rL9AUMMV+w7zSQCcHTnf4DZnUaHeySQ3WKi0pN ZgIOr68+Gtm7oa1QlmcV3QF9+/BZlRQvjYtYdysS878nqUGd9BYPlnb8X7CyQ+9liDsm 0eGA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=u094c1pWAuc2qjFRYuYIiBLyQBzCT6qd8wf4uxXSTSI=; b=mposUk8PM4z0tl0WL5qbLqhSYTRpxWOAT73v+RIFQDtWoVnnu6EfGNRBZcxQnHqZpP kGriqbhTKhF7yGIky0yhPSTutEFZKG7BBywvfFDMFmBNv+c9tt3GLCGECsrwNnvHrPQH ku9a/KxAHG8wmmOksdCJyG1zhEGnWJKDI9clbHFbHykms+gYn5phwPeAgDYRFjLFX7wW PSZ0S0uAkKUGwuMeMETeztNrDEIpUpbz7l1ZstBhVt8qOUbBEjh9yYdOjAkIpWAs08Pk UfSYdyiqKD2j6QUoF8hnBHfFVC02qiyl8+vFp+M6d9+F4bRnXffEETdWP1WuYKpeJAQr 23yQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020a17090322cf00b0016a75602af4si6036778plg.597.2022.07.06.08.24.23; Wed, 06 Jul 2022 08:24:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232905AbiGFPME (ORCPT + 99 others); Wed, 6 Jul 2022 11:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232706AbiGFPMC (ORCPT ); Wed, 6 Jul 2022 11:12:02 -0400 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33D0813D4F for ; Wed, 6 Jul 2022 08:12:01 -0700 (PDT) Received: by mail-qt1-f180.google.com with SMTP id ck6so18599285qtb.7 for ; Wed, 06 Jul 2022 08:12:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=u094c1pWAuc2qjFRYuYIiBLyQBzCT6qd8wf4uxXSTSI=; b=ACSjlXyddhi5EaW5WOef3D1vif2MeOWYcJ2Qw7Jwge3SWdJVJHQDHgfBOHdwp7bB4r E1Vu8pzZckmBVeHJQTopmqxzOf+lZqIYUHIX4SW+1FeA/SL0Gzb+f8y2vKROOZ9MgXEc u93WULI24pobdOz5oktNiKp6GJesgLSK3Uai7nBewmpT+B/wI9Cnt2CEuDMLJD+0qcG2 DI4JPKVORLb5LSnuVec0cQBMZ0+jWGPiwLJDdix4kFVRPdqVWsVDPaq1n1zyc1qbAHLh j44w477LZW5QSIDaCutnMR4pC2C1msOe0VTk/s0vSf1/9SJbm0W+gMgfevBkt0hhioeS ebGw== X-Gm-Message-State: AJIora/YsGi3NJoWayyut+5XcoA5hEwPixMgdQP/Nxsav+fj6DWCqvGR eo8GRdA0ozQ3BOaIqfKkvF45 X-Received: by 2002:ac8:5985:0:b0:31d:3ea5:12f4 with SMTP id e5-20020ac85985000000b0031d3ea512f4mr18144555qte.274.1657120320113; Wed, 06 Jul 2022 08:12:00 -0700 (PDT) Received: from localhost (pool-68-160-176-52.bstnma.fios.verizon.net. [68.160.176.52]) by smtp.gmail.com with ESMTPSA id j4-20020a05620a410400b006a6278a2b31sm20037145qko.75.2022.07.06.08.11.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 08:11:59 -0700 (PDT) Date: Wed, 6 Jul 2022 11:11:58 -0400 From: Mike Snitzer To: Kees Cook Cc: Alasdair Kergon , Matthias Kaehlcke , James Morris , "Serge E . Hallyn" , linux-kernel@vger.kernel.org, dm-devel@redhat.com, Douglas Anderson , linux-raid@vger.kernel.org, Song Liu , linux-security-module@vger.kernel.org, Milan Broz Subject: Re: [PATCH v7 0/3] LoadPin: Enable loading from trusted dm-verity devices Message-ID: References: <20220627153526.3750341-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220627153526.3750341-1-mka@chromium.org> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, Jun 27 2022 at 11:35P -0400, Matthias Kaehlcke wrote: > As of now LoadPin restricts loading of kernel files to a single pinned > filesystem, typically the rootfs. This works for many systems, however it > can result in a bloated rootfs (and OTA updates) on platforms where > multiple boards with different hardware configurations use the same rootfs > image. Especially when 'optional' files are large it may be preferable to > download/install them only when they are actually needed by a given board. > Chrome OS uses Downloadable Content (DLC) [1] to deploy certain 'packages' > at runtime. As an example a DLC package could contain firmware for a > peripheral that is not present on all boards. DLCs use dm-verity [2] to > verify the integrity of the DLC content. > > This series extends LoadPin to allow loading of kernel files from trusted > dm-verity devices. LoadPin maintains a list of root digests of verity > devices it considers trusted. Userspace can populate this list through an > ioctl on the new LoadPin securityfs entry 'dm-verity'. The ioctl receives > a file descriptor of a file with verity digests as parameter. Verity reads > the digests from this file after confirming that the file is located on the > pinned root. The digest file must contain one digest per line. The list of > trusted digests can only be set up once, which is typically done at boot > time. > > When a kernel file is read LoadPin first checks (as usual) whether the file > is located on the pinned root, if so the file can be loaded. Otherwise, if > the verity extension is enabled, LoadPin determines whether the file is > located on a verity backed device and whether the root digest of that > device is in the list of trusted digests. The file can be loaded if the > verity device has a trusted root digest. > > [1] https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/dlcservice/docs/developer.md > [2] https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/verity.html Hi Kees, Please pick this series up, thanks. Mike