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
  • ----- 2025 -----
  • 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

  • 43 participants
  • 18209 discussions
[PATCH OLK-6.6] arm64: entry: Fix some warnings when enable nohz full CPU
by Jinjie Ruan 29 Nov '24

29 Nov '24
From: Yipeng Zou <zouyipeng(a)huawei.com> hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/release-management/issues/IB6JLE -------------------------------- Fix following warnings when enable nohz full CPU, by not skipping context tracking and irq tick idle inform. Also remove el1 xint, as less savings for both assembly and C. ct_state() == CONTEXT_USER WARNING: CPU: 66 PID: 10214 at kernel/sched/core.c:6012 __schedule+0x738/0xcf8 CPU: 66 PID: 10214 Comm: sh Kdump: loaded Not tainted 6.6.0xcall_xint_lcxint6.6_test+ #26 Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V5.B221.01 04/29/2022 pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __schedule+0x738/0xcf8 lr : __schedule+0x738/0xcf8 sp : ffff8000d193bd90 pmr_save: 00000060 x29: ffff8000d193bd90 x28: ffff20203e95d100 x27: ffff20203e95d100 x26: 0000000000000000 x25: ffff800080e3fbb8 x24: ffff800081a2a008 x23: ffff800081e15370 x22: 0000000000000000 x21: ffff800081a40d80 x20: ffff20203e95d100 x19: ffff2027dfa1ad80 x18: 0000000000000000 x17: ffffa0275dfda000 x16: ffff800083008000 x15: 0000000000000000 x14: 0000000000000000 x13: 524553555f545845 x12: 544e4f43203d3d20 x11: 00000000ffff7fff x10: ffff80008210b368 x9 : ffff800080157fa8 x8 : 00000000000bffe8 x7 : c0000000ffff7fff x6 : 00000000002bffa8 x5 : ffff2027dfa07ac8 x4 : ffff8000d193bbf0 x3 : ffffa0275dfda000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff20203e95d100 Call trace: __schedule+0x738/0xcf8 schedule+0x58/0xf0 do_notify_resume+0x50/0x350 el0_xint.constprop.0+0xa0/0xe0 el0t_64_xint_handler+0x18/0x28 el0t_64_irq+0x170/0x3a0 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ WARNING: CPU: 66 PID: 0 at kernel/context_tracking.c:128 ct_kernel_exit.constprop.0+0xa0/0xa8 CPU: 66 PID: 0 Comm: swapper/66 Kdump: loaded Tainted: G W 6.6.0xcall_xint_lcxint6.6_test+ #26 Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V5.B221.01 04/29/2022 pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : ct_kernel_exit.constprop.0+0xa0/0xa8 lr : ct_idle_enter+0x14/0x20 sp : ffff8000839abdb0 pmr_save: 00000060 x29: ffff8000839abdb0 x28: 0000000000000000 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 x23: 0000000000000000 x22: ffff2020001f6540 x21: ffff2020001f6540 x20: 0000000000000005 x19: ffff2027dfa16760 x18: 0000000000000000 x17: ffffa0275dfda000 x16: ffff800083008000 x15: 0000000000000000 x14: 0000000000000000 x13: 524553555f545845 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000f90 x9 : ffff8000801bb9b8 x8 : ffff2020001f7530 x7 : 00000000ffff9d08 x6 : 0000000748890425 x5 : 0000000000000000 x4 : ffffa0275dfda000 x3 : ffff8000839abdb0 x2 : ffff800081a3c760 x1 : ffff800081a3c760 x0 : 4000000000000000 Call trace: ct_kernel_exit.constprop.0+0xa0/0xa8 ct_idle_enter+0x14/0x20 default_idle_call+0x38/0x120 cpuidle_idle_call+0x164/0x1a8 do_idle+0xac/0x118 cpu_startup_entry+0x3c/0x50 secondary_start_kernel+0x14c/0x1e8 __secondary_switched+0xb8/0xc0 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ WARNING: CPU: 0 PID: 10214 at arch/arm64/kernel/entry-common.c:105 el0_da+0x98/0x1a8 CPU: 0 PID: 10214 Comm: sh Kdump: loaded Tainted: G W 6.6.0xcall_xint_lcxint6.6_test+ #26 Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V5.B221.01 04/29/2022 pstate: 804003c9 (Nzcv DAIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : el0_da+0x98/0x1a8 lr : el0t_64_sync_handler+0xb8/0x130 sp : ffff8000d193be70 pmr_save: 000000f0 x29: ffff8000d193be70 x28: ffff20203e95d100 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 x23: 0000000060000000 x22: 0000ffffbb7a9028 x21: 0000aaaafa8a1c18 x20: 000000009200004f x19: ffff8000d193beb0 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 0000000000000000 x4 : ffff8000d193beb0 x3 : 0000000000000000 x2 : ffff800080e36fac x1 : ffff80275df96000 x0 : 0000000000000000 Call trace: el0_da+0x98/0x1a8 el0t_64_sync_handler+0xb8/0x130 el0t_64_sync+0x3b8/0x3c0 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ WARNING: CPU: 0 PID: 15840 at arch/arm64/kernel/entry-common.c:105 el0_ia+0xc0/0x200 CPU: 0 PID: 15840 Comm: sh Kdump: loaded Tainted: G W 6.6.0xcall_xint_lcxint6.6_test+ #26 Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V5.B221.01 04/29/2022 pstate: 804003c9 (Nzcv DAIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : el0_ia+0xc0/0x200 lr : el0t_64_sync_handler+0xd0/0x130 sp : ffff8000dc90be70 pmr_save: 000000f0 x29: ffff8000dc90be70 x28: ffff20204f112880 x27: 0000000000000000 x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000 x23: 0000000020000000 x22: 0000ffffbb801080 x21: 0000ffffbb801080 x20: 0000000082000007 x19: ffff8000dc90beb0 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 0000000000000000 x4 : ffff8000dc90beb0 x3 : 0000000000000000 x2 : 0000000000000000 x1 : ffff80275df96000 x0 : 0000000000000000 Call trace: el0_ia+0xc0/0x200 el0t_64_sync_handler+0xd0/0x130 el0t_64_sync+0x3b8/0x3c0 ---[ end trace 0000000000000000 ]--- Fixes: cf5f2d9ff017 ("arm64: Faster SVC exception handler with xcall") Fixes: 3053668e6b21 ("arm64: Introduce Xint software solution") Signed-off-by: Yipeng Zou <zouyipeng(a)huawei.com> Signed-off-by: Jinjie Ruan <ruanjinjie(a)huawei.com> --- arch/Kconfig | 1 + arch/arm64/kernel/entry-common.c | 161 ++++++++++++------------------- arch/arm64/kernel/entry.S | 18 ++-- kernel/softirq.c | 4 +- 4 files changed, 70 insertions(+), 114 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 98116fbfcff6..a9d7c5099b96 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1573,6 +1573,7 @@ config FAST_IRQ config DEBUG_FEATURE_BYPASS bool "Bypass debug feature in fast syscall" depends on FAST_SYSCALL || FAST_IRQ + depends on !LOCKDEP default y help This to bypass debug feature in fast syscall. diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c index 60300e133d5f..4602c107c40a 100644 --- a/arch/arm64/kernel/entry-common.c +++ b/arch/arm64/kernel/entry-common.c @@ -151,6 +151,62 @@ asmlinkage void noinstr asm_exit_to_user_mode(struct pt_regs *regs) exit_to_user_mode(regs); } +#if defined(CONFIG_FAST_SYSCALL) || defined(CONFIG_FAST_IRQ) +/* + * Copy from exit_to_user_mode_prepare + */ +static __always_inline void fast_exit_to_user_mode_prepare(struct pt_regs *regs) +{ + unsigned long flags; + + local_daif_mask(); + + flags = read_thread_flags(); + if (unlikely(flags & _TIF_WORK_MASK)) + do_notify_resume(regs, flags); + +#ifndef CONFIG_DEBUG_FEATURE_BYPASS + lockdep_sys_exit(); +#endif +} + +/* Copy from __exit_to_user_mode */ +static __always_inline void __fast_exit_to_user_mode(void) +{ +#ifndef CONFIG_DEBUG_FEATURE_BYPASS + trace_hardirqs_on_prepare(); + lockdep_hardirqs_on_prepare(); +#endif + user_enter_irqoff(); +#ifndef CONFIG_DEBUG_FEATURE_BYPASS + lockdep_hardirqs_on(CALLER_ADDR0); +#endif +} + +static __always_inline void fast_exit_to_user_mode(struct pt_regs *regs) +{ + fast_exit_to_user_mode_prepare(regs); +#ifndef CONFIG_DEBUG_FEATURE_BYPASS + mte_check_tfsr_exit(); +#endif + __fast_exit_to_user_mode(); +} + +/* Copy from __enter_from_user_mode */ +static __always_inline void fast_enter_from_user_mode(struct pt_regs *regs) +{ +#ifndef CONFIG_DEBUG_FEATURE_BYPASS + lockdep_hardirqs_off(CALLER_ADDR0); +#endif + CT_WARN_ON(ct_state() != CONTEXT_USER); + user_exit_irqoff(); +#ifndef CONFIG_DEBUG_FEATURE_BYPASS + trace_hardirqs_off_finish(); + mte_disable_tco_entry(current); +#endif +} +#endif + /* * Handle IRQ/context state management when entering an NMI from user/kernel * mode. Before this function is called it is not safe to call regular kernel @@ -513,80 +569,12 @@ static __always_inline void __el1_pnmi(struct pt_regs *regs, } #ifdef CONFIG_FAST_IRQ -static __always_inline void __el1_xint(struct pt_regs *regs, - void (*handler)(struct pt_regs *)) -{ -#ifndef CONFIG_DEBUG_FEATURE_BYPASS - enter_from_kernel_mode(regs); -#endif - - xint_enter_rcu(); - do_interrupt_handler(regs, handler); - xint_exit_rcu(); - - arm64_preempt_schedule_irq(); - -#ifndef CONFIG_DEBUG_FEATURE_BYPASS - exit_to_kernel_mode(regs); -#endif -} - -static void noinstr el1_xint(struct pt_regs *regs, u64 nmi_flag, - void (*handler)(struct pt_regs *), - void (*nmi_handler)(struct pt_regs *)) -{ - /* Is there a NMI to handle? */ -#ifndef CONFIG_DEBUG_FEATURE_BYPASS - if (system_uses_nmi() && (read_sysreg(isr_el1) & nmi_flag)) { - __el1_nmi(regs, nmi_handler); - return; - } -#endif - - write_sysreg(DAIF_PROCCTX_NOIRQ, daif); - - if (IS_ENABLED(CONFIG_ARM64_PSEUDO_NMI) && !interrupts_enabled(regs)) - __el1_pnmi(regs, handler); - else - __el1_xint(regs, handler); -} - -asmlinkage void noinstr el1h_64_xint_handler(struct pt_regs *regs) -{ - el1_xint(regs, ISR_EL1_IS, handle_arch_irq, handle_arch_nmi_irq); -} - -static __always_inline void xint_exit_to_user_mode_prepare(struct pt_regs *regs) -{ - unsigned long flags; - - local_daif_mask(); - - flags = read_thread_flags(); - if (unlikely(flags & _TIF_WORK_MASK)) - do_notify_resume(regs, flags); - -#ifndef CONFIG_DEBUG_FEATURE_BYPASS - lockdep_sys_exit(); -#endif -} - -static __always_inline void xint_exit_to_user_mode(struct pt_regs *regs) -{ - xint_exit_to_user_mode_prepare(regs); -#ifndef CONFIG_DEBUG_FEATURE_BYPASS - mte_check_tfsr_exit(); - __exit_to_user_mode(); -#endif -} - static void noinstr el0_xint(struct pt_regs *regs, u64 nmi_flag, void (*handler)(struct pt_regs *), void (*nmi_handler)(struct pt_regs *)) { + fast_enter_from_user_mode(regs); #ifndef CONFIG_DEBUG_FEATURE_BYPASS - enter_from_user_mode(regs); - /* Is there a NMI to handle? */ if (system_uses_nmi() && (read_sysreg(isr_el1) & nmi_flag)) { /* @@ -615,7 +603,7 @@ static void noinstr el0_xint(struct pt_regs *regs, u64 nmi_flag, do_interrupt_handler(regs, handler); xint_exit_rcu(); - xint_exit_to_user_mode(regs); + fast_exit_to_user_mode(regs); } @@ -828,46 +816,17 @@ static void noinstr el0_fpac(struct pt_regs *regs, unsigned long esr) } #ifdef CONFIG_FAST_SYSCALL -/* - * Copy from exit_to_user_mode_prepare - */ -static __always_inline void xcall_exit_to_user_mode_prepare(struct pt_regs *regs) -{ - unsigned long flags; - - local_daif_mask(); - - flags = read_thread_flags(); - if (unlikely(flags & _TIF_WORK_MASK)) - do_notify_resume(regs, flags); - -#ifndef CONFIG_DEBUG_FEATURE_BYPASS - lockdep_sys_exit(); -#endif -} - -static __always_inline void xcall_exit_to_user_mode(struct pt_regs *regs) -{ - xcall_exit_to_user_mode_prepare(regs); -#ifndef CONFIG_DEBUG_FEATURE_BYPASS - mte_check_tfsr_exit(); - __exit_to_user_mode(); -#endif -} - /* Copy from el0_sync */ static void noinstr el0_xcall(struct pt_regs *regs) { -#ifndef CONFIG_DEBUG_FEATURE_BYPASS - enter_from_user_mode(regs); -#endif + fast_enter_from_user_mode(regs); #ifndef CONFIG_SECURITY_FEATURE_BYPASS cortex_a76_erratum_1463225_svc_handler(); #endif fp_user_discard(); local_daif_restore(DAIF_PROCCTX); do_el0_svc(regs); - xcall_exit_to_user_mode(regs); + fast_exit_to_user_mode(regs); } asmlinkage void noinstr el0t_64_xcall_handler(struct pt_regs *regs) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index e9fd3094623f..da3809632f0f 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -660,7 +660,7 @@ SYM_CODE_END(__bad_stack) #endif #ifdef CONFIG_FAST_IRQ -.macro check_xint_pre_kernel_entry el:req, ht:req +.macro check_xint_pre_kernel_entry stp x0, x1, [sp, #0] stp x2, x3, [sp, #16] @@ -691,20 +691,16 @@ SYM_CODE_END(__bad_stack) ldp x0, x1, [sp, #0] ldp x2, x3, [sp, #16] #ifdef CONFIG_SECURITY_FEATURE_BYPASS - kernel_entry \el, 64, xint + kernel_entry 0, 64, xint #else - kernel_entry \el, 64 + kernel_entry 0, 64 #endif mov x0, sp - bl el\el\ht\()_64_xint_handler + bl el0t_64_xint_handler #ifdef CONFIG_SECURITY_FEATURE_BYPASS - kernel_exit \el, xint + kernel_exit 0, xint #else - .if \el == 0 b ret_to_user - .else - b ret_to_kernel - .endif #endif .Lskip_xint\@: @@ -726,11 +722,11 @@ SYM_CODE_START_LOCAL(el\el\ht\()_\regsize\()_\label) .endif #endif #ifdef CONFIG_FAST_IRQ - .if \regsize == 64 && \label == irq && (( \el == 0 && \ht == t) || (\el == 1 && \ht == h)) + .if \regsize == 64 && \label == irq && \el == 0 && \ht == t alternative_if_not ARM64_HAS_XINT b .Lskip_check_xint\@ alternative_else_nop_endif - check_xint_pre_kernel_entry \el, \ht + check_xint_pre_kernel_entry .Lskip_check_xint\@: .endif #endif diff --git a/kernel/softirq.c b/kernel/softirq.c index 6dc0ea5baf06..cd8770b2f76c 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -669,11 +669,13 @@ void xint_enter_rcu(void) preempt_count_add(HARDIRQ_OFFSET); #ifndef CONFIG_DEBUG_FEATURE_BYPASS lockdep_hardirq_enter(); +#endif if (tick_nohz_full_cpu(smp_processor_id()) || (is_idle_task(current) && (irq_count() == HARDIRQ_OFFSET))) tick_irq_enter(); +#ifndef CONFIG_DEBUG_FEATURE_BYPASS account_hardirq_enter(current); #endif } @@ -695,9 +697,7 @@ static inline void __xint_exit_rcu(void) if (!in_interrupt() && local_softirq_pending()) invoke_softirq(); -#ifndef CONFIG_DEBUG_FEATURE_BYPASS tick_irq_exit(); -#endif } void xint_exit_rcu(void) -- 2.34.1
2 1
0 0
[PATCH v3 OLK-5.10] arm64: mm: Stop use spinlock during pbha early init
by Wupeng Ma 29 Nov '24

