Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Johannes Thumshirn <jth@kernel.org>, David Sterba <dsterba@suse.cz>
Cc: linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org,
Eric Biggers <ebiggers@google.com>,
Richard Weinberger <richard@nod.at>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: Re: [PATCH v3 0/3] Add file-system authentication to BTRFS
Date: Wed, 27 May 2020 10:08:06 +0800 [thread overview]
Message-ID: <5663c6ca-87d4-8a98-3338-e9a077f4c82f@gmx.com> (raw)
In-Reply-To: <20200514092415.5389-1-jth@kernel.org>
[-- Attachment #1.1: Type: text/plain, Size: 4011 bytes --]
On 2020/5/14 下午5:24, Johannes Thumshirn wrote:
> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>
> This series adds file-system authentication to BTRFS.
>
> Unlike other verified file-system techniques like fs-verity the
> authenticated version of BTRFS does not need extra meta-data on disk.
>
> This works because in BTRFS every on-disk block has a checksum, for meta-data
> the checksum is in the header of each meta-data item. For data blocks, a
> separate checksum tree exists, which holds the checksums for each block.
>
> Currently BRTFS supports CRC32C, XXHASH64, SHA256 and Blake2b for checksumming
> these blocks. This series adds a new checksum algorithm, HMAC(SHA-256), which
> does need an authentication key. When no, or an incoreect authentication key
> is supplied no valid checksum can be generated and a read, fsck or scrub
> operation would detect invalid or tampered blocks once the file-system is
> mounted again with the correct key.
>
> Getting the key inside the kernel is out of scope of this implementation, the
> file-system driver assumes the key is already in the kernel's keyring at mount
> time.
>
> There was interest in also using keyed Blake2b from the community, but this
> support is not yet included.
>
> I have CCed Eric Biggers and Richard Weinberger in the submission, as they
> previously have worked on filesystem authentication and I hope we can get
> input from them as well.
>
> Example usage:
> Create a file-system with authentication key 0123456
> mkfs.btrfs --csum "hmac(sha256)" --auth-key 0123456 /dev/disk
>
> Add the key to the kernel's keyring as keyid 'btrfs:foo'
> keyctl add logon btrfs:foo 0123456 @u
>
> Mount the fs using the 'btrfs:foo' key
> mount -t btrfs -o auth_key=btrfs:foo,auth_hash_name="hmac(sha256)" /dev/disk /mnt/point
>
> Note, this is a re-base of the work I did when I was still at SUSE, hence the
> S-o-b being my SUSE address, while the Author being with my WDC address (to
> not generate bouncing mails).
>
> Changes since v2:
> - Select CONFIG_CRYPTO_HMAC and CONFIG_KEYS (kbuild robot)
> - Fix double free in error path
> - Fix memory leak in error path
> - Disallow nodatasum and nodatacow when authetication is use (Eric)
Since we're disabling NODATACOW usages, can we also disable the
following features?
- v1 space cache
V1 space cache uses NODATACOW file to store space cache, althouhg it
has inline csum, but it's fixed to crc32c. So attacker can easily
utilize this hole to mess space cache, and do some DoS attack.
- fallocate
I'm not 100% sure about this, but since nodatacow is already a second
class citizen in btrfs, maybe not supporting fallocate is not a
strange move.
Thanks,
Qu
> - Pass in authentication algorithm as mount option (Eric)
> - Don't use the work "replay" in the documentation, as it is wrong and
> harmful in this context (Eric)
> - Force key name to begin with 'btrfs:' (Eric)
> - Use '4' as on-disk checksum type for HMAC(SHA256) to not have holes in the
> checksum types array.
>
> Changes since v1:
> - None, only rebased the series
>
> Johannes Thumshirn (3):
> btrfs: rename btrfs_parse_device_options back to
> btrfs_parse_early_options
> btrfs: add authentication support
> btrfs: document btrfs authentication
>
> .../filesystems/btrfs-authentication.rst | 168 ++++++++++++++++++
> fs/btrfs/Kconfig | 2 +
> fs/btrfs/ctree.c | 22 ++-
> fs/btrfs/ctree.h | 5 +-
> fs/btrfs/disk-io.c | 71 +++++++-
> fs/btrfs/ioctl.c | 7 +-
> fs/btrfs/super.c | 65 ++++++-
> include/uapi/linux/btrfs_tree.h | 1 +
> 8 files changed, 326 insertions(+), 15 deletions(-)
> create mode 100644 Documentation/filesystems/btrfs-authentication.rst
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-05-27 2:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-14 9:24 Johannes Thumshirn
2020-05-14 9:24 ` [PATCH v3 1/3] btrfs: rename btrfs_parse_device_options back to btrfs_parse_early_options Johannes Thumshirn
2020-05-14 9:24 ` [PATCH v3 2/3] btrfs: add authentication support Johannes Thumshirn
2020-05-27 13:24 ` David Sterba
2020-05-27 13:54 ` Johannes Thumshirn
2020-05-27 14:01 ` Johannes Thumshirn
2020-05-27 18:04 ` Johannes Thumshirn
2020-06-01 14:30 ` David Sterba
2020-06-01 14:35 ` David Sterba
2020-05-14 9:24 ` [PATCH v3 3/3] btrfs: document btrfs authentication Johannes Thumshirn
2020-05-14 12:26 ` Jonathan Corbet
2020-05-14 14:54 ` Johannes Thumshirn
2020-05-14 15:14 ` Richard Weinberger
2020-05-14 16:00 ` Jonathan Corbet
2020-05-14 16:05 ` Richard Weinberger
2020-05-24 19:55 ` David Sterba
2020-05-25 10:57 ` Johannes Thumshirn
2020-05-25 11:26 ` David Sterba
2020-05-25 11:44 ` Johannes Thumshirn
2020-05-25 13:10 ` [PATCH v3 0/3] Add file-system authentication to BTRFS David Sterba
2020-05-26 7:50 ` Johannes Thumshirn
2020-05-26 11:53 ` David Sterba
2020-05-26 12:44 ` Johannes Thumshirn
2020-06-01 14:59 ` David Sterba
2020-05-27 2:08 ` Qu Wenruo [this message]
2020-05-27 11:27 ` David Sterba
2020-05-27 11:58 ` Qu Wenruo
2020-05-27 13:11 ` David Sterba
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=5663c6ca-87d4-8a98-3338-e9a077f4c82f@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=dsterba@suse.cz \
--cc=ebiggers@google.com \
--cc=johannes.thumshirn@wdc.com \
--cc=jth@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=richard@nod.at \
--subject='Re: [PATCH v3 0/3] Add file-system authentication to BTRFS' \
/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
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).