From c3a995ff0782587789333c621e1f6bd5e574371e Mon Sep 17 00:00:00 2001 From: Darong Lu Date: Mon, 28 Sep 2026 01:44:22 +0800 Subject: [PATCH] libceph: initialize CRUSH choose argument weights Initialize the CRUSH choose argument weight-set array before decoding so entries start in a defined state while the decoder fills them. Cc: stable@vger.kernel.org Fixes: 5cf9c4a9959b ("libceph, crush: per-pool crush_choose_arg_map for crush_do_rule()") Reported-by: Vega Assisted-by: LLM Signed-off-by: Darong Lu Signed-off-by: Ren Wei Reviewed-by: Alex Markuze Signed-off-by: Ilya Dryomov --- net/ceph/osdmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c index 7d65a8114816..e69a2249ddfb 100644 --- a/net/ceph/osdmap.c +++ b/net/ceph/osdmap.c @@ -319,7 +319,7 @@ static int decode_choose_arg(void **p, void *end, struct crush_choose_arg *arg) if (arg->weight_set_size) { u32 i; - arg->weight_set = kmalloc_objs(*arg->weight_set, + arg->weight_set = kzalloc_objs(*arg->weight_set, arg->weight_set_size, GFP_NOIO); if (!arg->weight_set) return -ENOMEM;