29 Nov '24
From: Ma Wupeng <mawupeng1(a)huawei.com> hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I96IZH -------------------------------- During early_pbha_init() in __primary_switched(), debug spinlock related function is not fully initialized. This will lead to kernel unable to boot with CONFIG_LOCK_STAT=y or related configs. Since kernel is running with only one cpu during startup, there is no need to use lock. Fix it by removing the spinlock. Fixes: f43933b3f947 ("arm64: cpufeature: Enable PBHA for stage1 early via FDT") Signed-off-by: Ma Wupeng <mawupeng1(a)huawei.com> --- Changelog since v1: - goto found if exists in chosen node --- arch/arm64/kernel/cpufeature.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 36a426b0def2..dee049d27c74 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1796,16 +1796,14 @@ void __init early_pbha_init(void) const u8 *prop; int size; - spin_lock(&pbha_dt_lock); - fdt = get_early_fdt_ptr(); if (!fdt) - goto unlock; + return; /* arm,pbha-performance-only may exist in both chosen and cpus node */ node = fdt_path_offset(fdt, "/chosen"); if (node < 0) - goto unlock; + return; prop = fdt_getprop(fdt, node, "arm,pbha-performance-only", &size); if (prop) @@ -1813,15 +1811,15 @@ void __init early_pbha_init(void) node = fdt_path_offset(fdt, "/cpus"); if (node < 0) - goto unlock; + return; prop = fdt_getprop(fdt, node, "arm,pbha-performance-only", &size); if (prop) - goto unlock; + return; found: if (!cpu_has_pbha()) - goto unlock; + return; update_pbha_perf_only_bit(prop, size); enable_pbha_inner(); @@ -1829,9 +1827,6 @@ void __init early_pbha_init(void) pbha_enabled = true; early_pbha_bit0_init(); - -unlock: - spin_unlock(&pbha_dt_lock); } /* -- 2.25.1
2 1
0 0
[PATCH OLK-6.6 0/4] LoongArch: backport patches from upstream
by Hongchen Zhang 29 Nov '24

29 Nov '24
Bibo Mao (1): LoongArch: Set initial pte entry with PAGE_GLOBAL for kernel space Huacai Chen (3): LoongArch: Use accessors to page table entries instead of direct dereference LoongArch: Remove superfluous flush_dcache_page() definition LoongArch: Improve hardware page table walker arch/loongarch/include/asm/atomic.h | 2 + arch/loongarch/include/asm/cacheflush.h | 3 - arch/loongarch/include/asm/hugetlb.h | 4 +- arch/loongarch/include/asm/kfence.h | 6 +- arch/loongarch/include/asm/mmu_context.h | 35 +++++++--- arch/loongarch/include/asm/pgalloc.h | 11 ++++ arch/loongarch/include/asm/pgtable.h | 83 ++++++++++-------------- arch/loongarch/kvm/mmu.c | 8 +-- arch/loongarch/mm/fault.c | 41 ++++++++++++ arch/loongarch/mm/hugetlbpage.c | 6 +- arch/loongarch/mm/init.c | 12 ++-- arch/loongarch/mm/kasan_init.c | 10 +-- arch/loongarch/mm/pgtable.c | 22 ++++++- include/linux/mm.h | 3 +- mm/kasan/init.c | 8 ++- mm/sparse-vmemmap.c | 5 ++ 16 files changed, 173 insertions(+), 86 deletions(-) -- 2.33.0
2 5
0 0
[PATCH v2 OLK-5.10] arm64: mm: Stop use spinlock during pbha early init
by Wupeng Ma 29 Nov '24

29 Nov '24
From: Ma Wupeng <mawupeng1(a)huawei.com> hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I96IZH -------------------------------- During early_pbha_init() in __primary_switched(), debug spinlock related function is not fully initialized. This will lead to kernel unable to boot with CONFIG_LOCK_STAT=y or related configs. Since kernel is running with only one cpu during startup, there is no need to use lock. Fix it by removing the spinlock. Fixes: f43933b3f947 ("arm64: cpufeature: Enable PBHA for stage1 early via FDT") Signed-off-by: Ma Wupeng <mawupeng1(a)huawei.com> --- arch/arm64/kernel/cpufeature.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 36a426b0def2..5ed44ff91e92 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1796,32 +1796,29 @@ void __init early_pbha_init(void) const u8 *prop; int size; - spin_lock(&pbha_dt_lock); - fdt = get_early_fdt_ptr(); if (!fdt) - goto unlock; + return; /* arm,pbha-performance-only may exist in both chosen and cpus node */ node = fdt_path_offset(fdt, "/chosen"); if (node < 0) - goto unlock; + return; prop = fdt_getprop(fdt, node, "arm,pbha-performance-only", &size); if (prop) - goto found; + return; node = fdt_path_offset(fdt, "/cpus"); if (node < 0) - goto unlock; + return; prop = fdt_getprop(fdt, node, "arm,pbha-performance-only", &size); if (prop) - goto unlock; + return; -found: if (!cpu_has_pbha()) - goto unlock; + return; update_pbha_perf_only_bit(prop, size); enable_pbha_inner(); @@ -1829,9 +1826,6 @@ void __init early_pbha_init(void) pbha_enabled = true; early_pbha_bit0_init(); - -unlock: - spin_unlock(&pbha_dt_lock); } /* -- 2.25.1
2 1
0 0
[PATCH OLK-6.6] [Backport] ext4: avoid remount errors with 'abort' mount option
by Yongjian Sun 29 Nov '24

29 Nov '24
From: Jan Kara <jack(a)suse.cz> mainline inclusion from mainline-v6.12-rc3 commit 76486b104168ae59703190566e372badf433314b category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB2YWS CVE: CVE-2024-50191 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- When we remount filesystem with 'abort' mount option while changing other mount options as well (as is LTP test doing), we can return error from the system call after commit d3476f3dad4a ("ext4: don't set SB_RDONLY after filesystem errors") because the application of mount option changes detects shutdown filesystem and refuses to do anything. The behavior of application of other mount options in presence of 'abort' mount option is currently rather arbitary as some mount option changes are handled before 'abort' and some after it. Move aborting of the filesystem to the end of remount handling so all requested changes are properly applied before the filesystem is shutdown to have a reasonably consistent behavior. Fixes: d3476f3dad4a ("ext4: don't set SB_RDONLY after filesystem errors") Reported-by: Jan Stancek <jstancek(a)redhat.com> Link: https://lore.kernel.org/all/Zvp6L+oFnfASaoHl@t14s Signed-off-by: Jan Kara <jack(a)suse.cz> Tested-by: Jan Stancek <jstancek(a)redhat.com> Link: https://patch.msgid.link/20241004221556.19222-1-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso(a)mit.edu> Signed-off-by: Yongjian Sun <sunyongjian1(a)huawei.com> --- fs/ext4/super.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 367fa50be4d6..5c52881160e5 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -6662,9 +6662,6 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb) goto restore_opts; } - if (test_opt2(sb, ABORT)) - ext4_abort(sb, ESHUTDOWN, "Abort forced by user"); - sb->s_flags = (sb->s_flags & ~SB_POSIXACL) | (test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0); @@ -6833,6 +6830,14 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb) if (!ext4_has_feature_mmp(sb) || sb_rdonly(sb)) ext4_stop_mmpd(sbi); + /* + * Handle aborting the filesystem as the last thing during remount to + * avoid obsure errors during remount when some option changes fail to + * apply due to shutdown filesystem. + */ + if (test_opt2(sb, ABORT)) + ext4_abort(sb, ESHUTDOWN, "Abort forced by user"); + return 0; restore_opts: -- 2.39.2
2 1
0 0
[PATCH openEuler-1.0-LTS] [Backport] fs: Fix uninitialized value issue in from_kuid and from_kgid
by Yongjian Sun 29 Nov '24

