mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
kernel@openeuler.org

  • 32 participants
  • 25490 discussions
[PATCH OLK-6.6] iommufd: Rollback IOPF and refcount when iopf/sva enabling fails
by Zhang Yuwei 26 Nov '26

26 Nov '26
hulk inclusion category: bugfix bugzilla: https://gitcode.com/openeuler/kernel/issues/10441 ------------------ iommufd_fault_iopf_enable() has three problems on the failure paths, all introduced by commit 6b45626422f7 ("iommufd: enable SVA when IOPF enabled"): 1. When IOMMU_DEV_FEAT_SVA enabling fails, the function returns without unlocking idev->iopf_lock, leaving the mutex held forever and deadlocking any later enable()/disable(). 2. That same path returns without disabling the already-enabled IOMMU_DEV_FEAT_IOPF and without undoing the incremented idev->iopf_enabled. The leftover refcount makes the next enable() hit the "already enabled" shortcut and return success while SVA was never actually enabled, so the device is attached to a fault domain with SVA silently missing. 3. When IOMMU_DEV_FEAT_IOPF enabling fails, the error is not propagated: the code keeps going and enables SVA, overwriting the return value. If SVA happens to succeed, the function returns 0 although IOPF is off and the refcount is back to 0, and the later disable() path hits WARN_ON(iopf_enabled == 0). Fix all three by jumping to a common undo path when IOPF enabling fails, rolling back IOPF when SVA enabling fails, and dropping the refcount on any failure, so that a failed enable() leaves the device exactly as it was found, which is the contract its callers rely on. The unlock also converges back to a single exit, which also silences the unlock-missing.cocci warning. Fixes: 6b45626422f7 ("iommufd: enable SVA when IOPF enabled") Signed-off-by: Zhang Yuwei <zhangyuwei20(a)huawei.com> --- drivers/iommu/iommufd/fault.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c index 6ae29981fe38..66015cb5e4da 100644 --- a/drivers/iommu/iommufd/fault.c +++ b/drivers/iommu/iommufd/fault.c @@ -44,12 +44,15 @@ static int iommufd_fault_iopf_enable(struct iommufd_device *idev) ret = iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_IOPF); if (ret) - --idev->iopf_enabled; + goto out_undo; - ret = iommu_dev_enable_feature(idev->dev, IOMMU_DEV_FEAT_SVA); + ret = iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_SVA); if (ret) - return ret; + iommu_dev_disable_feature(dev, IOMMU_DEV_FEAT_IOPF); +out_undo: + if (ret) + --idev->iopf_enabled; mutex_unlock(&idev->iopf_lock); return ret; -- 2.22.0
2 1
0 0
[PATCH OLK-6.6] iommufd: Rollback IOPF and refcount when iopf/sva enabling fails
by Zhang Yuwei 26 Nov '26

