]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: cryptographic MACs on superblock are not (yet?) supported
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 28 Nov 2024 22:57:55 +0000 (17:57 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Dec 2024 06:36:20 +0000 (01:36 -0500)
We should add support for cryptographic macs on the superblock - and it
won't be hard, but it'll need an incompatible feature bit (and we have a
new incompatible feature versioning scheme coming).

For now, just add a guard to avoid a dull ptr deref in gen_poly_key().

Reported-by: syzbot+dd3d9835055dacb66f35@syzkaller.appspotmail.com
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/super-io.c

index 4c29f8215d54a235fd0faf0c8e3b5e8d12f82514..6a086c1c4b143c50f9f59e58e2dd302c9878436e 100644 (file)
@@ -677,7 +677,8 @@ reread:
        }
 
        enum bch_csum_type csum_type = BCH_SB_CSUM_TYPE(sb->sb);
-       if (csum_type >= BCH_CSUM_NR) {
+       if (csum_type >= BCH_CSUM_NR ||
+           bch2_csum_type_is_encryption(csum_type)) {
                prt_printf(err, "unknown checksum type %llu", BCH_SB_CSUM_TYPE(sb->sb));
                return -BCH_ERR_invalid_sb_csum_type;
        }