29 Nov '24
From: Alessandro Zanni <alessandro.zanni87(a)gmail.com> mainline inclusion from mainline-v6.12-rc3 commit 15f34347481648a567db67fb473c23befb796af5 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB705C CVE: CVE-2024-53101 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- ocfs2_setattr() uses attr->ia_mode, attr->ia_uid and attr->ia_gid in a trace point even though ATTR_MODE, ATTR_UID and ATTR_GID aren't set. Initialize all fields of newattrs to avoid uninitialized variables, by checking if ATTR_MODE, ATTR_UID, ATTR_GID are initialized, otherwise 0. Reported-by: syzbot+6c55f725d1bdc8c52058(a)syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=6c55f725d1bdc8c52058 Signed-off-by: Alessandro Zanni <alessandro.zanni87(a)gmail.com> Link: https://lore.kernel.org/r/20241017120553.55331-1-alessandro.zanni87@gmail.c… Reviewed-by: Jan Kara <jack(a)suse.cz> Signed-off-by: Christian Brauner <brauner(a)kernel.org> Signed-off-by: Yongjian Sun <sunyongjian1(a)huawei.com> --- fs/ocfs2/file.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 8c0e300f0463..da209f81c9ee 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1139,9 +1139,12 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) trace_ocfs2_setattr(inode, dentry, (unsigned long long)OCFS2_I(inode)->ip_blkno, dentry->d_name.len, dentry->d_name.name, - attr->ia_valid, attr->ia_mode, - from_kuid(&init_user_ns, attr->ia_uid), - from_kgid(&init_user_ns, attr->ia_gid)); + attr->ia_valid, + attr->ia_valid & ATTR_MODE ? attr->ia_mode : 0, + attr->ia_valid & ATTR_UID ? + from_kuid(&init_user_ns, attr->ia_uid) : 0, + attr->ia_valid & ATTR_GID ? + from_kgid(&init_user_ns, attr->ia_gid) : 0); /* ensuring we don't even attempt to truncate a symlink */ if (S_ISLNK(inode->i_mode)) -- 2.39.2
2 1
0 0
[PATCH openEuler-22.03-LTS-SP1] [Backport] fs: Fix uninitialized value issue in from_kuid and from_kgid
by Yongjian Sun 29 Nov '24