26 Nov '26
Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitcode.com/openeuler/kernel/issues/10441 ------------------ iommufd_fault_iopf_enable() has three problems on the failure paths, all introduced by commit 6b45626422f7 ("iommufd: enable SVA when IOPF enabled"): 1. When IOMMU_DEV_FEAT_SVA enabling fails, the function returns without unlocking idev->iopf_lock, leaving the mutex held forever and deadlocking any later enable()/disable(). 2. That same path returns without disabling the already-enabled IOMMU_DEV_FEAT_IOPF and without undoing the incremented idev->iopf_enabled. The leftover refcount makes the next enable() hit the "already enabled" shortcut and return success while SVA was never actually enabled, so the device is attached to a fault domain with SVA silently missing. 3. When IOMMU_DEV_FEAT_IOPF enabling fails, the error is not propagated: the code keeps going and enables SVA, overwriting the return value. If SVA happens to succeed, the function returns 0 although IOPF is off and the refcount is back to 0, and the later disable() path hits WARN_ON(iopf_enabled == 0). Fix all three by jumping to a common undo path when IOPF enabling fails, rolling back IOPF when SVA enabling fails, and dropping the refcount on any failure, so that a failed enable() leaves the device exactly as it was found, which is the contract its callers rely on. The unlock also converges back to a single exit, which also silences the unlock-missing.cocci warning. Fixes: 6b45626422f7 ("iommufd: enable SVA when IOPF enabled") Signed-off-by: Zhang Yuwei <zhangyuwei20(a)huawei.com> --- drivers/iommu/iommufd/fault.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c index 6ae29981fe38..66015cb5e4da 100644 --- a/drivers/iommu/iommufd/fault.c +++ b/drivers/iommu/iommufd/fault.c @@ -44,12 +44,15 @@ static int iommufd_fault_iopf_enable(struct iommufd_device *idev) ret = iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_IOPF); if (ret) - --idev->iopf_enabled; + goto out_undo; - ret = iommu_dev_enable_feature(idev->dev, IOMMU_DEV_FEAT_SVA); + ret = iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_SVA); if (ret) - return ret; + iommu_dev_disable_feature(dev, IOMMU_DEV_FEAT_IOPF); +out_undo: + if (ret) + --idev->iopf_enabled; mutex_unlock(&idev->iopf_lock); return ret; -- 2.22.0
2 1
0 0
[PATCH OLK-6.6] mm: memcontrol: fix NULL pointer deref and UAF from high_work_func() on dying memcg
by Yi Yang 26 Nov '26

