summaryrefslogtreecommitdiff
path: root/arch
AgeCommit message (Collapse)Author
27 hoursMerge tag 'riscv-for-linus-7.4-rc4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Paul Walmsley: - Fix a bug in the context switch code that can allow the switched-to task to inadvertently inherit the supervisor user memory access privilege from the switched-from task - Protect the regs->status RMW sequences in the vector register context switch code, to fix a potential floating point state corruption bug - Fix the return values from the early boot unaligned access speed detection functions called by __setup() to return 0 on failure, rather than an error code, as 0 is what __setup() expects to receive upon an error - Prevent the DTB from being potentially overwritten early in boot by reserving it in memblock before scanning the /reserved-memory section of the DTB - Fix hugetlb vmemmap optimization and a few other code paths that map kernel pages as read-only by defining PAGE_KERNEL_RO - Fix an error path in kgdb_riscv_notify() to add a missing local_irq_restore() - Fix the RISC-V defconfig to enable heap randomization by default by removing CONFIG_COMPAT_BRK, which shouldn't have been there in the first place; and to enable building onboard USB hub support as a module to better support the SpacemiT K1 - Fix CONFIG_RISCV_ISA_SV{48,57} to depend on CONFIG_MMU, since they are virtual memory configuration options that by definition require MMU support - Fix a missing space in the SpacemiT K1 DTS file * tag 'riscv-for-linus-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: mm: reserve the DTB before scanning reserved memory riscv: unaligned: fix __setup handlers riscv: dts: spacemit: k1: Correct missing space riscv: defconfig: enable onboard USB hub support riscv: signal: protect regs->status RMW from concurrent preemption riscv: mm: Define PAGE_KERNEL_RO riscv: kgdb: Fix potential missing local_irq_restore() call riscv: RISCV_ISA_SV48 and RISCV_ISA_SV57 should depend on MMU riscv: defconfig: Disable COMPAT_BRK riscv: Fix SR_SUM leakage across context switches
30 hoursMerge tag 'rust-fixes-7.4-4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux Pull Rust fixes from Miguel Ojeda: "Toolchain and infrastructure: - Disable function merging in all cases to fix broken MODVERSIONS information with gendwarfksyms, wrong backtraces and possibly issues with pahole/BTF due to lost debug information. - x86: emit the expected 'cs' prefix for RETPOLINE builds by passing the '-Zindirect-branch-cs-prefix' flag we added to 'rustc', which fixes boot failures (with 'spectre_v2=retpoline,lfence') and code corruption (with paranoid FineIBT). - Fix objtool warnings for the upcoming Rust 1.101.0 (expected 2026-12-24) by adding more 'noreturn' functions. 'kernel' crate: - 'str' module: fix soundness issue in 'Formatter::new()' by tying the returned formatter to the lifetime of its backing buffer. - 'iov' module: fix soundness issue in 'copy_from_iter_raw()' by tying the returned slice to the lifetime of the output buffer. I suggested upstream Rust to introduce a lint for this case of the lifetime elision rule, to avoid repeating this sort of mistake" * tag 'rust-fixes-7.4-4' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux: kbuild: rust: disable function merging unconditionally rust: str: tie Formatter to its backing buffer rust: iov: fix return lifetime of `copy_from_iter_raw()` x86/rust: use `-Zindirect-branch-cs-prefix` for RETPOLINE builds objtool/rust: add more `noreturn` Rust functions for Rust 1.101.0
31 hoursMerge tag 'parisc-for-7.4-rc4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc fixes from Helge Deller: "Fix a register corruption with the 32-bit dynamic ftrace, and prevent a lockdep assertion failure in the timer tick" * tag 'parisc-for-7.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix register corruption in 32-bit dynamic ftrace parisc: irq: Trace hardirq state in do_cpu_irq_mask()
31 hoursMerge tag 'x86-urgent-2026-11-22' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Ingo Molnar: - Add Intel Coral Rapids and Razor Lake CPU models (Tony Luck) - Update the table of Intel SNC capable CPU models with Granite Rapids "D" CPUs (Tony Luck) - Fix MSI interrupt affinity configuration (Weitao Wang) - Do not treat cache hierarchy MCE errors as memory errors, to fix false offlining of healthy RAM pages (Adrian Schlegel) - Enable ROX also when CONFIG_STRICT_KERNEL_RWX is present (Richard Weinberger) * tag 'x86-urgent-2026-11-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/Kconfig: Enable ROX also when STRICT_KERNEL_RWX is present x86/mce: Do not treat cache hierarchy errors as memory errors x86/apic/msi: Fix MSI interrupt affinity configuration x86/resctrl: Add SNC support for Granite Rapids "D" CPU x86/cpu: Add Intel Coral Rapids and Razor Lake CPU models
32 hoursMerge tag 'input-for-v7.4-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - A fix in input core to tear down force-feedback devices synchronously on unregistration, preventing use-after-free and faults in unloaded modules if userspace holds an event node open across driver unbind - A fix for the da7280 haptic driver to stop advertising FF_GAIN capability without implementing gain control, preventing a NULL pointer dereference when userspace writes a gain event - A fix for the goodix touchscreen driver hardening backup reference length validation against malformed device configurations to prevent invalid memory writes during probe and suspend - A fix for the max77693-haptic driver to disable the chip bias if enabling the motor regulator fails when opening the device - A fix for the cyapa touchpad driver to release its runtime PM reference on interrupted lock acquisition so autosuspend keeps working - A fix for the Atari mouse driver and m68k IKBD glue to treat mouse movement deltas as signed bytes, restoring proper cursor movement with unsigned-char kernel builds - An update to the trackpoint driver adding a new JYT_NDT variant ID found on Lenovo ThinkPad X14 Gen 1 laptops so the device is not misdetected as a generic PS/2 mouse - Updates to the xpad driver adding support for Hori Real Arcade Pro 4, Hori Taiko Controller DX, Hyperkin Xenon, 8BitDo M30, and GameSir G7 Pro controllers * tag 'input-for-v7.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: destroy force-feedback device on input unregistration Input: max77693-haptic - disable bias on failed open Input: trackpoint - add new TP JYT_NDT device variant id 7 m68k: Fix atari mouse movement Input: xpad.c - add support for Hyperkin Xenon, Hori Taiko Controller DX, and 8BitDo M30 Input: xpad - add support to Hori Real Arcade Pro 4 Input: da7280 - do not advertise FF_GAIN Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate() Input: goodix - reject a bak_ref length that cannot hold the checksum Input: xpad - add GameSir G7 Pro support
2 daysMerge tag 'powerpc-7.4-3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Madhavan Srinivasan: - powerpc32/bpf: return false from bpf_jit_supports_fsession() on ppc32 - PPC32: Fix hard_irq_disable to follow tracing and lockdep state - KVM: PPC: Book3S HV: Clean up on uvmem initialization failure - KVM: PPC: BookE: Load FP and Altivec before enabling the interrupts - KVM: PPC: Hard disable interrupts before guest entry - KVM: PPC: BookE: Use vcpu_err() instead of printk() in kvmppc_dump_vcpu() - MAINTAINERS updates - misc fixes and cleanups Thanks to Christian Zigotzky, Dan Carpenter, Fabiano Rosas, Gaurav Yadav, Gautam Menghani, Haoxiang Li, Karl Mehltretter, Mahesh Salgaonkar, Mukesh Kumar Chaurasiya, Narayana Murty N, Nathan Chancellor, Ritesh Harjani, R Nageswara Sastry, and Shrikanth Hegde * tag 'powerpc-7.4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: KVM: PPC: Fix TOCTOU kernel stack disclosure via kvm_run->mmio.len KVM: PPC: Book3S HV: Use u8 to store guest's interrupt priorities KVM: PPC: BookE: Use vcpu_err() instead of printk() in kvmppc_dump_vcpu() powerpc32/bpf: return false from bpf_jit_supports_fsession() on ppc32 KVM: PPC: Book3s: nestedv2: Free the guest state buffers if vcpu create fails KVM: PPC: Book3S HV: Fix error handling during vcore create KVM: PPC: Book3S HV nestedv2: reject vCPU ids beyond the PAPR limit KVM: PPC: Book3S HV nestedv2: cap max vcpus to PAPR limit KVM: PPC: BookE: Don't call __ffs() on an empty pending_exceptions bitmap KVM: PPC: Book3S: Don't call __ffs() on an empty pending_exceptions bitmap KVM: PPC: Book3S HV: Read EX_DSISR as a 32-bit field on guest exit powerpc/xmon: Avoid unsequenced accesses to tsk in show_task() KVM: PPC: Hard disable interrupts before guest entry KVM: PPC: BookE: Load FP and Altivec before enabling the interrupts PPC32: Fix hard_irq_disable to follow tracing and lockdep state KVM: PPC: Book3S HV: Clean up on uvmem initialization failure MAINTAINERS: Update OCXL maintainer details MAINTAINERS: Update EEH maintainer details
2 daysriscv: mm: reserve the DTB before scanning reserved memoryMarek Szyprowski
early_init_fdt_scan_reserved_mem() allocates memory from memblock while it scans /reserved-memory: the reserved_mem array, and the regions that are placed dynamically by size. On RISC-V the DTB was only reserved after that scan, so memblock could hand out the memory the DTB occupies while the DTB was still being parsed. Reserve the DTB before the scan, so that memblock never allocates from it. Fixes: ef69d2559fe9 ("riscv: Move early dtb mapping into the fixmap region") Closes: https://lore.kernel.org/all/b71ac175-fba5-4f61-bbdb-0b98dec9ccee@samsung.com/ Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://patch.msgid.link/20261104104604.3370384-1-m.szyprowski@samsung.com Cc: stable@vger.kernel.org Signed-off-by: Paul Walmsley <pjw@kernel.org>
2 daysriscv: unaligned: fix __setup handlersVladimir Kondratiev
Returning -EINVAL from a __setup() callback cause invalid unaligned_scalar_speed= and unaligned_vector_speed= values to be treated as handled. obsolete_checksetup() treats any non-zero return value from setup_func() as success, so an unrecognized argument is silently accepted instead of being reported as an unknown boot option. __setup() handlers return 0 on failure. Fixes: aecb09e091dc ("riscv: Add parameter for skipping access speed tests") Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> Reviewed-by: Jisheng Zhang <jszhang@kernel.org> Link: https://patch.msgid.link/20261111-fix-riscv-unaligned-v1-1-0722514fc1e4@mobileye.com Cc: stable@vger.kernel.org Signed-off-by: Paul Walmsley <pjw@kernel.org>
2 daysriscv: dts: spacemit: k1: Correct missing spaceKrzysztof Kozlowski
Correct minor style issue around white-space - missing space. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Yixun Lan <dlan@kernel.org> Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com> Link: https://patch.msgid.link/20261113185214.182695-4-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Paul Walmsley <pjw@kernel.org>
2 daysx86/Kconfig: Enable ROX also when STRICT_KERNEL_RWX is presentRichard Weinberger
Running a kernel with CONFIG_MODULES=n causes the W+X page detection to trigger: x86/mm: Found insecure W+X mapping at address 0xffffffffc033a000 The W+X pages come from __its_alloc() with type being EXECMEM_MODULE_TEXT. Without ARCH_HAS_EXECMEM_ROX pgprot is PAGE_KERNEL instead of PAGE_KERNEL_ROX. Fixes: 47410d839fcda ("x86/Kconfig: only enable ROX cache in execmem when STRICT_MODULE_RWX is set") Suggested-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Tested-by: Vinny Horgan <vinnyhorgan@gmail.com> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260625090627.1501095-1-richard@nod.at
3 daysKVM: PPC: Fix TOCTOU kernel stack disclosure via kvm_run->mmio.lenNarayana Murty N
struct kvm_run is mmap'd and writable by host userspace at any time. kvmppc_complete_mmio_load() re-reads run->mmio.len from the shared page on the KVM_RUN completion path. A malicious userspace can: 1. Trigger a guest MMIO load; the kernel sets a valid run->mmio.len (1, 2, 4, or 8) and exits with mmio_needed=1. 2. Rewrite run->mmio.len to an invalid value (0, 3, 5, 6, or 7) before the next KVM_RUN ioctl. 3. On re-entry, kvm_arch_vcpu_ioctl_run() calls kvmppc_complete_mmio_load() unconditionally. 4. No switch case matches the tampered length, so 'gpr' remains uninitialised on the kernel stack. 5. The uninitialised value is written into a guest GPR and is subsequently readable by the attacker via KVM_GET_REGS or KVM_GET_ONE_REG, disclosing kernel stack contents (CWE-457/200). The same issue affects every site that advances paddr_accessed or passes the length to the VSX/VMX repeat-load/store helpers, since all of them re-read run->mmio.len from the shared mapping. Fix by introducing vcpu->arch.mmio_len, a kernel-private u8 field that is written once in __kvmppc_handle_load() and kvmppc_handle_store() alongside the other vcpu->arch.mmio_* fields and never touched by userspace. All consumption sites are updated to use vcpu->arch.mmio_len: - kvmppc_complete_mmio_load(): reads vcpu->arch.mmio_len; validates it is exactly one of {1,2,4,8} (EMULATE_FAIL otherwise); initialises gpr = 0 before the switch so no uninitialised value can escape even if future code changes introduce a new path. Return type changed from void to int (EMULATE_DONE / EMULATE_FAIL) so callers can propagate failures. - kvm_arch_vcpu_ioctl_run(): checks the return value and exits with KVM_EXIT_INTERNAL_ERROR / KVM_INTERNAL_ERROR_EMULATION on failure, matching the VSX/VMX error paths already in place. run->internal.ndata is initialised to 0 so the union field does not carry stale mmio data. Clear mmio_needed before completing an in-kernel MMIO load or a userspace MMIO load on KVM_RUN re-entry, so a completion failure cannot leave stale pending-MMIO state. - kvmppc_handle_vsx_load(), kvmppc_handle_vsx_store(), kvmppc_handle_vmx_load(), kvmppc_handle_vmx_store(): paddr_accessed increments use vcpu->arch.mmio_len. - kvmppc_emulate_mmio_vsx_loadstore() and kvmppc_emulate_mmio_vmx_loadstore() use vcpu->arch.mmio_len for the paddr_accessed increment and for the length passed to the load/store helpers. Fixes: bbf45ba57eae ("KVM: ppc: PowerPC 440 KVM implementation") Tested-by: R Nageswara Sastry <rnsastry@linux.ibm.com> Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com> Signed-off-by: Gautam Menghani <gautam@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
3 daysKVM: PPC: Book3S HV: Use u8 to store guest's interrupt prioritiesGautam Menghani
Interrupt priorities range from 0x00 - 0xFF. When represented as u32 by the host in kvm_rtas_set_xive(), the guest can pass in a higher priority number (eg: 0x1FF) which ends up breaking this check in kvmppc_xive_set_xive(): if (priority != MASKED) { mutex_lock(&xive->lock); rc = xive_check_provisioning(xive->kvm, xive_prio_from_guest(priority)); mutex_unlock(&xive->lock); } This results in an attempt to access invalid memory in the function xive_provision_queue(): struct xive_q *q = &xc->queues[prio]; // prio = 0xFF Fix this by converting the priority variable to u8. Fixes: 5af50993850a ("KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller") Tested-by: R Nageswara Sastry <rnsastry@linux.ibm.com> Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com> Signed-off-by: Gautam Menghani <gautam@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
3 daysMerge tag 'bpf-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpfLinus Torvalds
Pull bpf fixes from Alexei Starovoitov: "Mostly sockmap fixes as promised, plus uprobe ctx rewrite via bpf and cgroup-bpf fixes. - Reject writable map iterators on read-only maps (Adethya Srinivasan) - Various sockmap fixes (Alexei Starovoitov): - Clear the redirect target before the sk_msg prog runs - Check that the redirected message is the cork - Leave sk_stream_wait_memory() once the socket is dead - Keep the rest of the cork after a redirect - Don't let an SK_PASS verdict cover the next message - Subtract all dropped bytes from the return value of sendmsg() - Clear the end mark of elements added by bpf_msg_push_data() and bpf_msg_pop_data() - Fix ring capacity invariant break in bpf_msg_push_data() (Bo Cao) - Report RCU-tasks quiescent states in do_check() to fix rcu_tasks stalls during a long verification (Breno Leitao) - Various sockmap fixes (Chris Mason): - Give no progs to a TCP listener - Check the target of an egress redirect before each send - Check the TCP state in recvmsg() - Reset the copy position when corking - Don't copy 0 bytes into a full cork - Use a dedicated workqueue for freeing BPF programs to fix a deadlock between pack_mutex waiters and the vmalloc purge work (Emil Tsalapatis) - Fix verifier model mismatch on a narrow read of __sk_buff.remote_port (Henry Martin) - Fix bpf-gcc CO-RE relocation in verifier_sockmap_mutate selftest (Jiayuan Chen) - Restrict uprobe ctx writes to the registers that ptrace can set (Jiri Olsa) - Various sockmap fixes (Josef Bacik): - Write sg.start when recvmsg() faults - Don't let an SK_DROP verdict stick - Clear the resume state of a stopped psock - Various fixes (Michal Luczaj): - Fix "unresolved symbol tcp_request_sock" build error with CONFIG_INET=n - Restrict iter-context sockmap updates to iter/sockmap - Restrict bpf_sock_destroy() to iter/{tcp,udp} - Mark bpf_iter__sockmap::sk as PTR_TRUSTED - Mark backing_file_alloc/free LSM hooks as untrusted (Sergei Nizovtsev) - Various cgroup-bpf fixes (Shakeel Butt): - Don't read freed effective arrays in BPF_PROG_QUERY - Don't attach to a removed cgroup - Protect cgroup_bpf state with its own mutex, so that queries and the release work don't wait for cgroup_mutex - Don't lose errors in effective BPF_LSM_CGROUP queries - Check variable-offset accesses against special fields (Shihuang Liu)" * tag 'bpf-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: (38 commits) selftests/bpf: Test which ctx registers a uprobe prog can write bpf: Restrict uprobe ctx writes to the registers ptrace can set selftests/bpf: Fix bpf-gcc CO-RE relocation in verifier_sockmap_mutate bpf, cgroup: Don't lose errors in effective BPF_LSM_CGROUP queries bpf, cgroup: Protect cgroup_bpf state with its own mutex bpf, cgroup: Don't attach to a removed cgroup bpf, cgroup: Don't read freed effective arrays in BPF_PROG_QUERY bpf: Fix verifier model mismatch on __sk_buff.remote_port narrow read bpf: Fix "unresolved symbol tcp_request_sock" build error selftests/bpf: Add iter/sockmap bpf_sock_destroy() negative test bpf: Mark bpf_iter__sockmap::sk as PTR_TRUSTED bpf: Restrict bpf_sock_destroy() to iter/{tcp,udp} bpf, docs: Document BPF_ITER_NOSLEEP selftests/bpf: Add negative test for sockmap update from non-sockmap iter bpf, sockmap: Restrict iter-context sockmap updates to iter/sockmap selftests/bpf: Remove sockmap update from bpf_iter_unix bpf, lsm: Mark backing_file_alloc/free LSM hooks as untrusted bpf: Report RCU-tasks quiescent states in do_check() bpf: Check variable-offset accesses against special fields bpf: Use dedicated workqueue for freeing BPF programs ...
3 daysMerge tag 'arm64-fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: "BBML3 allow-list corrections for Cortex-X4 and Neoverse-V3/V3AE following updated errata, a kCFI oops during kexec relocation and NEON intrinsics type mismatches causing CRC64 and XOR build failures with tip-of-tree Clang: - Remove Cortex-X4 and Neoverse-V3/V3AE from the BBML3 allow list Updated errata documents show that revisions previously reported as fixed remain affected by load/store livelocks when changing mapping sizes without break-before-make - Fix a kCFI oops during kexec image relocation. Give the relocation routine a type hash and enter the copied code at the correct offset - Fix the build with recent Clang versions by removing the stdint.h type overrides for NEON intrinsics. The CRC64 and XOR intrinsics code no longer includes the kernel's type header" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Drop stdint.h type overrides from asm/neon-intrinsics.h xor: arm/arm64: Move NEON xor_gen() dispatch into the glue code lib/crc: Don't include <linux/types.h> in NEON intrinsics code arm64: kexec: use a typed entry to fix kCFI oops arm64: cpufeature: Remove Cortex-X4 from the BBML3 allow list arm64: cpufeature: Remove Neoverse-V3/AE from the BBML3 allow list
3 daysMerge tag 's390-7.4-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Alexander Gordeev: - Fix error handling for monitor start and stop operations Return failures to userspace, prevent inconsistent state and potential use-after-free scenarios - Ensure skipped syscalls return -ENOSYS as expected Preserve existing ptrace behavior while separating syscall number handling from the return value stored in gpr2 - Fix a race during module initialization where sysfs handlers could access an uninitialized device list semaphore * tag 's390-7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/dcssblk: Initialize device semaphore before sysfs registration s390/syscall: Set -ENOSYS return value before calling syscall_enter_from_user_mode_work() s390/appldata: Fix error handling in appldata_generic_handler()
4 daysKVM: PPC: BookE: Use vcpu_err() instead of printk() in kvmppc_dump_vcpu()Gaurav Yadav
Replace generic printk() calls in kvmppc_dump_vcpu() with vcpu_err() and remove the corresponding TODO comment. Using vcpu_err() provides vCPU-aware logging context, making it easier to associate register dumps with specific vCPU instances in logs. Signed-off-by: Gaurav Yadav <yadavgaurav386@gmail.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260807084050.25216-1-yadavgaurav386@gmail.com
4 dayspowerpc32/bpf: return false from bpf_jit_supports_fsession() on ppc32Karl Mehltretter
bpf_jit_supports_fsession() returns bool. Commit 92258b5bf1ec ("powerpc32/bpf: Add fsession support") made it return -EOPNOTSUPP on ppc32 until fsession is validated there. The negative value converts to true, so the verifier does not reject fsession programs on ppc32. Such a program loads, and only attaching it fails because __arch_prepare_bpf_trampoline() returns -EOPNOTSUPP on ppc32. Return false instead. The load then fails with "JIT does not support fsession". Tested with a ppc32 kernel on QEMU g3beige. Fixes: 92258b5bf1ec ("powerpc32/bpf: Add fsession support") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/r/202608010958.cYfBCQAC-lkp@intel.com/ Assisted-by: LLM Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20261003184226.76740-1-kmehltretter@gmail.com
4 daysKVM: PPC: Book3s: nestedv2: Free the guest state buffers if vcpu create failsRitesh Harjani (IBM)
On a nestedv2 host, kvmppc_core_vcpu_create_hv() first creates the vCPU in the L0 with kvmhv_nestedv2_vcpu_create(), which also allocates the guest state messages and the run input/output buffers. Only after that it picks a vcore for the vCPU - which can actually fail. This patch therefore takes care of freeing the GSM abd GSB for nestedv2 if an error occurs later as part of the cleanup routine. Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/082c338c69773a73a48cd4e0d0885ee0f6ef5326.1793546707.git.ritesh.list@gmail.com
4 daysKVM: PPC: Book3S HV: Fix error handling during vcore createRitesh Harjani (IBM)
kvmppc_vcore_create() can fail and return NULL, this patch fixes the error handling when this happens. vcore and online_vcores count should only be updated when vcore was actually created, otherwise it's state gets messed up for the VM run. Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20f3d8cc8d5dc36872873cec4c8cb48a68e46354.1793546707.git.ritesh.list@gmail.com
4 daysKVM: PPC: Book3S HV nestedv2: reject vCPU ids beyond the PAPR limitRitesh Harjani (IBM)
The previous patch caps KVM_CAP_MAX_VCPU_ID at 2048 on nestedv2 but nothing actually enforces it. The generic KVM_CREATE_VCPU path only checks the id against KVM_MAX_VCPU_IDS, which is 8 * NR_CPUS on HV. That means a VMM that ignores the capability can still pass a larger id. That id goes all the way down to H_GUEST_CREATE_VCPU, where the L0 rejects it and prints, ... KVM: Create Guest vcpu hcall failed, rc=-56 ...for every such attempt before failing the ioctl with -EINVAL anyway. Check the id in kvm_arch_vcpu_precreate() instead so it fails early with the same -EINVAL. Note that PowerNV and nestedv1 are not affected. Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/3b233fa135d54d3ffb569d7febdc1cb8e0ed406a.1793546707.git.ritesh.list@gmail.com
4 daysKVM: PPC: Book3S HV nestedv2: cap max vcpus to PAPR limitRitesh Harjani (IBM)
PAPR spec for H_GUEST_CREATE_VCPU says: "Only 2048 VCPUs can be created, and the specified ID must be in the range of 0 to 2047" However, KVM reports KVM_CAP_MAX_VCPUS as NR_CPUS and KVM_CAP_MAX_VCPU_ID as 8 * NR_CPUS. It also passes the userspace vCPU id through to the hcall unchanged. On a nestedv2 host (KVM on PowerVM / pseries nested PAPR) built with NR_CPUS > 2048, kvm selftest e.g. kvm_create_max_vcpus will create vCPU 2048 and fail with EINVAL when the hypervisor returns H_P3. Following error gets reported (with a debug print added to selftest to print failed vcpu_id number): ./kvm_create_max_vcpus Random seed: 0x6ec3f539 KVM_CAP_MAX_VCPU_ID: 65536 KVM_CAP_MAX_VCPUS: 8192 Testing creating 8192 vCPUs, with IDs 0...8191. [ 62.655458][ T302] KVM: Create Guest vcpu hcall failed, rc=-56 [ 62.655458][ T302] KVM: Create Guest vcpu hcall failed, rc=-56 Failed KVM_CREATE_VCPU for vcpu_id 2048 with errno 22 ==== Test Assertion Failure ==== lib/kvm_util.c:1395: vcpu->fd >= 0 pid=302 tid=302 errno=22 - Invalid argument 1 0x00000000100061d3: __vm_vcpu_add at kvm_util.c:1395 (discriminator 6) 2 0x0000000010001a6b: test_vcpu_creation at kvm_create_max_vcpus.c:32 (discriminator 3) 3 0x000000001000160b: main at kvm_create_max_vcpus.c:59 4 0x000000001001b713: __libc_start_call_main at libc-start.o:? 5 0x000000001001bb47: __libc_start_main_impl at ??:? KVM_CREATE_VCPU failed, rc: -1 errno: 22 (Invalid argument) [ 65.316986][ T302] KVM: TLB LPID invalidation hcall failed, rc=-2 [ 65.316986][ T302] KVM: TLB LPID invalidation hcall failed, rc=-2 Cap both extensions at 2048 when kvmhv_is_nestedv2() is set, so userspace never requests an id the L0 cannot create. PowerNV and nestedv1 are unchanged. The issue is only seen with nestedv2. While at it, this also fixes the limit for KVM_CAP_NR_VCPUS. Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/f9c26aefa325bb4b6a3222718d6d605aa4993dff.1793546707.git.ritesh.list@gmail.com
4 daysKVM: PPC: BookE: Don't call __ffs() on an empty pending_exceptions bitmapRitesh Harjani (IBM)
kvmppc_core_check_exceptions() has the same pattern as the Book3S code: it starts the scan of the pending exception bitmap with __ffs(*pending) and is called from kvmppc_core_prepare_to_enter() on every guest entry, so it routinely passes 0 to __ffs(), which is undefined. To be safe here, let's use find_first_bit(), which returns the bitmap size when no bit is set. Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/9d5d92e93197ea43468312c82417b2f24159cca6.1793546707.git.ritesh.list@gmail.com
4 daysKVM: PPC: Book3S: Don't call __ffs() on an empty pending_exceptions bitmapRitesh Harjani (IBM)
This problem was caught when running KVM PPC selftests on big-endian. __ffs() doc clearly says: "Undefined if no bit exists, so code should check against 0 first" This cause KVM to deliever an arbitary interrupt to the guest and was causing guest to hang up while running these selftests. On checking further - GCC was emitting 0 in this case, which caused System Reset in guest while running kvm selftests. Use find_first_bit() instead, which reads the word once and returns the bitmap size when no bit is set, instead of reading *pending twice thereby causing TOCTOU as pointed by Sashiko. Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/aa74d5ca5ad53a2fa03a7224126f28899ca9b308.1793546707.git.ritesh.list@gmail.com
4 daysKVM: PPC: Book3S HV: Read EX_DSISR as a 32-bit field on guest exitRitesh Harjani (IBM)
kvmhv_vcpu_entry_p9() recovers the guest fault state from the paca exception save area with vcpu->arch.fault_dsisr = exsave[EX_DSISR/sizeof(u64)]; but EX_DSISR is not a doubleword. It is a 32-bit field at offset 48 that shares a doubleword with EX_CCR at offset 52 and the exception entry in exceptions-64s.S stores it accordingly. For e.g. stw r10,IAREA+EX_DSISR(r13) This issue was caught when running kvm selftests on big-endian, where this read would land in the high half and the truncation yields EX_CCR instead - KVM acts on the guest's condition register as if it were HDSISR. The result is that every HDSI on a big-endian host is evaluated against a bogus fault status i.e. it fails with below error: KVM: Got radix HV page fault with DSISR=84004840 Let's fix this by reading this field at it's natural width. Fixes: 89d35b239101 ("KVM: PPC: Book3S HV P9: Implement the rest of the P9 path in C") Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/4e883269c887f68f4d9d54f2675799df147a5db5.1793546707.git.ritesh.list@gmail.com
4 dayspowerpc/xmon: Avoid unsequenced accesses to tsk in show_task()Nathan Chancellor
After a recent improvement in clang to warn on unsequenced accesses to volatile variables [1], an instance appears in show_task(), which can break the build with CONFIG_PPC_WERROR=y / CONFIG_WERROR=y / W=e: arch/powerpc/xmon/xmon.c:3262:3: error: unsequenced accesses to volatile qualified 'tsk' [-Werror,-Wunsequenced] 3261 | printf("%16px %16lx %16px %6d %6d %c %2d %s\n", tsk, | ~~~ 3262 | tsk->thread.ksp, tsk->thread.regs, | ^ Per C11 5.1.2.3.2, accessing a volatile object is a side effect. Per C11 6.5.2, unsequenced side effects on the same scalar object are undefined behavior. Per C11 6.5.2.2.10/12, the evaluation of arguments in a function call is indeterminately sequenced, meaning any side effects in the arguments are unsequenced. tsk was made volatile in commit a2305e3de819 ("powerpc: mark local variables around longjmp as volatile") to ensure its value in show_tasks() was properly restored after returning from a potential longjmp(). Aside from that, the value is not being modified through other means, so rename the volatile parameter and add a local variable named tsk to hold its value throughout show_task(), clearing up the warning. Cc: stable@vger.kernel.org Fixes: a2305e3de819 ("powerpc: mark local variables around longjmp as volatile") Closes: https://github.com/ClangBuiltLinux/linux/issues/2199 Link: https://github.com/llvm/llvm-project/commit/955715460eaf9188c241c74750637fc82dfcc423 [1] Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20261115-xmon-wunsequenced-v1-1-42ae3fe45bf4@kernel.org
4 daysKVM: PPC: Hard disable interrupts before guest entryShrikanth Hegde
After applying preempt disable patch, i.e PATCH 2/3, Christian reported a subsequent warning stopping his board to boot properly. WARNING: at .kvmppc_fix_ee_before_entry+0x10/0x28, CPU#0: qemu-system-ppc/4667 CPU: 0 UID: 1000 PID: 4667 Comm: qemu-system-ppc Tainted: G W 7.3.0-rc4-2-powerpc64-smp #1 PREEMPT Tainted: [W]=WARN Hardware name: varisys,CYRUS5040 e5500 0x80240012 CoreNet Generic NIP [c00000000005dc3c] .kvmppc_fix_ee_before_entry+0x10/0x28 LR [c00000000005f298] .kvmppc_handle_exit+0x5b4/0x5e8 Call Trace: [c000000086587780] [c00000000005ee10] .kvmppc_handle_exit+0x12c/0x5e8 (unreliable) [c000000086587830] [c000000000062068] .kvmppc_resume_host+0xb8/0x10c It triggers below warning... static inline void kvmppc_fix_ee_before_entry(void) { trace_hardirqs_on(); /* * To avoid races, the caller must have gone directly from having * interrupts fully-enabled to hard-disabled. */ WARN_ON(local_paca->irq_happened != PACA_IRQ_HARD_DIS); This happens since kvmppc_prepare_to_enter does first local_irq_disable followed by hard_irq_disable. This leaves a small window where interrupt may occur and it could set the irq pending bit in PACA. That local_irq_disable was necessary for PPC32 to track the lockdep state etc. On PPC64 hard_irq_disable is good enough. There is no need to do both. With now hard_irq_disable, doing local_irq_disable for PPC32, just calling that is enough. Suggested-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Fixes: 12013e3d4695 ("KVM: powerpc: Use generic xfer to guest work function") Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de> Closes: https://lore.kernel.org/all/b8f82519-9ae5-c247-e020-e79c627e57df@xenosoft.de/ Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com> Reviewed-by: Narayana Murty N <nnmlinux@linux.ibm.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20261118051419.783878-4-sshegde@linux.ibm.com
4 daysKVM: PPC: BookE: Load FP and Altivec before enabling the interruptsShrikanth Hegde
Christian reported that booting preemptible kernel on FSL Cyrus+ board causes boot hang. The logs pointed that system was busy in printing below warning. WARNING: at .enable_kernel_fp+0x30/0x78, CPU#3: qemu-system-ppc/4884 Modules linked in: CPU: 3 UID: 1000 PID: 4884 Comm: qemu-system-ppc Not tainted 7.3.0-rc1-powerpc64-smp-preempt #1 PREEMPT NIP [c000000000003338] .enable_kernel_fp+0x30/0x78 LR [c00000000005de84] .kvmppc_load_guest_fp+0x30/0x80 Call Trace: [c000000085ca7700] [c00000000005de84] .kvmppc_load_guest_fp+0x30/0x80 [c000000085ca7780] [c00000000005f2a0] .kvmppc_handle_exit+0x5bc/0x5cc [c000000085ca7830] [c00000000006204c] .kvmppc_resume_host+0xb8/0x10c Which is... void enable_kernel_fp(void) { unsigned long cpumsr; WARN_ON(preemptible()); And... Though irq's are hard disabled after kvmppc_prepare_to_enter, but kvmppc_fix_ee_before_entry enables the softmask's IRQ state. That causes the irqs_disabled to return false. Hence leading to the warnings. Fix it by re-ordering the code to load the FP and Altivec before enabling the softmask IRQ state. Suggested-by: Narayana Murty N <nnmlinux@linux.ibm.com> Fixes: 3efc7da61f6c ("KVM: PPC: Book3E: Increase FPU laziness") Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de> Closes: https://lore.kernel.org/all/33342fbf-eb7b-bde6-2c8c-254fe8bfb993@xenosoft.de/ Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> Reviewed-by: Narayana Murty N <nnmlinux@linux.ibm.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com> Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20261118051419.783878-3-sshegde@linux.ibm.com
4 daysPPC32: Fix hard_irq_disable to follow tracing and lockdep stateShrikanth Hegde
On PPC32, the code for hard_irq_disable has diverged and it doesn't do lockdep/tracing anymore, leading to use of both local_irq_disable and hard_irq_disable on PPC32 to overcome those. That is un-necessary, instead simply calling local_irq_disable is enough. It disables EE bit and does lockdep tracking. Subsequent patch uses this API in KVM code to avoid the warnings. Wider use of it is possible, but it will be taken subsequently. Cc: stable@vger.kernel.org # v7.2+ Suggested-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com> Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20261118051419.783878-2-sshegde@linux.ibm.com
4 daysKVM: PPC: Book3S HV: Clean up on uvmem initialization failureHaoxiang Li
When kvmppc_uvmem_init() fails, kvmppc_book3s_init_hv() returns directly, bypassing the existing error path. Jump to the existing error path to clean up before returning the error. Fixes: 175be7e5800e ("KVM: PPC: Book3S HV: Free allocated memory if module init fails") Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20261118102012.2252221-1-haoxiang_li2024@163.com
4 daysx86/mce: Do not treat cache hierarchy errors as memory errorsAdrian Schlegel
On Intel and Zhaoxin, mce_is_memory_error() also returns true for cache hierarchy errors. All callers expect it to report memory errors only. The CEC uses it to count corrected DRAM errors. A corrected cache error only names the cache line that was affected, not a faulty DRAM page. With a faulty CPU core, the CEC therefore soft-offlines healthy pages. On an i9-9900K this caused about 500 soft-offline attempts per hour. Report only memory controller errors on Intel and Zhaoxin, as is already done for AMD. Fixes: fa92c5869426 ("x86, mce: Support memory error recovery for both UCNA and Deferred error in machine_check_poll") Signed-off-by: Adrian Schlegel <me@adrianschlegel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Qiuxu Zhuo <qzhuo@nvidia.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com> Reviewed-by: Sohil Mehta <sohil.mehta@intel.com> Cc: <stable@kernel.org> Link: https://patch.msgid.link/20261012193305.38931-1-me@adrianschlegel.com
4 daysx86/apic/msi: Fix MSI interrupt affinity configurationWeitaoWang-oc
The two step update sequence in msi_set_affinity() is required for MSI interrupts which cannot be migrated atomically, i.e. devices which do not provide MSI masking. The MSI message update writes address and data registers separately, so such a device can raise an interrupt in between, which results in a message built from half updated state: a stray interrupt on a stale vector and a possibly lost device interrupt. The update sequence is selected by a per interrupt quirk flag, which is set for interrupts which cannot use reservation mode. Reservation mode is only enabled for maskable interrupts, i.e. devices which provide MSI-X or mask support, so the quirk flag is the inverse of the reservation mode bit. The removal of the quirk flag replaced the flag check with a reservation mode check, but dropped the negation of the removed condition: - if (!irqd_msi_nomask_quirk(irqd) || ...) + if (!irqd_can_reserve(irqd) || ...) As the quirk flag is the inverse of the reservation mode bit, the replacement inverted the condition and selects the wrong update path for every interrupt: non-maskable interrupts take the direct update path again, which reopens the race, while maskable interrupts needlessly go through the two step update. Restore the original condition so that the direct update path is selected when reservation mode is enabled, which also matches the comment above the check: direct update is possible when the MSI is maskable, which is the case when the reservation mode bit is set. [ bp: Massage commit message. ] Fixes: b56ebe7c896d ("x86/apic/msi: Fix misconfigured non-maskable MSI quirk") Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Koichiro Den <den@valinux.co.jp> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org # v6.1+ Link: https://patch.msgid.link/20261016181016.3850-1-WeitaoWang-oc@zhaoxin.com
4 daysbpf: Restrict uprobe ctx writes to the registers ptrace can setJiri Olsa
Since commit 7384893d970e ("bpf: Allow uprobe program to change context registers") a uprobe program can write any field of struct pt_regs. Some of those fields are not plain user registers. The exit to user space loads them into the CPU: arch field exit path ptrace ------ ------ ------------------------------- ------------------ riscv status csrw CSR_STATUS, a0 not in the regset arm64 pstate msr spsr_el1, x22 valid_user_regs() x86-64 cs, ss (cs & 3) == 0: iretq to ring 0 set_segment_reg() x86-64 flags iretq loads IF and IOPL set_flags() On riscv a program that sets sstatus.SPP in pt_regs.status makes ret_from_exception return to user code in supervisor mode. On x86-64 a program that writes a kernel selector to cs makes iretq return to ring 0. ptrace guards these fields, but the bpf verifier does not. Add arch_uprobe_regs_writable(). Each arch lists the registers that ptrace can set to any value, and kprobe_prog_is_valid_access() rejects writes to any other offset when the program is loaded: arm64: x0 to x30, sp, pc riscv: epc, ra to t6 x86-64: r15 to di, ip, sp The default is no writes, so arches without a list (and 32-bit x86) lose ctx writes for uprobe programs. Reads are not affected. flags on x86-64 and pstate on arm64 become read-only, including the condition bits that ptrace would let a debugger change. orig_ax is read-only too. Kprobe programs that write ctx were already rejected when they were attached. Those that write one of these fields now fail to load. Fixes: 7384893d970e ("bpf: Allow uprobe program to change context registers") Reported-by: rtm@csail.mit.edu Suggested-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261118084451.12590-2-jolsa@kernel.org Closes: https://lore.kernel.org/bpf/30318.1794850523@30-11-166.wireless.csail.mit.edu/
4 daysx86/resctrl: Add SNC support for Granite Rapids "D" CPUTony Luck
Sub-NUMA Cluster (SNC) mode divides available RMID counters between NUMA nodes that share an instance of an L3 cache. Granite Rapids "D" CPUs can enable SNC mode, so Linux must adjust when SNC is enabled. Update the table of SNC capable CPU models. Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Cc: <stable@kernel.org> Link: https://patch.msgid.link/20261119184524.12846-1-tony.luck@intel.com
5 daysx86/cpu: Add Intel Coral Rapids and Razor Lake CPU modelsTony Luck
November 2026 "Intel Architecture Instruction Set Extensions and Future Features" published the model numbers for the upcoming Coral Rapids server and four Razor Lake (two desktops, two mobile). Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://patch.msgid.link/20261113174145.13513-1-tony.luck@intel.com
5 daysarm64: Drop stdint.h type overrides from asm/neon-intrinsics.hArd Biesheuvel
None of the users of NEON intrinsics include <linux/types.h> anymore, and so there is no longer a need to override __INT64_TYPE__ and __UINT64_TYPE__ in order to make the definitions of int64_t and uint64_t provided by the compiler's freestanding <stdint.h> compatible with the kernel's. So drop the overrides. This also means that uint64_t now matches the type that Clang uses for 64-bit quantities in the prototypes of its NEON builtins, and so the -Wincompatible-pointer-types warnings that are currently being disabled for all NEON intrinsics code will no longer occur. So drop the pragma that disables them as well. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Eric Biggers <ebiggers@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
5 daysparisc: Fix register corruption in 32-bit dynamic ftraceKarl Mehltretter
The 32-bit dynamic ftrace trampoline allocates a 64-byte frame. ftrace_caller() saves %r26 at offset 20, which overlaps the third argument's spill slot for ftrace_function_trampoline(). In the failing build, GCC spills org_sp_gr3 into that slot, overwriting saved %r26 with the original stack pointer. Tracing preempt_count_add() then passes that pointer as val and corrupts the preempt count. Allocate two frames on 32-bit, as 64-bit already does, and update the generated trampoline instruction to match. Fixes: 6ca6366220ed ("parisc: add dynamic ftrace") Cc: stable@vger.kernel.org Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
5 daysparisc: irq: Trace hardirq state in do_cpu_irq_mask()Karl Mehltretter
intr_extint calls do_cpu_irq_mask() with PSW[I] already clear. Since commit 044d0d6de9f5 ("lockdep: Only trace IRQ edges"), its local_irq_disable() then skips trace_hardirqs_off(), and lockdep assertions fail in the timer tick: WARNING: kernel/rcu/tree.c:2739 at rcu_sched_clock_irq+0x618/0x1f84 The return to a context with PSW[I] set has not been annotated since TRACE_IRQFLAGS_SUPPORT was enabled. Annotate both transitions. Fixes: 366dd4ea9d5f ("parisc: Fix ftrace function tracer") Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Cc: stable@vger.kernel.org # v5.9+ Signed-off-by: Helge Deller <deller@gmx.de>
5 daysarm64: kexec: use a typed entry to fix kCFI oopsBen Cressey
An arm64 Linux kernel built with CONFIG_CFI=y oopses after "Bye!" on every kexec that relocates the image. Crash images load in place and are not affected. The oops reproduces under QEMU: Unable to handle kernel paging request at virtual address 00000000544bfffc pc : machine_kexec+0x104/0x274 Code: d5182008 d5033fdf aa1303e0 f9418a68 (b85fc110) b85fc110 is "ldur w16, [x8, #-4]", the kCFI check's load of the type hash in front of the callee. Commit efc2d0f20a9d ("arm64: kexec: keep MMU enabled during kexec relocation") made machine_kexec() call the control page's copy of arm64_relocate_new_kernel() indirectly, while TTBR0 maps only that page. The copy starts at the page's first byte, so the load faults. SYM_CODE_START() also gives the routine no hash. SYM_TYPED_FUNC_START() emits the hash inside .kexec_relocate.text, and machine_kexec_post_load() already copies that whole section, at most 4 KiB, to the page's start, so the mapped page holds both hash and entry. The ASSERT from commit dc4824faa265 ("arm64: avoid executing padding bytes during kexec / hibernation") kept the entry first, since C branched to the page's start. Relax it, so the entry need only be in the section. Fix by typing the routine with SYM_TYPED_FUNC_START() and a C prototype, and entering the copy at the symbol's offset in the section. The code is Kees Cook's, as posted in review, with two comments and the ASSERT message reworded. An LLM diagnosed the oops. Fixes: efc2d0f20a9d ("arm64: kexec: keep MMU enabled during kexec relocation") Cc: stable@vger.kernel.org Suggested-by: Kees Cook <kees@kernel.org> Link: https://lore.kernel.org/linux-arm-kernel/202609241804.BB23BF10@keescook/ Signed-off-by: Ben Cressey <ben@cressey.dev> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
5 daysarm64: cpufeature: Remove Cortex-X4 from the BBML3 allow listRyan Roberts
Cortex-X4 erratum 3043263 can cause a load or store to livelock when mapping size changes without break-before-make or when contiguous hints are programmed inconsistently. The erratum was previously reported as fixed in r0p3. On that basis, commit 5aa4b625762e ("arm64: Add BBM Level 2 cpu feature") added Cortex-X4 from r0p3. The updated Cortex-X4 SDEN v13, dated 18 June 2026, lists r0p0, r0p1, r0p2 and r0p3 as affected and the erratum as open. Remove the entry so Cortex-X4 observes break-before-make, and record the workaround in the silicon errata registry. Fixes: 5aa4b625762e ("arm64: Add BBM Level 2 cpu feature") Cc: stable@vger.kernel.org Link: https://support.arm.com/documentation/109148/13-0/?lang=en Signed-off-by: Ryan Roberts <ryan.roberts@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
5 daysarm64: cpufeature: Remove Neoverse-V3/AE from the BBML3 allow listRyan Roberts
Neoverse-V3 and Neoverse-V3AE erratum 3053180 can cause a load or store to livelock when mapping size changes without break-before-make or when contiguous hints are programmed inconsistently. The erratum was previously reported as fixed in r0p2. On that basis, commit 5aa4b625762e ("arm64: Add BBM Level 2 cpu feature") allowed Neoverse-V3 from r0p2, and commit 8fca3852e33d ("arm64: cpufeature: add Neoverse-V3AE to BBML2 allow list") did the same for Neoverse-V3AE. The updated SDENs, MP168 v11 for Neoverse-V3 and MP172 v12 for Neoverse-V3AE, dated 9 June 2026, list r0p0, r0p1 and r0p2 as affected and the erratum as open. There is no fixed revision on which to base either allow-list entry. Remove both entries so these CPUs observe break-before-make, and record the workaround in the silicon errata registry. Fixes: 5aa4b625762e ("arm64: Add BBM Level 2 cpu feature") Fixes: 8fca3852e33d ("arm64: cpufeature: add Neoverse-V3AE to BBML2 allow list") Cc: stable@vger.kernel.org Link: https://support.arm.com/documentation/109231/11-0/?lang=en Link: https://support.arm.com/documentation/109704/12-0/?lang=en Signed-off-by: Ryan Roberts <ryan.roberts@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
5 daysMerge tag 'mm-hotfixes-stable-2026-11-17-19-55' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull MM fixes from Andrew Morton: - "maple_tree fixes for 7.3" (Liam R. Howlett): Fix an RCU reader NULL dereference when the tree is emptied during a walk, including /proc/PID/maps racing with munmap(). Add tests and make debug WARN and BUG checks report failures properly - "mm/kasan: Detect double-free involving kfree_rcu_sheaf()" (Kuniyuki Iwashima): Detect double-free when an object enters an RCU sheaf. KASAN could previously miss it until the object was reused, leading to a later free of a live object. Add KUnit tests for the different free orders - "mm: Fix page-table teardown during memory hot-remove" (Muchun Song): Balance page-table constructors and destructors when hot-remove frees tables on x86-64, RISC-V and arm64. This fixes NR_PAGETABLE accounting for tables with and without constructors - "mm/damon: fix watermark state, kunit pid leak and selftest fake pass" (SJ Park): Recompute watermark wait state when DAMON schemes are removed, so kdamond resumes monitoring. Fix a pid reference leak in KUnit and a selftest that reports a skipped run as a pass - An XArray iterator could step backwards when a large page-cache entry was split, sending filemap_map_pages() outside the PTE page it locked. The XArray correction and a filemap bound check prevent out-of-bounds accesses and use-after-free. Another XArray fix prevents lockless walkers from following a parent pointer into a freed node - Userfaultfd now validates the whole write-protection range before changing any VMA, avoiding partial unprotect without waking blocked faults. Failed unmaps now abort queued UFFD_EVENT_UNMAPs; previously they could report a nonexistent unmap, leak the userfaultfd context and leave later operations returning -EAGAIN. A fork fix clears stale uffd PTE bits if the new context is released before its event is read - Moving the hugetlbfs inode trace event before RCU freeing avoids a use-after-free of its superblock. Shmem swapin no longer retries forever on reused swap slots containing a mismatched large swap-cache folio. Swapoff also avoids a cluster-list loop that can soft-lock reclaim and leave swapoff hung - Weighted interleave recalculation now uses one node set throughout, avoiding a divide-by-zero during memory hotplug. Hwpoison holds the folio lock when inspecting its mapping and no longer leaks a folio reference; it also updates poison statistics before notifying rasdaemon through a trace event - Cross-node migration now moves NR_FILE_THPS and NR_KERNEL_FILE_PAGES with page-cache folios, preventing per-node and memcg-node accounting from retaining stale counts or underflowing after the folios are freed * tag 'mm-hotfixes-stable-2026-11-17-19-55' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (27 commits) xarray: fix index jumping backwards in xas_find() userfaultfd: validate the whole range before changing write protection maple_tree: update internal warning and bug_on code maple_tree: test emptying tree while RCU reading maple_tree: fix rcu reader NULL dereference after the tree is emptied mm/vma: read anon_vma carefully in validate_mm() hugetlbfs: move hugetlbfs_free_inode tracepoint to ->destroy_inode() selftests/damon/sysfs_memcg_path_leak: define ksft_skip mm/damon/tests/sysfs-kunit: fix leaked pid reference in add_targets test mm/damon/core: reset watermark wait state on each iteration mm/filemap: stop fault-around when the walk steps back mm: memory-failure: update statistics before emitting the trace event mm/vma: undo userfaultfd unmap preparation when unmapping fails userfaultfd: clear uffd state in child PTEs if uffd is released during fork mm/memory-failure: fix folio refcount leak and min_order_for_split() locking mm/shmem: fix swapin livelock on a mismatched large swap cache folio mm/mempolicy: use one node set for interleave weights xarray: clear the new head's parent before freeing the old head arm64/mm: fix destructor for unconstructed hotplug page tables riscv/mm: fix missing destructor for hotplug PUD tables ...
6 daysMerge tag 'arc-fixes-7.4' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC fix from Vineet Gupta: - workaround a GCC bug which has been causing upstream build fails * tag 'arc-fixes-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: io: work around GCC PR127718 in __raw_write{w,l}()
6 daysMerge tag 'powerpc-7.4-2' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Madhavan Srinivasan: - Handle of_property_count_u32_elems() error in parse_thread_groups() - Defer Nemo IRQ initialization - disable watchdog when watchdog_thresh=0 - Reserve a PLT entry for ftrace_regs_caller - powerpc KVM fixes - misc fixes and cleanups Thanks to Amit Machhiwal, Bradley Morgan, Christian Zigotzky, Christophe Leroy, Gautam Menghani, Jiale Yao, Luiz Capitulino, Michael Ellerman, Mohammad Shahid, Nathan Chancellor, Ritesh Harjani, Sasha Levin, Shrikanth Hegde, and Timothy Pearson * tag 'powerpc-7.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/perf/vpa-dtl: use GFP_ATOMIC for DTL buffer allocation powerpc32/modules: Reserve a PLT entry for ftrace_regs_caller powerpc/watchdog: disable watchdog when watchdog_thresh=0 selftests/powerpc: override EMIT_TESTS instead of the emit_tests rule powerpc/smp: Handle of_property_count_u32_elems() error in parse_thread_groups() powerpc/pasemi: Defer Nemo IRQ initialization KVM: PPC: Book3S HV: Avoid spurious interrupts caused by LPCR_MER bit KVM: PPC: Book3S HV: Take SRCU read lock around kvmppc_h_page_init() call KVM: PPC: Book3S HV: XICS: Avoid NULL ptr deref in kvmppc_xive_cleanup_vcpu() KVM: PPC: Book3S HV: XICS: Update irq_type for cleanup to work KVM: PPC: Book3S HV: Ensure that calls to idr_alloc are synchronized KVM: PPC: Book3S HV: Disable preemption around host-side HPT lock users powerpc/eeh: NUL-terminate force recovery input
7 daysx86/rust: use `-Zindirect-branch-cs-prefix` for RETPOLINE buildsMiguel Ojeda
The C compiler is asked to add a `cs` prefix to the `call` and `jmp` instructions that go through the indirect thunks for the `r8`-`r15` registers, which makes them 6 bytes long instead of 5. That gives `patch_retpoline()` enough room to inline them, e.g. as `lfence; call *%r11` for `spectre_v2=retpoline,lfence`. However, Rust code does not get the prefix, e.g. for a `CONFIG_MITIGATION_RETPOLINE=y` build: $ objdump -dr rust/kernel.o ... e2b: e8 00 00 00 00 call e30 <...> e2c: R_X86_64_PLT32 __x86_indirect_thunk_r11-0x4 Moreover, since commit 4a1e02b15ac1 ("x86,retpoline: Optimize patch_retpoline()"), `emit_indirect()` assumes there is enough room for the inlined sequence -- e.g. with `spectre_v2=retpoline,lfence`, the kernel warns and dies while patching a site inside `core`: WARNING: arch/x86/kernel/alternative.c:736 at apply_retpolines+0x2ee/0x400, CPU#0: swapper/0/0 ... Call Trace: <TASK> ? _RNvMs6_NtNtCshS2CUL9MEDn_4core3fmt8buildersNtB5_9DebugList21finish_non_exhaustive+0x5b/0xd0 ... alternative_instructions+0x1d/0x60 arch_cpu_finalize_init+0x5a/0xb0 start_kernel+0x1f4/0x280 Similarly, paranoid FineIBT rewrites each kCFI call site into a fixed 20-byte sequence, i.e. the 14 bytes of the kCFI check plus a 6-byte call. For a 5-byte call, that overwrites the first byte of the next instruction, corrupting Rust code: SMP alternatives: Using paranoid FineIBT CFI ... Oops: double fault: 0000 [#1] ... RIP: 0010:_RNvNtCsdVypMZsLRAh_4core3fmt5write+0x1e9/0x210 Code: ... b8 68 81 16 9f 41 3b 43 f5 2e 4d 8d 5b f0 75 fd 41 ff e3 <cc> c0 eb 02 b0 01 ... ... Kernel panic - not syncing: Fatal exception in interrupt Non-paranoid FineIBT is not affected, since it only rewrites the kCFI check and leaves the call itself to `apply_retpolines()`. We added support for `-Zindirect-branch-cs-prefix` [1][2] in Rust 1.91.0 [3]. Thus pass it for `RETPOLINE` builds when possible, which makes all sites indeed get the prefix: e3c: 2e e8 00 00 00 00 cs call e42 <...> e3e: R_X86_64_PLT32 __x86_indirect_thunk_r11-0x4 The kernel above boots fine with `spectre_v2=retpoline,lfence`, inlining the Rust sites as well. For older Rust compilers, set the LLVM module flag instead, which has the same code-generation effect. This means that every Rust version that the kernel supports gets the prefix, that the kernel boots fine with `spectre_v2=retpoline,lfence`, and that paranoid FineIBT no longer corrupts. In addition, add it to our target modifier workaround for `rustdoc`. Cc: stable@vger.kernel.org # 6.18.y+ Link: https://github.com/rust-lang/rust/issues/116852 [1] Link: https://github.com/rust-lang/compiler-team/issues/899 [2] Link: https://github.com/rust-lang/rust/pull/140740 [3] Reported-by: Kent Overstreet <kent.overstreet@linux.dev> Acked-by: Borislav Petkov <bp@alien8.de> Link: https://patch.msgid.link/20261018175457.87803-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
8 daysMerge tag 'x86-urgent-2026-11-15' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Ingo Molnar: - Don't print reset reason in VMs, to fix Xen PV domU boot regression on AMD Zen CPUs (Jason Andryuk) - Preserve the default VGA fallback for legacy modes, to fix regression where a SeaBIOS QEMU guest with bochs and VKMS the boot VGA (bochs) loses its DRM boot_display attribute (Hengyu Liang) - Ensure write visibility during LDT installation (Dave Hansen) * tag 'x86-urgent-2026-11-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Ensure write visibility during LDT installation x86/video: Preserve the default VGA fallback for legacy modes x86/CPU/AMD: Don't print reset reason in VMs
8 daysMerge tag 'perf-urgent-2026-11-15' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf events fixes from Ingo Molnar: - Avoid AMD uncore context migration from non-owners (Sandipan Das) - Clear stop state in perf_trace_add(), to fix self-profilers such as async-profiler. Also fix a similar bug in hw_breakpoint_add() (Paolo Bertinetti) - Fix racy update of cpc->hrtimer_interval (Benjamin Segall) - Do not resurrect cpuctx->cgrp after last cgroup event exit, to fix UAF bug (Phat Dinh) * tag 'perf-urgent-2026-11-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit perf: Fix racy update of cpc->hrtimer_interval perf/hw_breakpoint: Clear stop state in hw_breakpoint_add() tracing/perf: Clear stop state in perf_trace_add() perf/x86/amd/uncore: Avoid context migration from non-owners
9 daysx86/mm: Ensure write visibility during LDT installationDave Hansen
During LDT installation, the intent is to overwrite the old per-mm LDT value, then send an IPI to the mm user CPUs to have each load the new value. But there is an ordering problem: a new mm user CPU sets itself in mm_cpumask() and then reads mm->context.ldt. The LDT-installing CPU writes mm->context.ldt and then reads mm_cpumask(). But, there is nothing which orders the LDT installation side actions. The CPU can read mm_cpumask() before its write becomes visible. Ensure that new mm user CPUs see the new mm->context.ldt. Make mm->context.ldt visible before reading mm_cpumask(). Also convert the smp_store_release() over to a WRITE_ONCE(). smp_store_release() has an internal barrier which is weaker than the new smp_mb(). Avoid an extra barrier by converting it to WRITE_ONCE(). Also refresh/correct misleading comments. READ/WRITE_ONCE() do not "synchronize" anything themselves. Reported-by: Jaeyoung Chung <jjy600901@snu.ac.kr> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Jaeyoung Chung <jjy600901@snu.ac.kr> Acked-by: Linus Torvalds <torvalds@linuxfoundation.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: <stable@vger.kernel.org>
10 daysARC: io: work around GCC PR127718 in __raw_write{w,l}()Vineet Gupta
The __raw_write{w,l}() accessors use inline asm with an "m" operand for the store destination. GCC's ARC backend lets "m" match any legitimate address, including the register-indexed [b,c] forms that only loads support: stores only have [reg], [reg,s9] and [limm] addressing. With newer GCC (late-combine in GCC 15, combine in GCC 16), a writew() with a scaled, non-constant offset gets stw.as r2,[r0,r1] which the assembler rejects: Error: inappropriate arguments for opcode 'stw' With GCC 16 this breaks even hsdk_defconfig (drivers/net/pcs/ pcs-xpcs-plat.c) and axs101_defconfig. allyesconfig additionally trips in drivers/pinctrl/renesas/pinctrl-rza2.c and drivers/video/fbdev/ s3c-fb.c. Work around it by passing the address in a register and using a fixed [%1] address in the asm template, so the compiler can't pick an addressing mode that stores don't support. This is the minimal fix. The next patch drops the inline asm altogether. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127718 Cc: stable@vger.kernel.org Signed-off-by: Vineet Gupta <vgupta@kernel.org>
10 daysMerge tag 'arm64-fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: "Fix hugetlb write fault livelock, permission overlay and GCS state preservation across CPU suspend, cpuidle context tracking during system suspend, GCS mode handling on signal return, AMU counter errata workarounds, kexec loading of images with a non-zero text_offset and a spurious ptrace warning: - Fix hugetlb write fault livelocks caused by stale read-only TLB entries after another CPU makes the page writable and only performs a local invalidate. Unlike the generic fault path, hugetlb has no fix_spurious_fault() fallback - Save and restore POR_EL0, GCSPR_EL0 and GCSCRE0_EL1 across CPU suspend - Restrict cpuidle context tracking in cpu_suspend() to idle tasks, avoiding context tracking warnings during system suspend - Ignore attempts to change GCS mode through signal return, which updated the software state without updating the hardware. Changes made through prctl() in the signal handler are preserved. This changes the documented ABI but no known userspace relies on it. Allowing mode changes through both prctl() and signal return also creates confusing interactions, with signal return potentially undoing changes deliberately made by the handler - Extend the AMU constant counter workaround to additional CPUs and add a core cycle counter workaround for Cortex-A715/A720, treating the affected counters as unavailable - Avoid CMA allocations when loading a kexec Image with a non-zero text_offset, fixing an incorrect entry point and a memory leak when freeing the image - Remove a spurious ptrace warning when setting the syscall number of a task in a non-seized group-stop without siginfo" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: suspend: Only track cpuidle context for idle tasks arm64: ptrace: don't warn on missing siginfo in a group-stop arm64: kexec_file: Do not use CMA for images with a non-zero text_offset arm64: errata: Add Cortex-A715/A720 AMU core counter workaround arm64: errata: Extend the workaround for broken AMEVCNTR01 counter arm64/gcs: Ignore attempts to change GCS mode during signal return arm64: hugetlb: Prevent write fault livelocks on stale TLB entries arm64: suspend: Save GCS state over suspend arm64: suspend: Save POR_EL0 over suspend
10 daysarm64: suspend: Only track cpuidle context for idle tasksUladzislau Zhauniarovich
Commit 19235e472798 ("cpuidle, arm64: Fix the ARM64 cpuidle logic") moved the calls to ct_cpuidle_enter() and ct_cpuidle_exit() into cpu_suspend() so that arm64 cpuidle could keep RCU watching longer and manage context tracking internally. However, cpu_suspend() is called not only by cpuidle via psci_cpu_suspend_enter() (which runs in the context of the idle task), but also during system suspend via psci_system_suspend_enter() (which runs in the context of the task initiating suspend, such as a process writing to /sys/power/state). When entering system suspend, current is a non-idle task. Calling ct_cpuidle_enter() invokes ct_kernel_exit() from kernel space (!user) on a non-idle task. With CONFIG_RCU_EQS_DEBUG enabled, this violates context tracking invariants and triggers a warning: WARNING: kernel/context_tracking.c:120 at ct_kernel_exit+0x1b4/0x1f4 kernel/context_tracking.c:118 Call trace: ct_kernel_exit+0x1b4/0x1f4 kernel/context_tracking.c:118 ct_idle_enter+0x20/0x34 kernel/context_tracking.c:299 ct_cpuidle_enter include/linux/cpuidle.h:134 [inline] cpu_suspend+0x264/0x474 arch/arm64/kernel/suspend.c:136 psci_system_suspend_enter+0x4c/0x80 drivers/firmware/psci/psci.c:544 suspend_enter kernel/power/suspend.c:468 [inline] suspend_devices_and_enter+0x88c/0xd0c kernel/power/suspend.c:533 enter_state kernel/power/suspend.c:618 [inline] pm_suspend+0x498/0x698 kernel/power/suspend.c:644 state_store+0x14c/0x1fc kernel/power/main.c:819 kobj_attr_store+0x6c/0x90 lib/kobject.c:842 sysfs_kf_write+0xe0/0x108 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x260/0x3b8 fs/kernfs/file.c:345 vfs_write+0x51c/0xa0c fs/read_write.c:687 ksys_write+0x12c/0x228 fs/read_write.c:739 A corresponding warning is subsequently triggered in ct_kernel_enter() via ct_cpuidle_exit() upon resume. Fix this by checking is_idle_task(current) in cpu_suspend() and only invoking ct_cpuidle_enter() and ct_cpuidle_exit() when executing in the context of an idle task. Fixes: 19235e472798 ("cpuidle, arm64: Fix the ARM64 cpuidle logic") Cc: <stable@vger.kernel.org> Assisted-by: Gemini:gemini-3.8-flash Gemini:gemini-3.1-pro-preview syzbot Reported-by: syzbot+79883955da3a62652a80@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=79883955da3a62652a80 Link: https://syzkaller.appspot.com/ai_job?id=5359e16f-013b-4850-9cbc-ddfb3bac95e5 Signed-off-by: Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com> Tested-by: Uladzislau Zhauniarovich <uladzislau.zhauniarovich@gmail.com> Link: https://lore.kernel.org/r/3e92ccb0-2952-4317-af4c-45457c15efae@gmail.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>