29 Nov '24
From: Alessandro Zanni <alessandro.zanni87(a)gmail.com> mainline inclusion from mainline-v6.12-rc3 commit 15f34347481648a567db67fb473c23befb796af5 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB705C CVE: CVE-2024-53101 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- ocfs2_setattr() uses attr->ia_mode, attr->ia_uid and attr->ia_gid in a trace point even though ATTR_MODE, ATTR_UID and ATTR_GID aren't set. Initialize all fields of newattrs to avoid uninitialized variables, by checking if ATTR_MODE, ATTR_UID, ATTR_GID are initialized, otherwise 0. Reported-by: syzbot+6c55f725d1bdc8c52058(a)syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=6c55f725d1bdc8c52058 Signed-off-by: Alessandro Zanni <alessandro.zanni87(a)gmail.com> Link: https://lore.kernel.org/r/20241017120553.55331-1-alessandro.zanni87@gmail.c… Reviewed-by: Jan Kara <jack(a)suse.cz> Signed-off-by: Christian Brauner <brauner(a)kernel.org> Signed-off-by: Yongjian Sun <sunyongjian1(a)huawei.com> --- fs/ocfs2/file.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index ffa258da6bac..a12f35d15032 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1133,9 +1133,12 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) trace_ocfs2_setattr(inode, dentry, (unsigned long long)OCFS2_I(inode)->ip_blkno, dentry->d_name.len, dentry->d_name.name, - attr->ia_valid, attr->ia_mode, - from_kuid(&init_user_ns, attr->ia_uid), - from_kgid(&init_user_ns, attr->ia_gid)); + attr->ia_valid, + attr->ia_valid & ATTR_MODE ? attr->ia_mode : 0, + attr->ia_valid & ATTR_UID ? + from_kuid(&init_user_ns, attr->ia_uid) : 0, + attr->ia_valid & ATTR_GID ? + from_kgid(&init_user_ns, attr->ia_gid) : 0); /* ensuring we don't even attempt to truncate a symlink */ if (S_ISLNK(inode->i_mode)) -- 2.39.2
2 1
0 0
[PATCH openEuler-22.03-LTS-SP1] [Backport] fs: Fix uninitialized value issue in from_kuid and from_kgid
by Yongjian Sun 29 Nov '24