26 Nov '26
stable inclusion from stable-v6.6.163 commit 16062b71048d8ef85ca6a99d5ef26f0143d0e0c7 category: bugfix CVE: CVE-2026-99697 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit dd94d8c7660a60dbfcd425e0d10120de6d02a7bd ] When memory.high is exceeded in non-task context, try_charge_memcg() schedules memcg->high_work without taking a reference on the memcg, and high_work_func() invokes reclaim_high() without pinning the memcg. With obj_cgroup reparenting, introduced in commit bf4f059954dc ("mm: memcg/slab: obj_cgroup API"), objects charged to a child memcg are reparented to its parent in mem_cgroup_css_offline() instead of holding a reference on the child until uncharged. Subsequent uncharges of those objects go to the parent, which can leave the child's memory use permanently above its high limit, so any later charge on the offlined memcg in non-task context schedules high_work. This was later widened from kernel memory to LRU folios when commit f1cf8d2f36dc ("mm: memcontrol: eliminate the problem of dying memory cgroup for LRU folios") converted LRU folios to use obj_cgroup reparenting. cancel_work_sync(&memcg->high_work) only runs at the end of teardown in mem_cgroup_css_free(), so high_work_func() can start or still be running reclaim_high() after mem_cgroup_css_released() or shrink_many() has called lru_gen_release_memcg() and unhashed lruvec->lrugen.list. If reclaim tries to rotate the memcg, lru_gen_rotate_memcg() dereferences a NULL pprev pointer. This issue is specific to MGLRU and was introduced with the memcg LRU in commit e4dde56cd208 ("mm: multi-gen LRU: per-node lru_gen_folio lists"). With either traditional LRU or MGLRU, css_free_rwork_fn() calls css_rstat_exit() which frees per-CPU rstat data before calling mem_cgroup_css_free(). If reclaim_high() is still running, rstat updates via mod_lruvec_state() -> __css_rstat_updated() cause a use-after-free on the per-CPU rstat data. This was introduced when commit 5da3bfa029d6 ("cgroup: use separate rstat trees for each subsystem") moved css_rstat_exit() ahead of ss->css_free(). Fix both problems by acquiring a reference with css_tryget_online() in high_work_func() before calling reclaim_high(), and by resetting memory.high and swap.high to PAGE_COUNTER_MAX in mem_cgroup_css_offline() so that charges via references on an offlined memcg do not trigger high_work on the dead child and skip checking live ancestors in try_charge_memcg(). Acquiring the reference in high_work_func() rather than before scheduling high_work is safe because mem_cgroup_css_free() calls irq_work_sync() and cancel_work_sync() which cancels pending work and waits for an already running high_work_func() to complete before mem_cgroup_free() frees the memcg. css_tryget_online() uses percpu_ref_tryget_live() and is safe to call after percpu_ref_exit() before the cgroup is freed unlike css_tryget(). Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 1 UID: 0 PID: 27 Comm: kworker/1:0 Tainted: G B W 7.3.0-rc5-g2bba28e98578 #284 PREEMPT(full) Tainted: [B]=BAD_PAGE, [W]=WARN <-- Taint from lru_gen_rotate_memcg() VM_WARN_ON_ONCE Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-debian-1.17.0-1 04/01/2014 Workqueue: events high_work_func RIP: 0010:lru_gen_rotate_memcg+0x1a3/0xe90 Call Trace: <TASK> ? read_ctrl_pos+0x22f/0x3f0 shrink_lruvec+0x16cb/0x1b80 ? ret_from_fork_asm+0x1a/0x30 ? lapic_next_event+0x15/0x20 ? clockevents_program_event+0x2bb/0x6f0 ? lapic_next_event+0x15/0x20 ? __pfx_shrink_lruvec+0x10/0x10 ? __pfx_clockevents_program_event+0x10/0x10 ? _raw_spin_lock+0x84/0xe0 ? __pfx__raw_spin_lock+0x10/0x10 ? kasan_save_stack+0x30/0x50 ? psi_group_change+0x381/0x740 ? __pfx_sched_clock_cpu+0x10/0x10 ? save_fpregs_to_fpstate+0xc4/0x2c0 ? finish_task_switch.isra.0+0x1de/0xac0 ? __schedule+0xf62/0x42c0 ? __pfx___schedule+0x10/0x10 ? __pfx___irq_work_queue_local+0x10/0x10 ? shrink_node+0x626/0x31e0 shrink_node+0x626/0x31e0 ? ring_buffer_unlock_commit+0x11d/0x5c0 ? kswapd_clear_hopeless+0xa0/0x150 ? __pfx_shrink_node+0x10/0x10 ? 0xffffffffc0000095 do_try_to_free_pages+0x255/0x13b0 ? ring_buffer_unlock_commit+0x11d/0x5c0 ? reclaim_high+0x10a/0x1b0 try_to_free_mem_cgroup_pages+0x1f9/0x5a0 ? __pfx_try_to_free_mem_cgroup_pages+0x10/0x10 ? irqentry_exit+0xc6/0x670 reclaim_high+0x10a/0x1b0 ? __pfx_reclaim_high+0x10/0x10 ? process_one_work+0x5ff/0x1030 ? __pfx_high_work_func+0x10/0x10 process_one_work+0x6e2/0x1030 ? __pfx___schedule+0x10/0x10 ? __pfx_process_one_work+0x10/0x10 worker_thread+0x422/0xbb0 ? __pfx_worker_thread+0x10/0x10 kthread+0x2cd/0x3a0 ? recalc_sigpending+0x15c/0x200 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x368/0x590 ? __pfx_ret_from_fork+0x10/0x10 ? __switch_to+0x588/0xf50 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 </TASK> Link: https://lore.kernel.org/20261029201858.2932905-1-tjmercier@google.com Fixes: e4dde56cd208 ("mm: multi-gen LRU: per-node lru_gen_folio lists") Fixes: 5da3bfa029d6 ("cgroup: use separate rstat trees for each subsystem") Signed-off-by: T.J. Mercier <tjmercier(a)google.com> Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org> Reviewed-by: Johannes Weiner <hannes(a)cmpxchg.org> Acked-by: Muchun Song <muchun.song(a)linux.dev> Acked-by: Shakeel Butt <shakeel.butt(a)linux.dev> Acked-by: Michal Hocko <mhocko(a)suse.com> Cc: Michal Hocko <mhocko(a)kernel.org> Cc: Roman Gushchin <roman.gushchin(a)linux.dev> Cc: Qi Zheng <qi.zheng(a)linux.dev> Cc: JP Kobryn <jp.kobryn(a)linux.dev> Cc: <stable(a)vger.kernel.org> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Conflicts: mm/memcontrol.c [Context differences are due to the local CONFIG_MEMCG_QOS extension in high_work_func() (async_reclaim_high() path), which is not present upstream. css_tryget_online()/css_put() are placed around the whole if/else block so the QOS path is protected as well. ] Signed-off-by: Yi Yang <yiyang13(a)huawei.com> --- mm/memcontrol.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 27ec983a00c7..da4f011d205e 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2624,12 +2624,16 @@ static void high_work_func(struct work_struct *work) struct mem_cgroup *memcg = container_of(work, struct mem_cgroup, high_work); + if (!css_tryget_online(&memcg->css)) + return; + #ifdef CONFIG_MEMCG_QOS if (READ_ONCE(memcg->high_async_reclaim)) async_reclaim_high(memcg); else #endif reclaim_high(memcg, MEMCG_CHARGE_BATCH, GFP_KERNEL); + css_put(&memcg->css); } /* @@ -6940,6 +6944,8 @@ static void mem_cgroup_css_offline(struct cgroup_subsys_state *css) page_counter_set_min(&memcg->memory, 0); page_counter_set_low(&memcg->memory, 0); + page_counter_set_high(&memcg->memory, PAGE_COUNTER_MAX); + page_counter_set_high(&memcg->swap, PAGE_COUNTER_MAX); memcg_offline_kmem(memcg); reparent_shrinker_deferred(memcg); -- 2.25.1
2 1
0 0
[PATCH OLK-6.6] iommufd: Rollback IOPF and refcount when iopf/sva enabling fails
by Zhang Yuwei 26 Nov '26

