[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240403051031.GK2576@sol.localdomain>
Date: Tue, 2 Apr 2024 22:10:31 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Fan Wu <wufan@...ux.microsoft.com>
Cc: corbet@....net, zohar@...ux.ibm.com, jmorris@...ei.org,
serge@...lyn.com, tytso@....edu, axboe@...nel.dk, agk@...hat.com,
snitzer@...nel.org, eparis@...hat.com, paul@...l-moore.com,
linux-doc@...r.kernel.org, linux-integrity@...r.kernel.org,
linux-security-module@...r.kernel.org, fsverity@...ts.linux.dev,
linux-block@...r.kernel.org, dm-devel@...ts.linux.dev,
audit@...r.kernel.org, linux-kernel@...r.kernel.org,
Deven Bowers <deven.desai@...ux.microsoft.com>
Subject: Re: [PATCH v16 17/20] ipe: enable support for fs-verity as a trust
provider
On Thu, Mar 28, 2024 at 01:17:24PM -0700, Fan Wu wrote:
> Enable IPE policy authors to indicate trust for a singular fsverity
> file, identified by the digest information, through "fsverity_digest"
> and all files using fsverity's builtin signatures via
> "fsverity_signature".
Again, I'm pretty sure you actually care about all files with *valid* builtin
signatures, not simply all files with builtin signatures...
> +/**
> + * ipe_inode_setintegrity - save integrity data from a inode to IPE's LSM blob.
> + * @inode: The inode to source the security blob from.
> + * @type: Supplies the integrity type.
> + * @value: The value to be stored.
> + * @size: The size of @value.
> + *
> + * Saves fsverity signature into inode security blob
> + *
> + * Return:
> + * * 0 - OK
> + * * !0 - Error
> + */
> +int ipe_inode_setintegrity(struct inode *inode, enum lsm_integrity_type type,
> + const void *value, size_t size)
> +{
> + struct ipe_inode *inode_sec = ipe_inode(inode);
> +
> + if (type == LSM_INT_FSVERITY_BUILTINSIG) {
> + inode_sec->fs_verity_signed = size > 0 && value;
> + return 0;
> + }
> +
> + return 0;
This is the actual code, and it's *still* documented incorrectly. No, it
doesn't "Save fsverity signature into inode security blob". All it actually
does is save a flag saying that there was a valid signature.
The flag also should be called something like fsverity_sig_valid, indicating
that there is a builtin signature *and* it's valid.
- Eric
Powered by blists - more mailing lists