Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: David Sterba <dsterba@suse.com>,
	Linux BTRFS Mailinglist <linux-btrfs@vger.kernel.org>,
	Chris Mason <clm@fb.com>, Richard Weinberger <richard@nod.at>,
	David Gstir <david@sigma-star.at>,
	Nikolay Borisov <nborisov@suse.com>
Subject: Re: [PATCH v4 00/13] Add support for other checksums
Date: Mon, 3 Jun 2019 20:30:22 +0200	[thread overview]
Message-ID: <20190603183022.GS15290@twin.jikos.cz> (raw)
In-Reply-To: <20190603145859.7176-1-jthumshirn@suse.de>

On Mon, Jun 03, 2019 at 04:58:46PM +0200, Johannes Thumshirn wrote:
> This patchset add support for adding new checksum types in BTRFS.

V4 looks good to me, with a few minor fixups added to topic branch,
including the sha256 patch.  As noted this may not be merged and now
servers for the testing purposes.

> Currently BTRFS only supports CRC32C as data and metadata checksum, which is
> good if you only want to detect errors due to data corruption in hardware.
> 
> But CRC32C isn't able cover other use-cases like de-duplication or
> cryptographically save data integrity guarantees.
> 
> The following properties made SHA-256 interesting for these use-cases:
> - Still considered cryptographically sound
> - Reasonably well understood by the security industry
> - Result fits into the 32Byte/256Bit we have for the checksum in the on-disk
>   format
> - Small enough collision space to make it feasible for data de-duplication
> - Fast enough to calculate and offloadable to crypto hardware via the kernel's
>   crypto_shash framework.

Regarding hw offload, David pointed out that the ahash API would need to
be used and that turned out to be infeasible with current btrfs code. I
think the only hw-based improvements left are based on CPU instructions
(crc32c, SSE, AVX) but that's sufficient.

I also think software implementations of the checksum(s) are going to be
used in most cases, which kind of makes SHA-3 less appealing to us as
it's main point was 'excellent efficiency in hardware implementations'
(quoting NIST announcement [1]).

As has been suggested, BLAKE2 is for consideration, we only need the
kernel module which I'll provide for testing purposes. And the more I
know about it, the more I like it so we might have a winner, but the
selection is still open.

> The patchset also provides mechanisms for plumbing in different hash
> algorithms relatively easy.
> 
> This is an intermediate submission, as a) mkfs.btrfs support is still missing
> and

We'll need that one, briefly checking the progs souces, the same
cleanups will be needed there too.

> b) David requested to have three hash algorithms, where 1 is crc32c, one
> cryptographically secure and one in between.

Let me summarize the current satus:

for strong hash we have SHA256 and BLAKE2. For the fast hash xxhash and
murmur3 have been suggested. Let me add XXH3 and xxh128 for now (they're
not finalized yet).

  parent reply	other threads:[~2019-06-03 18:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03 14:58 [PATCH v4 00/13] Add support for other checksums Johannes Thumshirn
2019-06-03 14:58 ` [PATCH v4 01/13] btrfs: use btrfs_csum_data() instead of directly calling crc32c Johannes Thumshirn
2019-06-03 14:58 ` [PATCH v4 02/13] btrfs: resurrect btrfs_crc32c() Johannes Thumshirn
2019-06-03 14:58 ` [PATCH v4 03/13] btrfs: use btrfs_crc32c{,_final}() in for free space cache Johannes Thumshirn
2019-06-03 14:58 ` [PATCH v4 04/13] btrfs: don't assume ordered sums to be 4 bytes Johannes Thumshirn
2019-06-03 14:58 ` [PATCH v4 05/13] btrfs: dont assume compressed_bio " Johannes Thumshirn
2019-06-03 14:58 ` [PATCH v4 06/13] btrfs: format checksums according to type for printing Johannes Thumshirn
2019-06-03 16:13   ` David Sterba
2019-06-03 14:58 ` [PATCH v4 07/13] btrfs: add common checksum type validation Johannes Thumshirn
2019-06-03 14:58 ` [PATCH v4 08/13] btrfs: check for supported superblock checksum type before checksum validation Johannes Thumshirn
2019-06-03 14:58 ` [PATCH v4 09/13] btrfs: Simplify btrfs_check_super_csum() and get rid of size assumptions Johannes Thumshirn
2019-06-03 14:58 ` [PATCH v4 10/13] btrfs: add boilerplate code for directly including the crypto framework Johannes Thumshirn
2019-06-03 16:42   ` David Sterba
2019-06-03 14:58 ` [PATCH v4 11/13] btrfs: directly call into crypto framework for checsumming Johannes Thumshirn
2019-06-03 16:50   ` David Sterba
2019-06-03 14:58 ` [PATCH v4 12/13] btrfs: remove assumption about csum type form btrfs_print_data_csum_error() Johannes Thumshirn
2019-06-03 14:58 ` [PATCH v4 13/13] btrfs: add sha256 as another checksum algorithm Johannes Thumshirn
2019-06-03 18:30 ` David Sterba [this message]
2019-06-03 19:27   ` [PATCH v4 00/13] Add support for other checksums John Dorminy
2019-06-04  7:37   ` Johannes Thumshirn
2019-06-04  9:15     ` David Sterba
2019-06-04  9:25     ` David Sterba
2019-06-03 19:56 ` waxhead
2019-06-04  7:41   ` Johannes Thumshirn
2019-06-04  9:30   ` 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=20190603183022.GS15290@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=clm@fb.com \
    --cc=david@sigma-star.at \
    --cc=dsterba@suse.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    --cc=richard@nod.at \
    /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