29 Nov '24
From: Alessandro Zanni <alessandro.zanni87(a)gmail.com> mainline inclusion from mainline-v6.12-rc3 commit 15f34347481648a567db67fb473c23befb796af5 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB705C CVE: CVE-2024-53101 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- ocfs2_setattr() uses attr->ia_mode, attr->ia_uid and attr->ia_gid in a trace point even though ATTR_MODE, ATTR_UID and ATTR_GID aren't set. Initialize all fields of newattrs to avoid uninitialized variables, by checking if ATTR_MODE, ATTR_UID, ATTR_GID are initialized, otherwise 0. Reported-by: syzbot+6c55f725d1bdc8c52058(a)syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=6c55f725d1bdc8c52058 Signed-off-by: Alessandro Zanni <alessandro.zanni87(a)gmail.com> Link: https://lore.kernel.org/r/20241017120553.55331-1-alessandro.zanni87@gmail.c… Reviewed-by: Jan Kara <jack(a)suse.cz> Signed-off-by: Christian Brauner <brauner(a)kernel.org> Signed-off-by: Yongjian Sun <sunyongjian1(a)huawei.com> --- fs/ocfs2/file.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index ffa258da6bac..a12f35d15032 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1133,9 +1133,12 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) trace_ocfs2_setattr(inode, dentry, (unsigned long long)OCFS2_I(inode)->ip_blkno, dentry->d_name.len, dentry->d_name.name, - attr->ia_valid, attr->ia_mode, - from_kuid(&init_user_ns, attr->ia_uid), - from_kgid(&init_user_ns, attr->ia_gid)); + attr->ia_valid, + attr->ia_valid & ATTR_MODE ? attr->ia_mode : 0, + attr->ia_valid & ATTR_UID ? + from_kuid(&init_user_ns, attr->ia_uid) : 0, + attr->ia_valid & ATTR_GID ? + from_kgid(&init_user_ns, attr->ia_gid) : 0); /* ensuring we don't even attempt to truncate a symlink */ if (S_ISLNK(inode->i_mode)) -- 2.39.2
2 1
0 0
[PATCH OLK-5.10] [Backport] fs: Fix uninitialized value issue in from_kuid and from_kgid
by Yongjian Sun 29 Nov '24