26 Nov '26
Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitcode.com/openeuler/kernel/issues/10441 ------------------ iommufd_fault_iopf_enable() has two state-consistency problems on the failure paths, both introduced by commit 6b45626422f7 ("iommufd: enable SVA when IOPF enabled"): 1. When IOMMU_DEV_FEAT_SVA enabling fails, the function returns without disabling the already-enabled IOMMU_DEV_FEAT_IOPF and without undoing the incremented idev->iopf_enabled. The leftover refcount makes the next enable() hit the "already enabled" shortcut and return success while SVA was never actually enabled, so the device is attached to a fault domain with SVA silently missing. 2. When IOMMU_DEV_FEAT_IOPF enabling fails, the error is not propagated: the code keeps going and enables SVA, overwriting the return value. If SVA happens to succeed, the function returns 0 although IOPF is off and the refcount is back to 0, and the later disable() path hits WARN_ON(iopf_enabled == 0). Fix both by jumping to a common undo path when IOPF enabling fails, rolling back IOPF when SVA enabling fails, and dropping the refcount on any failure, so that a failed enable() leaves the device exactly as it was found, which is the contract its callers rely on. The unlock also converges back to a single exit, superseding the previous partial fix. Fixes: 6b45626422f7 ("iommufd: enable SVA when IOPF enabled") Signed-off-by: Zhang Yuwei <zhangyuwei20(a)huawei.com> --- drivers/iommu/iommufd/fault.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c index 5935c44c58e2..66015cb5e4da 100644 --- a/drivers/iommu/iommufd/fault.c +++ b/drivers/iommu/iommufd/fault.c @@ -44,14 +44,15 @@ static int iommufd_fault_iopf_enable(struct iommufd_device *idev) ret = iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_IOPF); if (ret) - --idev->iopf_enabled; + goto out_undo; - ret = iommu_dev_enable_feature(idev->dev, IOMMU_DEV_FEAT_SVA); - if (ret) { - mutex_unlock(&idev->iopf_lock); - return ret; - } + ret = iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_SVA); + if (ret) + iommu_dev_disable_feature(dev, IOMMU_DEV_FEAT_IOPF); +out_undo: + if (ret) + --idev->iopf_enabled; mutex_unlock(&idev->iopf_lock); return ret; -- 2.22.0
2 1
0 0
[PATCH OLK-6.6] iommufd: Rollback IOPF and refcount when iopf/sva enabling fails
by Zhang Yuwei 26 Nov '26

