mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
bcachefs: Check for key size > offset
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
91052b9de8
commit
e812cf38c5
@ -90,6 +90,9 @@ const char *__bch2_bkey_invalid(struct bch_fs *c, struct bkey_s_c k,
|
||||
if (btree_node_type_is_extents(type)) {
|
||||
if ((k.k->size == 0) != bkey_deleted(k.k))
|
||||
return "bad size field";
|
||||
|
||||
if (k.k->size > k.k->p.offset)
|
||||
return "size greater than offset";
|
||||
} else {
|
||||
if (k.k->size)
|
||||
return "nonzero size field";
|
||||
|
Loading…
x
Reference in New Issue
Block a user