Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3260863imw; Wed, 6 Jul 2022 21:17:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ul3FidpReoggiS2IcUW4FlMuPIuYxJl6fPuYW4Ol2XFHefb0OZjdduJm8kcdWvM70tTFMk X-Received: by 2002:a05:6402:1d4b:b0:435:cac5:1957 with SMTP id dz11-20020a0564021d4b00b00435cac51957mr59116637edb.109.1657167465987; Wed, 06 Jul 2022 21:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657167465; cv=none; d=google.com; s=arc-20160816; b=Ks74V/PXCZ/APC8zo/njNG8kEDgPeD9rUh7XWc5ez5RFnOv7vK9xNYxIv1MgUWwLHE 7XkeqNZhunLPsiutaAMG7efDmMmb2DUzWnhAnP9KwB/opK6iQdv0j7uG/ym1wdnoik+j MdC5pV+1oMi4DyYXTBcrTP+/zum7sHpBZUhuYHWZ4MJ0olSrph4Q9/ytcOuU2P5OSDhw LkU0W10LIYIwVGadsLK0l0r3RI7hgagPFw5obvxlCqg08H/C4S2qfQIdXXlEDKAPoXmA Uv8kmuW/JcGeFzO9KbbPtzMgKA1PLmmcox8cp1MMS3D20oig3MIK0GPYQ6Yq+nwg8sI/ ICQg== 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:dkim-signature; bh=JxCvx3Wm6aJVrrCk9KxbfLNMLkjb2WQRHJLc9xDV7wo=; b=UNB00r+g0Ok2Y9xenmsAwEqNkWt+0hJkf2bP7GJSZy4X/ioUlYVLE7J5KoRDxrUxf1 hRHrKnsRm+/9XlQkm0y9PcVXWaWDsECW21VjkjizC9gRaBhvEfY3AmNvdwOdrHzb1mt0 w1Uer9rp4aU4Ner5gw6ov28Ei8xQnTvpuMuxh7lZDuIluWlC7m+iSdO9xwJEg51gKF5W Se7dGJm8/859L62rk2Gf7IfiV0FCA8B24g0ooRpI6Mco1HSUHAgRixOATwd9Zhc3+Rsm mnKKKqRYDo510B2POQH9ICuvtYRrf0qnHxto9p2eYHksiLM0aPc1pwutbe19PDktTaZ+ nPgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=H9LFGZCS; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc15-20020a170907168f00b007269fca8123si32114797ejc.777.2022.07.06.21.17.20; Wed, 06 Jul 2022 21:17:45 -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; dkim=pass header.i=@chromium.org header.s=google header.b=H9LFGZCS; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234948AbiGGD6f (ORCPT + 99 others); Wed, 6 Jul 2022 23:58:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbiGGD61 (ORCPT ); Wed, 6 Jul 2022 23:58:27 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ACB22A26F for ; Wed, 6 Jul 2022 20:58:21 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d10so3078790pfd.9 for ; Wed, 06 Jul 2022 20:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JxCvx3Wm6aJVrrCk9KxbfLNMLkjb2WQRHJLc9xDV7wo=; b=H9LFGZCSA2LuADklmnd2mY5ca/5IZfgA7lt/vP+GxQPOHG6Eoc+SRSUtdiWbeV5G2c mzi6WcAlyXYhcPcnOFtTB3YtuLHUPEUVox+cOrEbaZNGt/ddTlFPO1AmzHsD1GPDHa2k pV3Jh0ZoXFNYKlRvCTjk1l4nTQfHqGNtLLuAA= 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=JxCvx3Wm6aJVrrCk9KxbfLNMLkjb2WQRHJLc9xDV7wo=; b=BvNeSbO+XvCrAWtMrNdZH0PdGVRUkNfaA0fdXedrqIBjtf/4urDya4CDsFOTzFf7/k IZ+L8gfmSG+YNpAsxEyQHvNqJ4tLLYxdFxNmj61AU3nbJiBPo5ggXAAhnNN7SCwAA886 qT4y9NWohGzri6ELCYuHeoe1UHeYeVTUbuJRj40D765xsICLefkePea1w7rPTmJOHkaf ZPCL2lR6htGoXwawxzTck7XcNDNWVyrqpTTHjWTsHNgfrLj23/HkR8Am/8FrihfEOYKf uqnlVO+gQ/sTTp7LUW1tkHEA32mNUPPWqX6v2N5YWweVnNJM18s0BuXcEggiKNA3dUtn 78Zw== X-Gm-Message-State: AJIora+3VrKQtzlG8/1TQN9g0IIv5fX3g9gYwtU/C0ZT1M+DSQ/SFwBD 9pjED9wL3o10Df0bSaLHzXxzgw== X-Received: by 2002:a17:903:1c7:b0:16a:2844:8c1f with SMTP id e7-20020a17090301c700b0016a28448c1fmr51071550plh.30.1657166300753; Wed, 06 Jul 2022 20:58:20 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c10-20020a170903234a00b0016b9b6d67a2sm17284819plh.155.2022.07.06.20.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 20:58:20 -0700 (PDT) Date: Wed, 6 Jul 2022 20:58:19 -0700 From: Kees Cook To: Mike Snitzer 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: <202207062058.49046961A4@keescook> References: <20220627153526.3750341-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Wed, Jul 06, 2022 at 11:11:58AM -0400, Mike Snitzer wrote: > 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. Thanks for the Acks! I'll get this into -next shortly. -- Kees Cook