26 Nov '26
Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitcode.com/openeuler/kernel/issues/10441 ------------------ iommufd_fault_iopf_enable() has two state-consistency problems on the failure paths, both introduced by commit 6b45626422f7 ("iommufd: enable SVA when IOPF enabled"): 1. When IOMMU_DEV_FEAT_SVA enabling fails, the function returns without disabling the already-enabled IOMMU_DEV_FEAT_IOPF and without undoing the incremented idev->iopf_enabled. The leftover refcount makes the next enable() hit the "already enabled" shortcut and return success while SVA was never actually enabled, so the device is attached to a fault domain with SVA silently missing. 2. When IOMMU_DEV_FEAT_IOPF enabling fails, the error is not propagated: the code keeps going and enables SVA, overwriting the return value. If SVA happens to succeed, the function returns 0 although IOPF is off and the refcount is back to 0, and the later disable() path hits WARN_ON(iopf_enabled == 0). Fix both by jumping to a common undo path when IOPF enabling fails, rolling back IOPF when SVA enabling fails, and dropping the refcount on any failure, so that a failed enable() leaves the device exactly as it was found, which is the contract its callers rely on. The unlock also converges back to a single exit, superseding the previous partial fix. Fixes: 6b45626422f7 ("iommufd: enable SVA when IOPF enabled") Signed-off-by: Zhang Yuwei <zhangyuwei20(a)huawei.com> --- drivers/iommu/iommufd/fault.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c index 5935c44c58e2..66015cb5e4da 100644 --- a/drivers/iommu/iommufd/fault.c +++ b/drivers/iommu/iommufd/fault.c @@ -44,14 +44,15 @@ static int iommufd_fault_iopf_enable(struct iommufd_device *idev) ret = iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_IOPF); if (ret) - --idev->iopf_enabled; + goto out_undo; - ret = iommu_dev_enable_feature(idev->dev, IOMMU_DEV_FEAT_SVA); - if (ret) { - mutex_unlock(&idev->iopf_lock); - return ret; - } + ret = iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_SVA); + if (ret) + iommu_dev_disable_feature(dev, IOMMU_DEV_FEAT_IOPF); +out_undo: + if (ret) + --idev->iopf_enabled; mutex_unlock(&idev->iopf_lock); return ret; -- 2.22.0
2 1
0 0
[PATCH OLK-6.6] iommufd: Fix unlock-missing.cocci warning in iommufd_fault_iopf_enable
by Zhang Yuwei 26 Nov '26

26 Nov '26
From: Wang Wensheng <wangwensheng4(a)huawei.com> Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitcode.com/openeuler/kernel/issues/10441 ------------------ Add the missing mutex_unlock in iommufd_fault_iopf_enable() when iommu_dev_enable_feature() return unzero value. Fixes: 6b45626422f7 ("iommufd: enable SVA when IOPF enabled") Signed-off-by: Wang Wensheng <wangwensheng4(a)huawei.com> Signed-off-by: Zhang Yuwei <zhangyuwei20(a)huawei.com> --- drivers/iommu/iommufd/fault.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c index 6ae29981fe38..5935c44c58e2 100644 --- a/drivers/iommu/iommufd/fault.c +++ b/drivers/iommu/iommufd/fault.c @@ -47,8 +47,10 @@ static int iommufd_fault_iopf_enable(struct iommufd_device *idev) --idev->iopf_enabled; ret = iommu_dev_enable_feature(idev->dev, IOMMU_DEV_FEAT_SVA); - if (ret) + if (ret) { + mutex_unlock(&idev->iopf_lock); return ret; + } mutex_unlock(&idev->iopf_lock); -- 2.22.0
2 2
0 0
[PATCH OLK-6.6] mm/vma: don't leak the charge for stack growth
by Yi Yang 26 Nov '26