29 Nov '24
From: Alessandro Zanni <alessandro.zanni87(a)gmail.com> mainline inclusion from mainline-v6.12-rc3 commit 15f34347481648a567db67fb473c23befb796af5 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB705C CVE: CVE-2024-53101 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- ocfs2_setattr() uses attr->ia_mode, attr->ia_uid and attr->ia_gid in a trace point even though ATTR_MODE, ATTR_UID and ATTR_GID aren't set. Initialize all fields of newattrs to avoid uninitialized variables, by checking if ATTR_MODE, ATTR_UID, ATTR_GID are initialized, otherwise 0. Reported-by: syzbot+6c55f725d1bdc8c52058(a)syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=6c55f725d1bdc8c52058 Signed-off-by: Alessandro Zanni <alessandro.zanni87(a)gmail.com> Link: https://lore.kernel.org/r/20241017120553.55331-1-alessandro.zanni87@gmail.c… Reviewed-by: Jan Kara <jack(a)suse.cz> Signed-off-by: Christian Brauner <brauner(a)kernel.org> Signed-off-by: Yongjian Sun <sunyongjian1(a)huawei.com> --- fs/ocfs2/file.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index ec0e67e9a3ec..43ce41404e72 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1133,9 +1133,12 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) trace_ocfs2_setattr(inode, dentry, (unsigned long long)OCFS2_I(inode)->ip_blkno, dentry->d_name.len, dentry->d_name.name, - attr->ia_valid, attr->ia_mode, - from_kuid(&init_user_ns, attr->ia_uid), - from_kgid(&init_user_ns, attr->ia_gid)); + attr->ia_valid, + attr->ia_valid & ATTR_MODE ? attr->ia_mode : 0, + attr->ia_valid & ATTR_UID ? + from_kuid(&init_user_ns, attr->ia_uid) : 0, + attr->ia_valid & ATTR_GID ? + from_kgid(&init_user_ns, attr->ia_gid) : 0); /* ensuring we don't even attempt to truncate a symlink */ if (S_ISLNK(inode->i_mode)) -- 2.39.2
2 1
0 0
[PATCH OLK-6.6] drm/amd/display: Add missing NULL pointer check within dpcd_extend_address_range
by Zhang Zekun 29 Nov '24

