projects
/
platform
/
kernel
/
linux-amlogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f890c85
)
bcachefs: Add extra padding in bkey_make_mut_noupdate()
author
Kent Overstreet
<kent.overstreet@linux.dev>
Mon, 23 Sep 2024 21:30:59 +0000
(17:30 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sat, 28 Sep 2024 01:46:34 +0000
(21:46 -0400)
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>
fs/bcachefs/btree_update.h
patch
|
blob
|
history
diff --git
a/fs/bcachefs/btree_update.h
b/fs/bcachefs/btree_update.h
index 60393e98084d7952771e0d02ba9246183977e233..6a454f2fa00534082a8013a3c7db321cabcbf603 100644
(file)
--- a/
fs/bcachefs/btree_update.h
+++ b/
fs/bcachefs/btree_update.h
@@
-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);