26 Nov '26
From: "David Hildenbrand (Arm)" <david(a)kernel.org> stable inclusion from stable-v6.6.163 commit bbe903084b7dfdce65c605f94dc298c7eaaa9d9f category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/21541 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit b1ee87802111156e27557e82acc31fa7dfc76e2a ] acct_stack_growth() charges stack expansion even without VM_ACCOUNT. This can happen for read-only or MAP_NORESERVE mappings created with MAP_GROWSDOWN. Unmapping these VMAs does not release the charge, leaking Committed_AS. Only check and charge growth for VM_ACCOUNT VMAs, matching mremap(). Unaccounted growth skips the overcommit check while remaining subject to the other stack-growth limits. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable(a)vger.kernel.org Reported-by: Josef Bacik <josef(a)toxicpanda.com> Reviewed-by: Lorenzo Stoakes (ARM) <ljs(a)kernel.org> Reviewed-by: Pedro Falcato <pfalcato(a)suse.de> Reviewed-by: Harry Yoo (Meta) <harry(a)kernel.org> Tested-by: Muhammad Usama Anjum <usama.anjum(a)arm.com> Link: https://patch.msgid.link/20261031-fixes_core-v3-44-d6437171ecc3@kernel.org Signed-off-by: David Hildenbrand (Arm) <david(a)kernel.org> [ sashal: Replaced vma_test(vma, VMA_ACCOUNT_BIT) with a direct vma->vm_flags & VM_ACCOUNT check. ] Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Yi Yang <yiyang13(a)huawei.com> --- mm/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index bb21bb960f27..777b61d3d644 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2084,7 +2084,8 @@ static int acct_stack_growth(struct vm_area_struct *vma, * Overcommit.. This must be the final test, as it will * update security statistics. */ - if (security_vm_enough_memory_mm(mm, grow)) + if ((vma->vm_flags & VM_ACCOUNT) && + security_vm_enough_memory_mm(mm, grow)) return -ENOMEM; return 0; -- 2.25.1
2 1
0 0
[PATCH OLK-6.6] iommufd: Fix unlock-missing.cocci warning in iommufd_fault_iopf_enable
by Zhang Yuwei 26 Nov '26

26 Nov '26
From: Wang Wensheng <wangwensheng4(a)huawei.com> Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitcode.com/openeuler/kernel/issues/10441 CVE: NA ------------------ Add the missing mutex_unlock in iommufd_fault_iopf_enable() when iommu_dev_enable_feature() return unzero value. Fixes: a0c4fb56541d ("[Backport] iommufd: enable SVA when IOPF enabled") Signed-off-by: Wang Wensheng <wangwensheng4(a)huawei.com> Signed-off-by: Zhang Yuwei <zhangyuwei20(a)huawei.com> --- drivers/iommu/iommufd/fault.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c index 6ae29981fe38..5935c44c58e2 100644 --- a/drivers/iommu/iommufd/fault.c +++ b/drivers/iommu/iommufd/fault.c @@ -47,8 +47,10 @@ static int iommufd_fault_iopf_enable(struct iommufd_device *idev) --idev->iopf_enabled; ret = iommu_dev_enable_feature(idev->dev, IOMMU_DEV_FEAT_SVA); - if (ret) + if (ret) { + mutex_unlock(&idev->iopf_lock); return ret; + } mutex_unlock(&idev->iopf_lock); -- 2.22.0
2 1
0 0
[PATCH OLK-6.6] iommufd: Fix unlock-missing.cocci warning in iommufd_fault_iopf_enable
by Zhang Yuwei 26 Nov '26

26 Nov '26
From: Wang Wensheng <wangwensheng4(a)huawei.com> Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitcode.com/src-openeuler/kernel/issues/21618 CVE: NA ------------------ Add the missing mutex_unlock in iommufd_fault_iopf_enable() when iommu_dev_enable_feature() return unzero value. Fixes: a0c4fb56541d ("[Backport] iommufd: enable SVA when IOPF enabled") Signed-off-by: Wang Wensheng <wangwensheng4(a)huawei.com> Signed-off-by: Zhang Yuwei <zhangyuwei20(a)huawei.com> --- drivers/iommu/iommufd/fault.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c index 6ae29981fe38..5935c44c58e2 100644 --- a/drivers/iommu/iommufd/fault.c +++ b/drivers/iommu/iommufd/fault.c @@ -47,8 +47,10 @@ static int iommufd_fault_iopf_enable(struct iommufd_device *idev) --idev->iopf_enabled; ret = iommu_dev_enable_feature(idev->dev, IOMMU_DEV_FEAT_SVA); - if (ret) + if (ret) { + mutex_unlock(&idev->iopf_lock); return ret; + } mutex_unlock(&idev->iopf_lock); -- 2.22.0
2 2
0 0
[PATCH openEuler-1.0-LTS] net: openvswitch: conntrack: fix helper UAF due to extensions realloc
by Yi Yang 26 Nov '26

