linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Burkov <boris@bur.io>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com,
	Eric Biggers <ebiggers@kernel.org>
Subject: [PATCH 0/5] btrfs: support fsverity
Date: Thu,  4 Feb 2021 15:21:36 -0800	[thread overview]
Message-ID: <cover.1612475783.git.boris@bur.io> (raw)

This patchset provides support for fsverity in btrfs.

At a high level, we store the verity descriptor and Merkle tree data
in the file system btree with the file's inode as the objectid, and
direct reads/writes to those items to implement the generic fsverity
interface required by fs/verity/.

The first patch is a preparatory patch which adds a notion of
compat_flags to the btrfs_inode and inode_item in order to allow
enabling verity on a file without making the file system unmountable for
older kernels. (It runs afoul of the leaf corruption check otherwise)

The second patch is the bulk of the fsverity implementation. It
implements the fsverity interface and adds verity checks for the typical
file reading case.

The third patch cleans up the corner cases in readpage, covering inline
extents, preallocated extents, and holes.

The fourth patch handles direct io of a veritied file by falling back to
buffered io.

The fifth patch adds a feature file in sysfs for verity.

Boris Burkov (4):
  btrfs: add compat_flags to btrfs_inode_item
  btrfs: check verity for reads of inline extents and holes
  btrfs: fallback to buffered io for verity files
  btrfs: add sysfs feature for fsverity

Chris Mason (1):
  btrfs: initial fsverity support

 fs/btrfs/Makefile               |   1 +
 fs/btrfs/btrfs_inode.h          |   2 +
 fs/btrfs/ctree.h                |  14 +-
 fs/btrfs/delayed-inode.c        |   2 +
 fs/btrfs/extent_io.c            |  29 +-
 fs/btrfs/file.c                 |   9 +
 fs/btrfs/inode.c                |  31 +-
 fs/btrfs/ioctl.c                |  21 +-
 fs/btrfs/super.c                |   1 +
 fs/btrfs/sysfs.c                |   6 +
 fs/btrfs/tree-log.c             |   1 +
 fs/btrfs/verity.c               | 527 ++++++++++++++++++++++++++++++++
 include/uapi/linux/btrfs.h      |   1 +
 include/uapi/linux/btrfs_tree.h |  15 +-
 14 files changed, 625 insertions(+), 35 deletions(-)
 create mode 100644 fs/btrfs/verity.c

-- 
2.24.1


             reply	other threads:[~2021-02-04 23:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 23:21 Boris Burkov [this message]
2021-02-04 23:21 ` [PATCH 1/5] btrfs: add compat_flags to btrfs_inode_item Boris Burkov
2021-02-04 23:21 ` [PATCH 2/5] btrfs: initial fsverity support Boris Burkov
2021-02-05  3:07   ` kernel test robot
2021-02-05  3:21   ` kernel test robot
2021-02-05  5:37   ` kernel test robot
2021-02-05  6:39   ` Eric Biggers
2021-02-05 18:14     ` Chris Mason
2021-02-05  8:06   ` Nikolay Borisov
2021-02-05 15:50     ` Chris Mason
2021-02-09 17:57     ` Boris Burkov
2021-02-04 23:21 ` [PATCH 3/5] btrfs: check verity for reads of inline extents and holes Boris Burkov
2021-02-04 23:21 ` [PATCH 4/5] btrfs: fallback to buffered io for verity files Boris Burkov
2021-02-04 23:21 ` [PATCH 5/5] btrfs: add sysfs feature for fsverity Boris Burkov
2021-02-05  6:13 ` [PATCH 0/5] btrfs: support fsverity Eric Biggers
2021-02-05  6:58   ` Boris Burkov
2021-02-05 16:06     ` Chris Mason
2021-02-12  1:19     ` Zygo Blaxell
2021-02-12 17:43       ` Boris Burkov

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=cover.1612475783.git.boris@bur.io \
    --to=boris@bur.io \
    --cc=ebiggers@kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@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 NNTP newsgroup(s).