summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc_background.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-04-16 07:14:41 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-04-16 07:14:41 -0400
commit42edda8db68f619aa9b08de10cdda6b752c2f901 (patch)
treeb811cbb5a89973b996f99b24f83d77bb0cf3ca03 /libbcachefs/alloc_background.c
parent807b250927d9c6e829ddd1ff7eac57bf9b056dab (diff)
Update bcachefs sources to 22ccceee15 bcachefs: Fix a slab-out-of-bounds
Diffstat (limited to 'libbcachefs/alloc_background.c')
-rw-r--r--libbcachefs/alloc_background.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbcachefs/alloc_background.c b/libbcachefs/alloc_background.c
index aef796b5..8ce2027d 100644
--- a/libbcachefs/alloc_background.c
+++ b/libbcachefs/alloc_background.c
@@ -479,7 +479,7 @@ __bch2_alloc_to_v4_mut(struct btree_trans *trans, struct bkey_s_c k)
{
struct bkey_i_alloc_v4 *ret;
- ret = bch2_trans_kmalloc(trans, sizeof(struct bkey_i_alloc_v4));
+ ret = bch2_trans_kmalloc(trans, max(bkey_bytes(k.k), sizeof(struct bkey_i_alloc_v4)));
if (IS_ERR(ret))
return ret;