From 423ffe84b769a8ddeab7e8b157eb0bdf259d9a37 Mon Sep 17 00:00:00 2001 From: Gyeyoung Baek Date: Thu, 12 Jun 2025 21:48:27 +0900 Subject: [PATCH] genirq/irq_sim: Initialize work context pointers properly mainline inclusion from mainline-v6.16-rc3 commit 8a2277a3c9e4cc5398f80821afe7ecbe9bdf2819 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/ICOXCU CVE: CVE-2025-38408 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a2277a3c9e4cc5398f80821afe7ecbe9bdf2819 -------------------------------- Initialize `ops` member's pointers properly by using kzalloc() instead of kmalloc() when allocating the simulation work context. Otherwise the pointers contain random content leading to invalid dereferencing. Signed-off-by: Gyeyoung Baek Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250612124827.63259-1-gye976@gmail.com Signed-off-by: Yu Wu Conflicts: kernel/irq/irq_sim.c [affected function irq_domain_create_sim() is renamed to irq_domain_create_sim_full() in 6.12.37] --- kernel/irq/irq_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/irq/irq_sim.c b/kernel/irq/irq_sim.c index dd76323ea3fd..bde31468c19d 100644 --- a/kernel/irq/irq_sim.c +++ b/kernel/irq/irq_sim.c @@ -166,7 +166,7 @@ struct irq_domain *irq_domain_create_sim(struct fwnode_handle *fwnode, { struct irq_sim_work_ctx *work_ctx; - work_ctx = kmalloc(sizeof(*work_ctx), GFP_KERNEL); + work_ctx = kzalloc(sizeof(*work_ctx), GFP_KERNEL); if (!work_ctx) goto err_out; -- Gitee