From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68E9BC433EF for ; Mon, 18 Apr 2022 22:14:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231332AbiDRWQ6 (ORCPT ); Mon, 18 Apr 2022 18:16:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231267AbiDRWQ5 (ORCPT ); Mon, 18 Apr 2022 18:16:57 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42EB927CE7 for ; Mon, 18 Apr 2022 15:14:16 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id b7so3798527plh.2 for ; Mon, 18 Apr 2022 15:14:16 -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=l9iX3O76iQ19mxLdkIRQWetqHCUUN6Yl8wyXvju+L58=; b=NKOJlVVw1gJhLASM4i9WIdrdYpP0RJ7udb9nNjDPBjFV9Hkyq8LHpDyLMYAcssOcbL 0uHls7TNNgwFLz/gtqaQluedACtFDmwdZFSDa7JarDlE0tEwsKcx5QxGyX9rKCLiWxHb 3KYOz6nsCtmjwv+CY46RN2KoQB0vIQOpmsfNs= 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=l9iX3O76iQ19mxLdkIRQWetqHCUUN6Yl8wyXvju+L58=; b=0EehhecreMkYQYI4R00KT0HgdeGcqZmxX3OBnxnBCR6yRpGPxZDuz7YCxr7YI8d09L BXlbTqguu0lgoZc5mNRi5r2Q4yUYYQlHV91GqZgB5+g1PMsSZfqvpsF7o9nQQyB6RlLJ PYYGOZ63zmSrcXrXrwD3hGyhYgSQ3iJuXeXRMuj/wHQSdrHJUI3JcUeiBoWUneN5ys6i sis2u16DWaRXwvoRUXp1ysxnT3vfWw0RXJUkzOfL7LGXb6h/CiPwczhe6b+zSatVHQu0 avFlX/tfKGCdqz4wQNcf39Ml1lOqdnTYtCEavSuKcDAiu0DYDZAlhSD3wuCGkafXWWGz kHzw== X-Gm-Message-State: AOAM531N5nuzxTdbnjbB1Bft71eIt9y61rRTmZAdOwbho5T+3mFz6tDX O3+x4YghHc2whjQMDWS7i5hWGQ== X-Google-Smtp-Source: ABdhPJxYWfaYuUfmsuYBP9tAVt7Q9FdYPOiskmz/BKG5SMVEEro5fUdapj1n24fWgg8kEKZu+KWh/g== X-Received: by 2002:a17:90b:3a90:b0:1d1:7733:a6a2 with SMTP id om16-20020a17090b3a9000b001d17733a6a2mr17042453pjb.79.1650320055731; Mon, 18 Apr 2022 15:14:15 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id b25-20020aa78719000000b0050a4b5cf892sm10676304pfo.60.2022.04.18.15.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 15:14:15 -0700 (PDT) Date: Mon, 18 Apr 2022 15:14:14 -0700 From: Kees Cook To: Matthias Kaehlcke Cc: Alasdair Kergon , Mike Snitzer , James Morris , "Serge E . Hallyn" , linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, Song Liu , linux-security-module@vger.kernel.org, Douglas Anderson , dm-devel@redhat.com Subject: Re: [PATCH 0/3] LoadPin: Enable loading from trusted dm-verity devices Message-ID: <202204181512.DA0C0C6EBD@keescook> References: <20220418211559.3832724-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220418211559.3832724-1-mka@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org [oops, resending to actual CC list] On Mon, Apr 18, 2022 at 02:15:56PM -0700, Matthias Kaehlcke wrote: > This series extends LoadPin to allow loading of kernel files > from trusted dm-verity devices. It adds the concept of > trusted verity devices to LoadPin. Userspace can use the > new systl file 'loadpin/trusted_verity_root_digests' to > provide LoadPin with a list of root digests from dm-verity > devices that LoadPin should consider as trusted. 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. > > The list of trusted root digests can only be written once > (typically at boot time), to limit the possiblity of > attackers setting up rogue verity devices and marking them > as trusted. Hi, Thanks for working all this out! Where does the list of trusted roothashes come from? I assume some chain of trust exists. Is the list maybe already stored on the rootfs? It'd be nice if there was some way to pass the trust chain to LoadPin more directly. -Kees -- Kees Cook