26 Nov '26
From: Ilya Maximets <i.maximets(a)ovn.org> stable inclusion from stable-v5.10.273 commit f53d13a286fb275bda0efdf445b8a1e4dfcb717b category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/20692 CVE: CVE-2026-98490 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit 1a4151e6be57b098b7a5ebfbde58585e83200cdc ] While calling the helpers, a raw pointer to the extensions area is wired into expectations list: -> nf_ct_helper() -> helper->help() -> nf_ct_expect_related_report() -> nf_ct_expect_insert() -> hlist_add_head_rcu(&exp->lnode, &master_help->expectations) In case the connection is not confirmed yet, more extensions can be added afterwards with *_ext_add() calls reallocating the extension space and leaving the now invalid pointer in the expectations list that is later accessed while removing the expectation. Make sure that helpers are called at the end after all the other extensions are already added. Note that the helper rejection now leaves the mark and labels set, but that's not different from how the NAT was handled before or how the mark and the labels were handled on confirmation failure. And there are no atomicity guarantees provided by the API anyway. Fixes: cae3a2627520 ("openvswitch: Allow attaching helpers to ct action") Cc: stable(a)vger.kernel.org Reported-by: Axel Mierczuk <axel.mierczuk(a)1password.com> Signed-off-by: Ilya Maximets <i.maximets(a)ovn.org> Reviewed-by: Aaron Conole <aconole(a)redhat.com> Link: https://patch.msgid.link/20260921145655.3167436-4-i.maximets@ovn.org Signed-off-by: Jakub Kicinski <kuba(a)kernel.org> [ adapted nf_ct_helper() calls to the existing ovs_ct_helper() API. ] Signed-off-by: Sasha Levin <sashal(a)kernel.org> Conflicts: net/openvswitch/conntrack.c [Current version has no add_help variable,drop that condition and comment.] Signed-off-by: Yi Yang <yiyang13(a)huawei.com> --- net/openvswitch/conntrack.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index 5c11139d3c65..b2dded2a9928 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c @@ -1013,12 +1013,14 @@ static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, } } - /* Call the helper only if: - * - nf_conntrack_in() was executed above ("!cached") for a - * confirmed connection, or - * - When committing an unconfirmed connection. + /* Call the helper only if nf_conntrack_in() was executed + * above ("!cached"). + * + * For unconfirmed connections it will be called later during + * commit as we need to have all the other extensions allocated + * before the call. */ - if ((nf_ct_is_confirmed(ct) ? !cached : info->commit) && + if (nf_ct_is_confirmed(ct) && !cached && ovs_ct_helper(skb, info->family) != NF_ACCEPT) { return -EINVAL; } @@ -1222,6 +1224,12 @@ static int ovs_ct_commit(struct net *net, struct sw_flow_key *key, &info->labels.mask); if (err) return err; + + /* Call the helpers now. We couldn't do this before as + * all the extensions must be allocated before the call. + */ + if (ovs_ct_helper(skb, info->family) != NF_ACCEPT) + return -EINVAL; } else if (IS_ENABLED(CONFIG_NF_CONNTRACK_LABELS) && labels_nonzero(&info->labels.mask)) { err = ovs_ct_set_labels(ct, key, &info->labels.value, -- 2.25.1
2 1
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • ...
  • 2549
  • Older →

HyperKitty Powered by HyperKitty