From: Eric Biggers <ebiggers@kernel.org>
To: Luca Boccassi <bluca@debian.org>
Cc: fsverity@lists.linux.dev, linux-integrity@vger.kernel.org,
linux-doc@vger.kernel.org, Colin Walters <walters@verbum.org>,
Alexander Larsson <alexl@redhat.com>,
Victor Hsieh <victorhsieh@google.com>
Subject: Re: [PATCH v3] fsverity: improve documentation for builtin signature support
Date: Tue, 20 Jun 2023 22:50:41 -0700 [thread overview]
Message-ID: <20230621055041.GA1699@sol.localdomain> (raw)
In-Reply-To: <CAMw=ZnQg2dvdivEPdScMcgQQtj00T=EigpGn0ZRYHLMU=AKLMA@mail.gmail.com>
On Tue, Jun 20, 2023 at 08:15:42PM +0100, Luca Boccassi wrote:
> On Tue, 20 Jun 2023 at 05:23, Eric Biggers <ebiggers@kernel.org> wrote:
> >
> > From: Eric Biggers <ebiggers@google.com>
> >
> > fsverity builtin signatures (CONFIG_FS_VERITY_BUILTIN_SIGNATURES) aren't
> > the only way to do signatures with fsverity, and they have some major
> > limitations. Yet, more users have tried to use them, e.g. recently by
> > https://github.com/ostreedev/ostree/pull/2640. In most cases this seems
> > to be because users aren't sufficiently familiar with the limitations of
> > this feature and what the alternatives are.
> >
> > Therefore, make some updates to the documentation to try to clarify the
> > properties of this feature and nudge users in the right direction.
> >
> > Note that the Integrity Policy Enforcement (IPE) LSM, which is not yet
> > upstream, is planned to use the builtin signatures. (This differs from
> > IMA, which uses its own signature mechanism.) For that reason, my
> > earlier patch "fsverity: mark builtin signatures as deprecated"
> > (https://lore.kernel.org/r/20221208033548.122704-1-ebiggers@kernel.org),
> > which marked builtin signatures as "deprecated", was controversial.
> >
> > This patch therefore stops short of marking the feature as deprecated.
> > I've also revised the language to focus on better explaining the feature
> > and what its alternatives are.
> >
> > Signed-off-by: Eric Biggers <ebiggers@google.com>
> > ---
> >
> > v3: fixed ioctl name, and more updates to address Luca's comments
> > v2: updated two paragraphs of fsverity.rst to address Luca's comments
> >
> > Documentation/filesystems/fsverity.rst | 192 ++++++++++++++++---------
> > fs/verity/Kconfig | 16 +--
> > fs/verity/enable.c | 2 +-
> > fs/verity/open.c | 8 +-
> > fs/verity/read_metadata.c | 4 +-
> > fs/verity/signature.c | 8 ++
> > 6 files changed, 149 insertions(+), 81 deletions(-)
> <...>
> > +- fs-verity builtin signatures are in PKCS#7 format, and the public
> > + keys are in X.509 format. These formats are commonly used,
> > + including by some other kernel features (which is why the fs-verity
> > + builtin signatures use them), and are very feature rich.
> > + Unfortunately, history has shown that code that parses and handles
> > + these formats (which are from the 1990s and are based on ASN.1)
> > + often has vulnerabilities as a result of their complexity. This
> > + complexity is not inherent to the cryptography itself.
> > +
> > + fs-verity users who do not need advanced features of X.509 and
> > + PKCS#7 should strongly consider using simpler formats, such as plain
> > + Ed25519 keys and signatures, and verifying signatures in userspace.
> > +
> > + fs-verity users who choose to use X.509 and PKCS#7 anyway should
> > + still consider that verifying those signatures in userspace is more
> > + flexible (for other reasons mentioned earlier in this document) and
> > + eliminates the need to enable CONFIG_FS_VERITY_BUILTIN_SIGNATURES
> > + and its associated increase in kernel attack surface. In some cases
> > + it can even be necessary, since advanced X.509 and PKCS#7 features
> > + do not always work as intended with the kernel. For example, the
> > + kernel does not check X.509 certificate validity times.
> > +
> > + Note: IMA appraisal, which supports fs-verity, does not use PKCS#7
> > + for its signatures, so it partially avoids the issues discussed
> > + here. IMA appraisal does use X.509.
>
> Thank you for the update, I find this new version much better as it is
> clearly scoped for the specific case of fs-verity, hence:
>
> Reviewed-by: Luca Boccassi <bluca@debian.org>
Great, I'm glad we were finally able to arrive at a version that you're okay
with.
- Eric
prev parent reply other threads:[~2023-06-21 5:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 4:19 [PATCH v3] fsverity: improve documentation for builtin signature support Eric Biggers
2023-06-20 19:15 ` Luca Boccassi
2023-06-21 5:50 ` 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=20230621055041.GA1699@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=alexl@redhat.com \
--cc=bluca@debian.org \
--cc=fsverity@lists.linux.dev \
--cc=linux-doc@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=victorhsieh@google.com \
--cc=walters@verbum.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 NNTP newsgroup(s).