Linux-FSCrypt Archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Luca Boccassi <bluca@debian.org>
Cc: linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-btrfs@vger.kernel.org, linux-integrity@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] fsverity: don't check builtin signatures when require_signatures=0
Date: Fri, 16 Dec 2022 19:53:07 -0800	[thread overview]
Message-ID: <Y509I/WlKJWwRhM2@sol.localdomain> (raw)
In-Reply-To: <CAMw=ZnS5mXpQYtGHEK7-Q-VEojhooXiQVsGPT3e8NCW8uxnWyA@mail.gmail.com>

On Sat, Dec 17, 2022 at 02:06:04AM +0000, Luca Boccassi wrote:
> On Fri, 16 Dec 2022 at 21:06, Eric Biggers <ebiggers@kernel.org> wrote:
> >
> > On Thu, Dec 08, 2022 at 08:42:56PM +0000, Luca Boccassi wrote:
> > > On Thu, 8 Dec 2022 at 03:35, Eric Biggers <ebiggers@kernel.org> wrote:
> > > >
> > > > From: Eric Biggers <ebiggers@google.com>
> > > >
> > > > An issue that arises when migrating from builtin signatures to userspace
> > > > signatures is that existing files that have builtin signatures cannot be
> > > > opened unless either CONFIG_FS_VERITY_BUILTIN_SIGNATURES is disabled or
> > > > the signing certificate is left in the .fs-verity keyring.
> > > >
> > > > Since builtin signatures provide no security benefit when
> > > > fs.verity.require_signatures=0 anyway, let's just skip the signature
> > > > verification in this case.
> > > >
> > > > Fixes: 432434c9f8e1 ("fs-verity: support builtin file signatures")
> > > > Cc: <stable@vger.kernel.org> # v5.4+
> > > > Signed-off-by: Eric Biggers <ebiggers@google.com>
> > > > ---
> > > >  fs/verity/signature.c | 18 ++++++++++++++++--
> > > >  1 file changed, 16 insertions(+), 2 deletions(-)
> > >
> > > Acked-by: Luca Boccassi <bluca@debian.org>
> >
> > So if I can't apply
> > https://lore.kernel.org/linux-fscrypt/20221208033548.122704-1-ebiggers@kernel.org
> > ("fsverity: mark builtin signatures as deprecated") due to IPE, wouldn't I not
> > be able to apply this patch either?  Surely IPE isn't depending on
> > fs.verity.require_signatures=1, given that it enforces the policy itself?
> 
> I'm not sure what you mean? Skipping verification when this syscfg is
> disabled makes sense to me, as you noted it doesn't serve any purpose
> in that case.

Currently, fsverity builtin signatures are only useful if
fs.verity.require_signatures is set to 1 *and* userspace actually checks that
files have fsverity enabled.  However, IPE would change that if it actually gets
merged upstream, at least based on the version that was most recently sent out.
It would introduce a use of fsverity builtin signatures directly in the kernel
(https://lore.kernel.org/r/1654714889-26728-14-git-send-email-deven.desai@linux.microsoft.com
and
https://lore.kernel.org/r/1654714889-26728-15-git-send-email-deven.desai@linux.microsoft.com).

IIUC, the IPE patches add code that checks whether a file has a fsverity builtin
signature, and if so it assumes that it was verified by fs/verity/ and creates a
*boolean* file property "fsverity_signature" for IPE to operate on.

Since the IPE patches check for the presence of a builtin signature directly,
instead of indirectly by checking whether the inode has fsverity enabled at all,
there would be no need for the fs.verity.require_signatures setting with IPE.

The IPE patches do assume that the signature, if present, always gets verified
by fs/verity/.  That's what this patch would break.

Of course, for upstream I shouldn't care about breaking out-of-tree code.  So I
could apply this anyway.  But I'd at least like to be consistent.  If "fsverity:
mark builtin signatures as deprecated" isn't going to be applied because of IPE,
then I'd think this patch shouldn't be applied either, for the same reason...

- Eric

      reply	other threads:[~2022-12-17  3:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08  3:35 [PATCH] fsverity: don't check builtin signatures when require_signatures=0 Eric Biggers
2022-12-08 20:42 ` Luca Boccassi
2022-12-16 21:06   ` Eric Biggers
2022-12-17  2:06     ` Luca Boccassi
2022-12-17  3:53       ` Eric Biggers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y509I/WlKJWwRhM2@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=bluca@debian.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).