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 83A5DC636CD for ; Tue, 7 Feb 2023 08:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230204AbjBGIN0 (ORCPT ); Tue, 7 Feb 2023 03:13:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbjBGINX (ORCPT ); Tue, 7 Feb 2023 03:13:23 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 345E537B69 for ; Tue, 7 Feb 2023 00:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675757556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EpmSrtgFfbQ+TZ4qkvh9qoMoUozMirL90dqOtbhTOC8=; b=KKiCZ1wIwr/AfnbWosKbwEjRfCIKZxwIxW+bi/FV9TWkvF8OPwT0oyPVgyQWj2r3yA3FQX gwx9Wg5Y7EDYCw+X2kb1WTQkmsUpC1bHry/Zes2E/ZT9dxa1E+XU2K90iJYVVuzjfF/uOF J+MyJjXYT6KNNcJUxbh0t1+wn/LS188= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-126-t80qezvjMq6ccB2DxgKf6Q-1; Tue, 07 Feb 2023 03:12:34 -0500 X-MC-Unique: t80qezvjMq6ccB2DxgKf6Q-1 Received: by mail-il1-f198.google.com with SMTP id j25-20020a056e02219900b0031398da82efso7774806ila.21 for ; Tue, 07 Feb 2023 00:12:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EpmSrtgFfbQ+TZ4qkvh9qoMoUozMirL90dqOtbhTOC8=; b=xWlNXRVLRHzr/5KS4J+B5eH9fB+nB0xaH9JQRh2IEcY4Tfvhzyrr968P3G8AWBriLE UA9uBKH641fJIz3yhx5x6nD0TA+gbYsjWB3ZSI0FnJGd2Rq+Lrf/sWVN/HwKtDFvwCTr Zzxvz9LMHUGMNECq9Oll2SIEjcmUJnIyzHq/eLFY7ZohNloM3Dz88k5cbSSi30Osc0Rr yzjfjAeMxCtpfG63cphMiSR6z/PE7dKXNpfBmWu8yBLgjWf3Ct4Q0UXcEOcfN/R71ovF 49BTO9R27em4C8ECRHoQtHF6a7n++h8i50b96LIKY1sWM9prJELoyMff5yPKQiMHZMyg 0Kig== X-Gm-Message-State: AO0yUKWYzbRu9eL/EqFKhVeZtVrngGEnmPRbTqPdYQ2/5I+cHggCjfag YeqepTni9CHr8Iqaek9wi5wje3VNRYjUoZ08HgXwBCI+08eN4orWBTzWertw9PgOqq2YgLGOPeE 4NMHpQNFOlng95nCgrErdp291DrYU8vJ6XXIkiGdr X-Received: by 2002:a05:6638:e86:b0:3b0:2509:603 with SMTP id p6-20020a0566380e8600b003b025090603mr1821958jas.77.1675757553922; Tue, 07 Feb 2023 00:12:33 -0800 (PST) X-Google-Smtp-Source: AK7set8TRRXEr3GWBL30sB7Icjl6s/wrjdDAmQAflqIZcxc5vHOQr/NfFdiyMhNN1KfmIid3bojH15ljukDU7szJ/GA= X-Received: by 2002:a05:6638:e86:b0:3b0:2509:603 with SMTP id p6-20020a0566380e8600b003b025090603mr1821943jas.77.1675757553710; Tue, 07 Feb 2023 00:12:33 -0800 (PST) MIME-Version: 1.0 References: <5fb32a1297821040edd8c19ce796fc0540101653.camel@redhat.com> <2ef122849d6f35712b56ffbcc95805672980e185.camel@redhat.com> <8ffa28f5-77f6-6bde-5645-5fb799019bca@linux.alibaba.com> <51d9d1b3-2b2a-9b58-2f7f-f3a56c9e04ac@linux.alibaba.com> <071074ad149b189661681aada453995741f75039.camel@redhat.com> <0d2ef9d6-3b0e-364d-ec2f-c61b19d638e2@linux.alibaba.com> <9c8e76a3-a60a-90a2-f726-46db39bc6558@linux.alibaba.com> <02edb5d6-a232-eed6-0338-26f9a63cfdb6@linux.alibaba.com> <3d4b17795413a696b373553147935bf1560bb8c0.camel@redhat.com> <5fbca304-369d-aeb8-bc60-fdb333ca7a44@linux.alibaba.com> In-Reply-To: From: Alexander Larsson Date: Tue, 7 Feb 2023 09:12:21 +0100 Message-ID: Subject: Re: [PATCH v3 0/6] Composefs: an opportunistically sharing verified image filesystem To: Amir Goldstein Cc: Miklos Szeredi , gscrivan@redhat.com, brauner@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, david@fromorbit.com, viro@zeniv.linux.org.uk, Vivek Goyal , Josef Bacik , Gao Xiang , Jingbo Xu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 6, 2023 at 9:06 PM Amir Goldstein wrote: > > On Mon, Feb 6, 2023 at 9:32 PM Miklos Szeredi wrote: > > > > On Mon, 6 Feb 2023 at 18:16, Amir Goldstein wrote: > > > > > it's not overlay{erofs+erofs} > > > it's overlay{erofs+ext4} (or another fs-verity [1] supporting fs) > > > the lower layer is a mutable fs with /objects/ dir containing > > > the blobs. > > > > > > The way to ensure the integrity of erofs is to setup dm-verity at > > > erofs mount time. > > > > > > The way to ensure the integrity of the blobs is to store an fs-verity > > > signature of each blob file in trusted.overlay.verify xattr on the > > > metacopy and for overlayfs to enable fsverity on the blob file before > > > allowing access to the lowerdata. > > > > > > At least this is my understanding of the security model. > > > > So this should work out of the box, right? > > > > Mostly. IIUC, overlayfs just needs to verify the signature on > open to fulfill the chain of trust, see cfs_open_file(): > https://lore.kernel.org/linux-fsdevel/9b799ec7e403ba814e7bc097b1e8bd5f7662d596.1674227308.git.alexl@redhat.com/ Yeah, we need to add an "overlay.digest" xattr which if specified contains the expected fs-verity digest of the content file for the metacopy file. We also need to export fsverity_get_digest for module use: https://lore.kernel.org/linux-fsdevel/f5f292caee6b288d39112486ee1b2daef590c3ec.1674227308.git.alexl@redhat.com/ -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Alexander Larsson Red Hat, Inc alexl@redhat.com alexander.larsson@gmail.com