bcachefs: Correctly validate k->u64s in btree node read path
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 8 Mar 2024 19:53:03 +0000 (14:53 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 10 Mar 2024 19:21:04 +0000 (15:21 -0400)
commit94817db95681155437100d9f25b3e1390fff8ad6
tree82d95c33b56716444180b897232d3f0932f4523b
parentb3eba6a4a7e3e148abfde7a30daa855839fcc043
bcachefs: Correctly validate k->u64s in btree node read path

validate_bset_keys() never properly validated k->u64s; it checked if it
was 0, but not if it was smaller than keys for the given packed format;
this fixes that small oversight.

This patch was backported, so it's adding quite a few error enums so
that they don't get renumbered and we don't have confusing gaps.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bkey.h
fs/bcachefs/btree_io.c
fs/bcachefs/sb-errors_types.h