mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 16:12:02 +00:00
bcachefs: Add extra padding in bkey_make_mut_noupdate()
This fixes a kasan splat in propagate_key_to_snapshot_leaves() - varint_decode_fast() does reads (that it never uses) up to 7 bytes past the end of the integer. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
f890c8513f
commit
4a8f8fafbd
@ -220,7 +220,8 @@ static inline struct bkey_i *__bch2_bkey_make_mut_noupdate(struct btree_trans *t
|
||||
if (type && k.k->type != type)
|
||||
return ERR_PTR(-ENOENT);
|
||||
|
||||
mut = bch2_trans_kmalloc_nomemzero(trans, bytes);
|
||||
/* extra padding for varint_decode_fast... */
|
||||
mut = bch2_trans_kmalloc_nomemzero(trans, bytes + 8);
|
||||
if (!IS_ERR(mut)) {
|
||||
bkey_reassemble(mut, k);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user