29 Nov '24
From: Hersen Wu <hersenxs.wu(a)amd.com> mainline inclusion from mainline-v6.11-rc1 commit 5524fa301ba649f8cf00848f91468e0ba7e4f24c category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAU9OL CVE: CVE-2024-46808 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------------------------------------- [Why & How] ASSERT if return NULL from kcalloc. Reviewed-by: Alex Hung <alex.hung(a)amd.com> Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira(a)amd.com> Acked-by: Tom Chung <chiahsuan.chung(a)amd.com> Signed-off-by: Hersen Wu <hersenxs.wu(a)amd.com> Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com> Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com> Signed-off-by: Zhang Zekun <zhangzekun11(a)huawei.com> --- drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c index fc50931c2aec..9d67b9a9c2d9 100644 --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c @@ -165,6 +165,7 @@ static void dpcd_extend_address_range( *out_address = new_addr_range.start; *out_size = ADDRESS_RANGE_SIZE(new_addr_range.start, new_addr_range.end); *out_data = kzalloc(*out_size * sizeof(**out_data), GFP_KERNEL); + ASSERT(*out_data); } } -- 2.17.1
2 1
0 0
  • ← Newer
  • 1
  • ...
  • 310
  • 311
  • 312
  • 313
  • 314
  • 315
  • 316
  • ...
  • 1821
  • Older →

HyperKitty Powered by HyperKitty