From: Dan Carpenter <dan.carpenter(a)linaro.org>
stable inclusion
from stable-v4.19.325
commit 3c7c806b3eafd94ae0f77305a174d63b69ec187c
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBEAEH
CVE: CVE-2024-53165
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit 63e72e551942642c48456a4134975136cdcb9b3c ]
In the error handling for this function, d is freed without ever
removing it from intc_list which would lead to a use after free.
To fix this, let's only add it to the list after everything has
succeeded.
Fixes: 2dcec7a988a1 ("sh: intc: set_irq_wake() support")
Signed-off-by: Dan Carpenter <dan.carpenter(a)linaro.org>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz(a)physik.fu-berlin.de>
Signed-off-by: John Paul Adrian Glaubitz <glaubitz(a)physik.fu-berlin.de>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Signed-off-by: Zhang Kunbo <zhangkunbo(a)huawei.com>
---
drivers/sh/intc/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
index 46f0f322d4d8..48fe5fab5693 100644
--- a/drivers/sh/intc/core.c
+++ b/drivers/sh/intc/core.c
@@ -194,7 +194,6 @@ int __init register_intc_controller(struct intc_desc *desc)
goto err0;
INIT_LIST_HEAD(&d->list);
- list_add_tail(&d->list, &intc_list);
raw_spin_lock_init(&d->lock);
INIT_RADIX_TREE(&d->tree, GFP_ATOMIC);
@@ -380,6 +379,7 @@ int __init register_intc_controller(struct intc_desc *desc)
d->skip_suspend = desc->skip_syscore_suspend;
+ list_add_tail(&d->list, &intc_list);
nr_intc_controllers++;
return 0;
--
2.34.1
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 55bf638d3d29c53ddd64ed89efda8b70b47ccbbc
commit: 5361bef36768820fb029e081a669749b8001769e [2616/2616] memcg: add restrict to swap to cgroup1
config: arm64-randconfig-r052-20250101 (https://download.01.org/0day-ci/archive/20250101/202501011625.6qilIzlu-lkp@…)
compiler: aarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250101/202501011625.6qilIzlu-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501011625.6qilIzlu-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> mm/memcontrol.c:4167:5: warning: no previous prototype for 'memcg_swapmax_read' [-Wmissing-prototypes]
4167 | u64 memcg_swapmax_read(struct cgroup_subsys_state *css, struct cftype *cft)
| ^~~~~~~~~~~~~~~~~~
vim +/memcg_swapmax_read +4167 mm/memcontrol.c
4166
> 4167 u64 memcg_swapmax_read(struct cgroup_subsys_state *css, struct cftype *cft)
4168 {
4169 struct mem_cgroup *memcg = mem_cgroup_from_css(css);
4170
4171 if (!static_branch_likely(&memcg_swap_qos_key))
4172 return PAGE_COUNTER_MAX * PAGE_SIZE;
4173
4174 return READ_ONCE(memcg->swap_dev->max) * PAGE_SIZE;
4175 }
4176
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
tree: https://gitee.com/openeuler/kernel.git OLK-6.6
head: 1e531b8351b843cd4a160764c0f67e4c9805234d
commit: cf98ffbc116bc49dc4506c68e20b02e26519ad35 [1682/1682] mm/dynamic_pool: fill dpool with pagelist
config: x86_64-randconfig-121-20250101 (https://download.01.org/0day-ci/archive/20250101/202501011500.zzJzjVne-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250101/202501011500.zzJzjVne-lkp@…)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp(a)intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501011500.zzJzjVne-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
mm/dynamic_pool.c:999:55: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct cgroup_subsys_state *css @@ got struct cgroup_subsys_state [noderef] __rcu * @@
mm/dynamic_pool.c:999:55: sparse: expected struct cgroup_subsys_state *css
mm/dynamic_pool.c:999:55: sparse: got struct cgroup_subsys_state [noderef] __rcu *
>> mm/dynamic_pool.c:1577:25: sparse: sparse: symbol 'pagelist_dpool_ops' was not declared. Should it be static?
vim +/pagelist_dpool_ops +1577 mm/dynamic_pool.c
1576
> 1577 struct dynamic_pool_ops pagelist_dpool_ops = {
1578 .fill_pool = dpool_fill_from_pagelist,
1579 .drain_pool = dpool_drain_to_pagelist,
1580 .restore_pool = dpool_migrate_used_pages,
1581 };
1582
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki