id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
265d6aba165c500389c80d394ac247460c443ef5
Analyze and fix the following issue in the Linux kernel code: riscv: uaccess: Only restore the CSR_STATUS SUM bit
Problem Details: During switch to csrs will OR the value of the register into the corresponding csr. In this case we're only interested in restoring the SUM bit not the entire register. Signed-off-by: Cyril Bur <cyrilbur@tenstorrent.com> Link: https://lore.kernel.org/r/20250522160954.429333-1-cyrilbur@tenstorrent.com ...
```diff diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h index 8111250f3c1b..24d3af4d3807 100644 --- a/arch/riscv/include/asm/processor.h +++ b/arch/riscv/include/asm/processor.h @@ -110,7 +110,7 @@ struct thread_struct { struct __riscv_d_ext_state fstate; unsigned long bad_cause...
ee0d03053e7009a3a3532fb37f6c94bfa0a8cca3
Analyze and fix the following issue in the Linux kernel code: RISC-V: vDSO: Wire up getrandom() vDSO implementation
Problem Details: Hook up the generic vDSO implementation to the generic vDSO getrandom implementation by providing the required __arch_chacha20_blocks_nostack and getrandom_syscall implementations. Also wire up the selftests. The benchmark result: vdso: 25000000 times in 2.466341333 seconds libc: 25000000 times in ...
```diff diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 3cb0b05eef62..b5b3ead92f64 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -219,6 +219,7 @@ config RISCV select THREAD_INFO_IN_TASK select TRACE_IRQFLAGS_SUPPORT select UACCESS_MEMCPY if !MMU + select VDSO_GETRANDOM if HAVE_GENERIC_VDS...
64a064ce33b193a681f1eb52ac1ad09aadda9944
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: rbtree: Fix incorrect global variable usage
Problem Details: Within __add_three() function, should use function parameters instead of global variables. So that the variables groot_nested.inner.root and groot_nested.inner.glock in rbtree_add_nodes_nested() are tested correctly. Signed-off-by: Rong Tao <rongtao@cestc.cn> Link: https://lore.kernel.org/r/tencent_3D...
```diff diff --git a/tools/testing/selftests/bpf/progs/rbtree.c b/tools/testing/selftests/bpf/progs/rbtree.c index a3620c15c136..49fe93d7e059 100644 --- a/tools/testing/selftests/bpf/progs/rbtree.c +++ b/tools/testing/selftests/bpf/progs/rbtree.c @@ -61,19 +61,19 @@ static long __add_three(struct bpf_rb_root *root, str...
a934a57a42f64a40705202f84144b1a29b29f910
Analyze and fix the following issue in the Linux kernel code: scripts/misc-check: check missing #include <linux/export.h> when W=1
Problem Details: The problem was described in commit 5b20755b7780 ("init: move THIS_MODULE from <linux/export.h> to <linux/init.h>"). To summarize it again here: <linux/export.h> is included by most C files, even though only some of them actually export symbols. This is because some headers, such as include/linux/{mod...
```diff diff --git a/scripts/misc-check b/scripts/misc-check index 21551d721079..7cb61841a125 100755 --- a/scripts/misc-check +++ b/scripts/misc-check @@ -9,4 +9,47 @@ check_tracked_ignored_files () { sed 's/$/: warning: ignored by one of the .gitignore files/' >&2 } +# Check for missing #include <linux/export.h>...
94145ffb07601674091aadbdca9ce004b1736df4
Analyze and fix the following issue in the Linux kernel code: docs: symbol-namespaces: fix reST warning with literal block
Problem Details: Use a literal block for the EXPORT_SYMBOL_GPL_FOR_MODULES() example to avoid a Docutils warning about unmatched '*'. This ensures correct rendering and keeps the source readable. Warning: Documentation/core-api/symbol-namespaces.rst:90: WARNING: Inline emphasis start-string without end-string. [docuti...
```diff diff --git a/Documentation/core-api/symbol-namespaces.rst b/Documentation/core-api/symbol-namespaces.rst index f7cfa7b73e97..32fc73dc5529 100644 --- a/Documentation/core-api/symbol-namespaces.rst +++ b/Documentation/core-api/symbol-namespaces.rst @@ -85,7 +85,7 @@ namespace cannot be imported. The macro takes ...
7bc76fb3883aaba56b16dc4009ba8a490b8dc6ab
Analyze and fix the following issue in the Linux kernel code: RISC-V: Documentation: Add enough title underlines to CMODX
Problem Details: This reports as a warning in linux-next along the lines of Documentation/arch/riscv/cmodx.rst:14: WARNING: Title underline too short. CMODX in the Kernel Space --------------------- [docutils] Documentation/arch/riscv/cmodx.rst:43: WARNING: Title underline too short. CMODX in the...
```diff diff --git a/Documentation/arch/riscv/cmodx.rst b/Documentation/arch/riscv/cmodx.rst index e009873b2d17..40ba53bed5df 100644 --- a/Documentation/arch/riscv/cmodx.rst +++ b/Documentation/arch/riscv/cmodx.rst @@ -11,7 +11,7 @@ program must enforce its own synchronization with the unprivileged fence.i instruction...
c39d53750ff96b282c869a0184a7c3ecfd298ca8
Analyze and fix the following issue in the Linux kernel code: riscv: Improve Kconfig help for RISCV_ISA_V_PREEMPTIVE
Problem Details: Fix a couple of spelling issues plus some minor details on the grammar. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com> Link: https://lore.kernel.org/r/20250501130309.14803-1-mikisabate@gmail.com Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Alexandre Ghiti <alexghiti@r...
```diff diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index a93af30727ee..98a3ecdc65f6 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -669,12 +669,12 @@ config RISCV_ISA_V_PREEMPTIVE default y help Usually, in-kernel SIMD routines are run with preemption disabled. - Functions which envoke ...
6fe26f694c824b8a4dbf50c635bee1302e3f099c
Analyze and fix the following issue in the Linux kernel code: Bluetooth: MGMT: Protect mgmt_pending list with its own lock
Problem Details: This uses a mutex to protect from concurrent access of mgmt_pending list which can cause crashes like: ================================================================== BUG: KASAN: slab-use-after-free in hci_sock_get_channel+0x60/0x68 net/bluetooth/hci_sock.c:91 Read of size 2 at addr ffff0000c48885b...
```diff diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 93fcb659f0d4..f7b1a9eb9543 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -546,6 +546,7 @@ struct hci_dev { struct hci_conn_hash conn_hash; struct list_head mesh_pending; + struc...
e6ed54e86aae9e4f7286ce8d5c73780f91b48d1c
Analyze and fix the following issue in the Linux kernel code: Bluetooth: MGMT: Fix UAF on mgmt_remove_adv_monitor_complete
Problem Details: This reworks MGMT_OP_REMOVE_ADV_MONITOR to not use mgmt_pending_add to avoid crashes like bellow: ================================================================== BUG: KASAN: slab-use-after-free in mgmt_remove_adv_monitor_complete+0xe5/0x540 net/bluetooth/mgmt.c:5406 Read of size 8 at addr ffff88801...
```diff diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 2b261e74e2c4..93fcb659f0d4 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -2400,7 +2400,6 @@ void mgmt_advertising_added(struct sock *sk, struct hci_dev *hdev, u8 instance); v...
bf2ffc4d14db29cab781549912d2dc69127f4d3e
Analyze and fix the following issue in the Linux kernel code: Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition
Problem Details: Modify the driver to post 3 fewer buffers than the maximum rx buffers (64) allowed for the firmware. This change mitigates a hardware issue causing a race condition in the firmware, improving stability and data handling. Signed-off-by: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com> Signed...
```diff diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index 03f13de4a723..563165c5efae 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -398,7 +398,11 @@ static int btintel_pcie_start_rx(struct btintel_pcie_data *data) int i, ret; struct rxq ...
2dd711102ce69ae41f65d09c012441227d4aa983
Analyze and fix the following issue in the Linux kernel code: Bluetooth: btintel_pcie: Increase the tx and rx descriptor count
Problem Details: This change addresses latency issues observed in HID use cases where events arrive in bursts. By increasing the Rx descriptor count to 64, the firmware can handle bursty data more effectively, reducing latency and preventing buffer overflows. Signed-off-by: Chandrashekar Devegowda <chandrashekar.deveg...
```diff diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index 2c7731803c9f..03f13de4a723 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -1783,8 +1783,8 @@ static int btintel_pcie_alloc(struct btintel_pcie_data *data) * + size of index * Numbe...
daabd276985055250528da97e9ce6d277d7009c2
Analyze and fix the following issue in the Linux kernel code: Bluetooth: btintel_pcie: Fix driver not posting maximum rx buffers
Problem Details: The driver was posting only 6 rx buffers, despite the maximum rx buffers being defined as 16. Having fewer RX buffers caused firmware exceptions in HID use cases when events arrived in bursts. Exception seen on android 6.12 kernel. E Bluetooth: hci0: Received hw exception interrupt E Bluetooth: hci0:...
```diff diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index 50fe17f1e1d1..2c7731803c9f 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -396,8 +396,9 @@ static int btintel_pcie_submit_rx(struct btintel_pcie_data *data) static int btintel_pcie_st...
308a3a8ce8ea41b26c46169f3263e50f5997c28e
Analyze and fix the following issue in the Linux kernel code: Bluetooth: hci_core: fix list_for_each_entry_rcu usage
Problem Details: Releasing + re-acquiring RCU lock inside list_for_each_entry_rcu() loop body is not correct. Fix by taking the update-side hdev->lock instead. Fixes: c7eaf80bfb0c ("Bluetooth: Fix hci_link_tx_to RCU lock usage") Signed-off-by: Pauli Virtanen <pav@iki.fi> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.d...
```diff diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 3b49828160b7..04845ff3ad57 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -3417,23 +3417,18 @@ static void hci_link_tx_to(struct hci_dev *hdev, __u8 type) bt_dev_err(hdev, "link tx timeout"); - rcu_read_lock();...
919319b4edfa2c7f82f98cac570354075ad79196
Analyze and fix the following issue in the Linux kernel code: libbpf: Correct some typos and syntax issues in usdt doc
Problem Details: Fix some incorrect words, such as "and" -> "an", "it's" -> "its". Fix some grammar issues, such as removing redundant "will", "would complicated" -> "would complicate". Signed-off-by: Jiawei Zhao <Phoenix500526@163.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/...
```diff diff --git a/tools/lib/bpf/usdt.c b/tools/lib/bpf/usdt.c index 4e4a52742b01..3373b9d45ac4 100644 --- a/tools/lib/bpf/usdt.c +++ b/tools/lib/bpf/usdt.c @@ -59,7 +59,7 @@ * * STAP_PROBE3(my_usdt_provider, my_usdt_probe_name, 123, x, &y); * - * USDT is identified by it's <provider-name>:<probe-name> pair of ...
ca1a66cdd685030738cf077e3955fdedfe39fbb9
Analyze and fix the following issue in the Linux kernel code: riscv: uaccess: do not do misaligned accesses in get/put_user()
Problem Details: Doing misaligned access to userspace memory would make a trap on platform where it is emulated. Latest fixes removed the kernel capability to do unaligned accesses to userspace memory safely since interrupts are kept disabled at all time during that. Thus doing so would crash the kernel. Such behavior...
```diff diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uaccess.h index 046de7ced09c..d472da4450e6 100644 --- a/arch/riscv/include/asm/uaccess.h +++ b/arch/riscv/include/asm/uaccess.h @@ -169,8 +169,19 @@ do { \ #endif /* CONFIG_64BIT */ +unsigned long __must_check __asm_copy_to_user_...
48d9aabf2dc5d93b402ce55e3187e95698f2b9e9
Analyze and fix the following issue in the Linux kernel code: RISC-V: Kconfig: Fix help text of CMDLINE_EXTEND
Problem Details: It is the built-in command line appended to the bootloader command line, not the bootloader command line appended to the built-in command line. Fixes: 3aed8c43267e ("RISC-V: Update Kconfig to better handle CMDLINE") Signed-off-by: 谢致邦 (XIE Zhibang) <Yeking@Red54.com> Link: https://lore.kernel.org/r/te...
```diff diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 674cf6ff7188..78640cd353fd 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -1176,8 +1176,8 @@ config CMDLINE_FALLBACK config CMDLINE_EXTEND bool "Extend bootloader kernel arguments" help - The command-line arguments provided during bo...
850d7b14c8f77407b7d2a1edeb83d3e36c46e7a8
Analyze and fix the following issue in the Linux kernel code: riscv/kexec_file: Fix comment in purgatory relocator
Problem Details: Apparently sec_base doesn't mean relocated symbol value, which seems a copy-pasting error in the comment. Assigned with the address of section indexed by sym->st_shndx, it should represent base address of the relevant section. Let's fix the comment to avoid possible confusion. Fixes: 838b3e28488f ("RI...
```diff diff --git a/arch/riscv/kernel/elf_kexec.c b/arch/riscv/kernel/elf_kexec.c index e783a72d051f..0dc5450f2c7f 100644 --- a/arch/riscv/kernel/elf_kexec.c +++ b/arch/riscv/kernel/elf_kexec.c @@ -390,7 +390,7 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi, const Elf_Sym *sym; /* symbol to reloc...
b2137c3b6d7a45622967aac78b46a4bd2cff6c42
Analyze and fix the following issue in the Linux kernel code: riscv: ftrace: prepare ftrace for atomic code patching
Problem Details: We use an AUIPC+JALR pair to jump into a ftrace trampoline. Since instruction fetch can break down to 4 byte at a time, it is impossible to update two instructions without a race. In order to mitigate it, we initialize the patchable entry to AUIPC + NOP4. Then, the run-time code patching can change NOP...
```diff diff --git a/arch/riscv/include/asm/ftrace.h b/arch/riscv/include/asm/ftrace.h index d8b2138bd9c6..6a5c0a7fb826 100644 --- a/arch/riscv/include/asm/ftrace.h +++ b/arch/riscv/include/asm/ftrace.h @@ -20,10 +20,9 @@ extern void *return_address(unsigned int level); #define ftrace_return_address(n) return_address(...
500e626c4a5bf2fa7cc6f1cd6dd86c77b5b127f2
Analyze and fix the following issue in the Linux kernel code: kernel: ftrace: export ftrace_sync_ipi
Problem Details: The following ftrace patch for riscv uses a data store to update ftrace function. Therefore, a romote fence is required to order it against function_trace_op updates. The mechanism is similar to the fence between function_trace_op and update_ftrace_func in the generic ftrace, so we leverage the same ft...
```diff diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index fbabc3d848b3..30374478cb07 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -635,6 +635,8 @@ enum { #define ftrace_get_symaddr(fentry_ip) (0) #endif +void ftrace_sync_ipi(void *data); + #ifdef CONFIG_DYNAMIC_FTRACE voi...
c41bf4326c7b0af3f7004235ac91551833ec95c6
Analyze and fix the following issue in the Linux kernel code: riscv: ftrace: align patchable functions to 4 Byte boundary
Problem Details: We are changing ftrace code patching in order to remove dependency from stop_machine() and enable kernel preemption. This requires us to align functions entry at a 4-B align address. However, -falign-functions on older versions of GCC alone was not strong enoungh to align all functions. In fact, cold ...
```diff diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index bbec87b79309..7dbed10843d2 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -150,6 +150,7 @@ config RISCV select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS if MMU select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && (CLANG_SUPPORTS_D...
f8693f6dffcd1865da7f5f4c3df1de445e519bec
Analyze and fix the following issue in the Linux kernel code: riscv: ftrace: support fastcc in Clang for WITH_ARGS
Problem Details: Some caller-saved registers which are not defined as function arguments in the ABI can still be passed as arguments when the kernel is compiled with Clang. As a result, we must save and restore those registers to prevent ftrace from clobbering them. - [1]: https://reviews.llvm.org/D68559 Reported-by:...
```diff diff --git a/arch/riscv/include/asm/ftrace.h b/arch/riscv/include/asm/ftrace.h index d627f63ee289..d8b2138bd9c6 100644 --- a/arch/riscv/include/asm/ftrace.h +++ b/arch/riscv/include/asm/ftrace.h @@ -146,6 +146,13 @@ struct __arch_ftrace_regs { unsigned long a5; unsigned long a6; unsigned long a7; +#...
7c7c5cb5b5bf9d8ccc6a51b28687c9e7ff7f1890
Analyze and fix the following issue in the Linux kernel code: drm/xe: remove unmatched xe_vm_unlock() from __xe_exec_queue_init()
Problem Details: There is unmatched xe_vm_unlock() in the __xe_exec_queue_init(). Leftover from commit fbeaad071a98 ("drm/xe: Create LRC BO without VM") Fixes: 2b0a0ce0c20b ("drm/xe: Create LRC BO without VM") Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@in...
```diff diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c index 338487dc74c0..0161a80e92bc 100644 --- a/drivers/gpu/drm/xe/xe_exec_queue.c +++ b/drivers/gpu/drm/xe/xe_exec_queue.c @@ -114,7 +114,6 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe, static in...
2b0a0ce0c20bbedf83f78ba5926f6cae7470cd38
Analyze and fix the following issue in the Linux kernel code: drm/xe: Create LRC BO without VM
Problem Details: Specifying VM during lrc->bo creation requires VM's reference to be held for the lifetime of lrc->bo as it will use VM's dma reservation object. Using VM's dma reservation object for lrc->bo doesn't provide any advantage. Hence do not pass VM while creating lrc->bo. v2: Use xe_bo_unpin_map_no_vm (Matt...
```diff diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c index 21d4ced31dd9..338487dc74c0 100644 --- a/drivers/gpu/drm/xe/xe_exec_queue.c +++ b/drivers/gpu/drm/xe/xe_exec_queue.c @@ -132,12 +132,6 @@ static int __xe_exec_queue_init(struct xe_exec_queue *q) flags |= XE_LRC_CREATE_...
2e824747cfbdf1fba88df5e5800d284b2602ae8f
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc_submit: add back fix
Problem Details: Daniele noticed that the fix in commit 2d2be279f1ca ("drm/xe: fix UAF around queue destruction") looks to have been unintentionally removed as part of handling a conflict in some past merge commit. Add it back. Fixes: ac44ff7cec33 ("Merge tag 'drm-xe-fixes-2024-10-10' of https://gitlab.freedesktop.org...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index 369be36f7dc5..66a5a75898ac 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -229,6 +229,17 @@ static bool exec_queue_killed_or_banned_or_wedged(struct xe_exec_queue *q) static v...
69a58ef4fa77759b0e0c2f79834fa51b00a50c0b
Analyze and fix the following issue in the Linux kernel code: drm/xe/pxp: Clarify PXP queue creation behavior if PXP is not ready
Problem Details: The expected flow of operations when using PXP is to query the PXP status and wait for it to transition to "ready" before attempting to create an exec_queue. This flow is followed by the Mesa driver, but there is no guarantee that an incorrectly coded (or malicious) app will not attempt to create the q...
```diff diff --git a/drivers/gpu/drm/xe/xe_pxp.c b/drivers/gpu/drm/xe/xe_pxp.c index 454ea7dc08ac..b5bc15f436fa 100644 --- a/drivers/gpu/drm/xe/xe_pxp.c +++ b/drivers/gpu/drm/xe/xe_pxp.c @@ -541,10 +541,14 @@ int xe_pxp_exec_queue_add(struct xe_pxp *pxp, struct xe_exec_queue *q) */ xe_pm_runtime_get(pxp->xe); - ...
6bf4d5649230ca65725ec4793333fb5eba18d646
Analyze and fix the following issue in the Linux kernel code: drm/xe/pxp: Use the correct define in the set_property_funcs array
Problem Details: The define of the extension type was accidentally used instead of the one of the property itself. They're both zero, so no functional issue, but we should use the correct define for code correctness. Fixes: 41a97c4a1294 ("drm/xe/pxp/uapi: Add API to mark a BO as using PXP") Signed-off-by: Daniele Cera...
```diff diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c index 3c48a8c5f439..7aa2c17825da 100644 --- a/drivers/gpu/drm/xe/xe_bo.c +++ b/drivers/gpu/drm/xe/xe_bo.c @@ -2567,7 +2567,7 @@ typedef int (*xe_gem_create_set_property_fn)(struct xe_device *xe, u64 value); static const xe_gem_cr...
0ee54d5cacc0276ec631ac149825a24b59c51c38
Analyze and fix the following issue in the Linux kernel code: drm/xe/sched: stop re-submitting signalled jobs
Problem Details: Customer is reporting a really subtle issue where we get random DMAR faults, hangs and other nasties for kernel migration jobs when stressing stuff like s2idle/s3/s4. The explosions seems to happen somewhere after resuming the system with splats looking something like: PM: suspend exit rfkill: input h...
```diff diff --git a/drivers/gpu/drm/xe/xe_gpu_scheduler.h b/drivers/gpu/drm/xe/xe_gpu_scheduler.h index c250ea773491..308061f0cf37 100644 --- a/drivers/gpu/drm/xe/xe_gpu_scheduler.h +++ b/drivers/gpu/drm/xe/xe_gpu_scheduler.h @@ -51,7 +51,15 @@ static inline void xe_sched_tdr_queue_imm(struct xe_gpu_scheduler *sched) ...
5cc3325584c425069c1c3355c775314d64bf8770
Analyze and fix the following issue in the Linux kernel code: drm/xe: Rework eviction rejection of bound external bos
Problem Details: For preempt_fence mode VM's we're rejecting eviction of shared bos during VM_BIND. However, since we do this in the move() callback, we're getting an eviction failure warning from TTM. The TTM callback intended for these things is eviction_valuable(). However, the latter doesn't pass in the struct ttm...
```diff diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c index d99d91fe8aa9..3c48a8c5f439 100644 --- a/drivers/gpu/drm/xe/xe_bo.c +++ b/drivers/gpu/drm/xe/xe_bo.c @@ -841,21 +841,6 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict, goto out; } - /* Reject BO eviction if BO...
2182f358fb138f81a586ffdddd510f2a4fc61702
Analyze and fix the following issue in the Linux kernel code: drm/xe/vsec: fix CONFIG_INTEL_VSEC dependency
Problem Details: The XE driver can be built with or without VSEC support, but fails to link as built-in if vsec is in a loadable module: x86_64-linux-ld: vmlinux.o: in function `xe_vsec_init': (.text+0x1e83e16): undefined reference to `intel_vsec_register' The normal fix for this is to add a 'depends on INTEL_VSEC ||...
```diff diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig index 9bce047901b2..98b46c534278 100644 --- a/drivers/gpu/drm/xe/Kconfig +++ b/drivers/gpu/drm/xe/Kconfig @@ -2,6 +2,8 @@ config DRM_XE tristate "Intel Xe Graphics" depends on DRM && PCI && MMU && (m || (y && KUNIT=y)) + depends on INTEL_...
94110827925a2512e480176b3002e08105f98d66
Analyze and fix the following issue in the Linux kernel code: drm/xe: drop redundant conversion to bool
Problem Details: The result of integer comparison already evaluates to bool. No need for explicit conversion. No functional impact. Fixes: 0e414bf7ad01 ("drm/xe: Expose PCIe link downgrade attributes") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202505292205.MoljmkjQ-l...
```diff diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c index 2e657692e5b5..b9440f8c781e 100644 --- a/drivers/gpu/drm/xe/xe_device_sysfs.c +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c @@ -115,7 +115,7 @@ auto_link_downgrade_capable_show(struct device *dev, struct device_attribute ...
b885ae2e9db3dba8e9b3bc4df36744f22455d889
Analyze and fix the following issue in the Linux kernel code: drm/xe/hwmon: Move card reactive critical power under channel card
Problem Details: Move power2/curr2_crit to channel 1 i.e power1/curr1_crit as this represents the entire card critical power/current. v2: Update the date of curr1_crit also in hwmon documentation. Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> Fixes: 345dadc4f68b ("drm/xe/hwmon: Add infra to support card powe...
```diff diff --git a/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon index 4ca917ac6382..5a91dcccd3ac 100644 --- a/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon +++ b/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon @@ -60,26 +60,26 @@ Descripti...
25a2aa779fc39c4559a5bde0f841d2cd4cbc4d66
Analyze and fix the following issue in the Linux kernel code: drm/xe/hwmon: Add support to manage power limits though mailbox
Problem Details: Add support to manage power limits using pcode mailbox commands for supported platforms. v2: - Address review comments. (Badal) - Use mailbox commands instead of registers to manage power limits for BMG. - Clamp the maximum power limit to GPU firmware default value. v3: - Clamp power limit in ...
```diff diff --git a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h index f5e5234857c1..5394a1373a6b 100644 --- a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h +++ b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h @@ -38,10 +38,10 @@ #define TEMP_MASK REG_GENMASK(7, 0) #define PCU_CR_P...
8cf8cde41ad01150afbd1327ad1942387787f7fd
Analyze and fix the following issue in the Linux kernel code: drm/xe/vm: move xe_svm_init() earlier
Problem Details: In xe_vm_close_and_put() we need to be able to call xe_svm_fini(), however during vm creation we can call this on the error path, before having actually initialised the svm state, leading to various splats followed by a fatal NPD. Fixes: 6fd979c2f331 ("drm/xe: Add SVM init / close / fini to faulting V...
```diff diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index a68fd99ddfdb..861577746929 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -1683,10 +1683,16 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags) xe_pm_runtime_get_noresume(xe); } + if (flags ...
a63e99b4d6d3a0353ef47146dd5bd562f08e1786
Analyze and fix the following issue in the Linux kernel code: drm/xe/vm: move rebind_work init earlier
Problem Details: In xe_vm_close_and_put() we need to be able to call flush_work(rebind_work), however during vm creation we can call this on the error path, before having actually set up the worker, leading to a splat from flush_work(). It looks like we can simply move the worker init step earlier to fix this. Fixes:...
```diff diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index 79323c78130f..a68fd99ddfdb 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -1678,8 +1678,10 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags) * scheduler drops all the references of it, hence p...
f670b50ef5e4a69bf4d2ec5ac6a9228d93b13a7a
Analyze and fix the following issue in the Linux kernel code: sysfb: Fix screen_info type check for VGA
Problem Details: Use the helper screen_info_video_type() to get the framebuffer type from struct screen_info. Handle supported values in sorted switch statement. Reading orig_video_isVGA is unreliable. On most systems it is a VIDEO_TYPE_ constant. On some systems with VGA it is simply set to 1 to signal the presence o...
```diff diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c index 7c5c03f274b9..889e5b05c739 100644 --- a/drivers/firmware/sysfb.c +++ b/drivers/firmware/sysfb.c @@ -143,6 +143,7 @@ static __init int sysfb_init(void) { struct screen_info *si = &screen_info; struct device *parent; + unsigned int type; ...
2f29b5c231011b94007d2c8a6d793992f2275db1
Analyze and fix the following issue in the Linux kernel code: video: screen_info: Relocate framebuffers behind PCI bridges
Problem Details: Apply PCI host-bridge window offsets to screen_info framebuffers. Fixes invalid access to I/O memory. Resources behind a PCI host bridge can be relocated by a certain offset in the kernel's CPU address range used for I/O. The framebuffer memory range stored in screen_info refers to the CPU addresses a...
```diff diff --git a/drivers/video/screen_info_pci.c b/drivers/video/screen_info_pci.c index 6c5833517141..66bfc1d0a6dc 100644 --- a/drivers/video/screen_info_pci.c +++ b/drivers/video/screen_info_pci.c @@ -7,8 +7,8 @@ static struct pci_dev *screen_info_lfb_pdev; static size_t screen_info_lfb_bar; -static resource_...
3cae906e1a6184cdc9e4d260e4dbdf9a118d94ad
Analyze and fix the following issue in the Linux kernel code: calipso: unlock rcu before returning -EAFNOSUPPORT
Problem Details: syzbot reported that a recent patch forgot to unlock rcu in the error path. Adopt the convention that netlbl_conn_setattr() is already using. Fixes: 6e9f2df1c550 ("calipso: Don't call calipso functions for AF_INET sk.") Reported-by: syzbot <syzkaller@googlegroups.com> Signed-off-by: Eric Dumazet <edu...
```diff diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c index 6ea16138582c..33b77084a4e5 100644 --- a/net/netlabel/netlabel_kapi.c +++ b/net/netlabel/netlabel_kapi.c @@ -1165,8 +1165,10 @@ int netlbl_conn_setattr(struct sock *sk, break; #if IS_ENABLED(CONFIG_IPV6) case AF_INET6: - if (sk...
7632fedb266d93ed0ed9f487133e6c6314a9b2d1
Analyze and fix the following issue in the Linux kernel code: seg6: Fix validation of nexthop addresses
Problem Details: The kernel currently validates that the length of the provided nexthop address does not exceed the specified length. This can lead to the kernel reading uninitialized memory if user space provided a shorter length than the specified one. Fix by validating that the provided length exactly matches the s...
```diff diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c index ac1dbd492c22..a11a02b4ba95 100644 --- a/net/ipv6/seg6_local.c +++ b/net/ipv6/seg6_local.c @@ -1644,10 +1644,8 @@ static const struct nla_policy seg6_local_policy[SEG6_LOCAL_MAX + 1] = { [SEG6_LOCAL_SRH] = { .type = NLA_BINARY }, [SEG6_LOCAL_TA...
feafc73f3e6ae73371777a037d41d2e31c929636
Analyze and fix the following issue in the Linux kernel code: net: prevent a NULL deref in rtnl_create_link()
Problem Details: At the time rtnl_create_link() is running, dev->netdev_ops is NULL, we must not use netdev_lock_ops() or risk a NULL deref if CONFIG_NET_SHAPER is defined. Use netif_set_group() instead of dev_set_group(). RIP: 0010:netdev_need_ops_lock include/net/netdev_lock.h:33 [inline] RIP: 0010:netdev_lock_op...
```diff diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index f9a35bdc58ad..c57692eb8da9 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -3671,7 +3671,7 @@ struct net_device *rtnl_create_link(struct net *net, const char *ifname, if (tb[IFLA_LINKMODE]) dev->link_mode = nla_get_u8(tb[IFLA_LI...
535caaca921c653b1f9838fbd5c4e9494cafc3d9
Analyze and fix the following issue in the Linux kernel code: net: annotate data-races around cleanup_net_task
Problem Details: from_cleanup_net() reads cleanup_net_task locklessly. Add READ_ONCE()/WRITE_ONCE() annotations to avoid a potential KCSAN warning, even if the race is harmless. Fixes: 0734d7c3d93c ("net: expedite synchronize_net() for cleanup_net()") Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Jas...
```diff diff --git a/net/core/dev.c b/net/core/dev.c index a388f459a366..be97c440ecd5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -10499,7 +10499,7 @@ static void dev_index_release(struct net *net, int ifindex) static bool from_cleanup_net(void) { #ifdef CONFIG_NET_NS - return current == cleanup_net_task; + ...
e6854be4d80ea266a7be64a65a0322bcdfa72807
Analyze and fix the following issue in the Linux kernel code: selftests: drv-net: tso: make bkg() wait for socat to quit
Problem Details: Commit 846742f7e32f ("selftests: drv-net: add a warning for bkg + shell + terminate") added a warning for bkg() used with terminate=True. The tso test was missed as we didn't have it running anywhere in NIPA. Add exit_wait=True, to avoid: # Warning: combining shell and terminate is risky! # ...
```diff diff --git a/tools/testing/selftests/drivers/net/hw/tso.py b/tools/testing/selftests/drivers/net/hw/tso.py index eec647e7ec19..3370827409aa 100755 --- a/tools/testing/selftests/drivers/net/hw/tso.py +++ b/tools/testing/selftests/drivers/net/hw/tso.py @@ -39,7 +39,7 @@ def run_one_stream(cfg, ipver, remote_v4, r...
c68804c934e3197e34560744854c57cf88dff8e7
Analyze and fix the following issue in the Linux kernel code: selftests: drv-net: tso: fix the GRE device name
Problem Details: The device type for IPv4 GRE is "gre" not "ipgre", unlike for IPv6 which uses "ip6gre". Not sure how I missed this when writing the test, perhaps because all HW I have access to is on an IPv6-only network. Fixes: 0d0f4174f6c8 ("selftests: drv-net: add a simple TSO test") Reviewed-by: Simon Horman <ho...
```diff diff --git a/tools/testing/selftests/drivers/net/hw/tso.py b/tools/testing/selftests/drivers/net/hw/tso.py index e1ecb92f79d9..eec647e7ec19 100755 --- a/tools/testing/selftests/drivers/net/hw/tso.py +++ b/tools/testing/selftests/drivers/net/hw/tso.py @@ -216,7 +216,7 @@ def main() -> None: ("", ...
7eb6b63aa3c3b406512db15943ce9eb114095b51
Analyze and fix the following issue in the Linux kernel code: selftests: drv-net: add configs for the TSO test
Problem Details: Add missing config options for the tso.py test, specifically to make sure the kernel is built with vxlan and gre tunnels. I noticed this while adding a TSO-capable device QEMU to the CI. Previously we only run virtio tests and it doesn't report LSO stats on the QEMU we have. Fixes: 0d0f4174f6c8 ("sel...
```diff diff --git a/tools/testing/selftests/drivers/net/hw/config b/tools/testing/selftests/drivers/net/hw/config new file mode 100644 index 000000000000..88ae719e6f8f --- /dev/null +++ b/tools/testing/selftests/drivers/net/hw/config @@ -0,0 +1,5 @@ +CONFIG_IPV6=y +CONFIG_IPV6_GRE=y +CONFIG_NET_IPGRE=y +CONFIG_NET_IPG...
db9ae3b6b43c79b1ba87eea849fd65efa05b4b2e
Analyze and fix the following issue in the Linux kernel code: wireguard: device: enable threaded NAPI
Problem Details: Enable threaded NAPI by default for WireGuard devices in response to low performance behavior that we observed when multiple tunnels (and thus multiple wg devices) are deployed on a single host. This affects any kind of multi-tunnel deployment, regardless of whether the tunnels share the same endpoint...
```diff diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c index 3ffeeba5dccf..4a529f1f9bea 100644 --- a/drivers/net/wireguard/device.c +++ b/drivers/net/wireguard/device.c @@ -366,6 +366,7 @@ static int wg_newlink(struct net_device *dev, if (ret < 0) goto err_free_handshake_queue; + de...
fad4cf944839da7f5c3376243aa353295c88f588
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: selftests: Determine effective counter width in arch_timer_edge_cases
Problem Details: arch_timer_edge_cases uses ~0 as the maximum counter value, however there's no architectural guarantee that this is valid. Figure out the effective counter width based on the effective frequency like it's done by the kernel. This also serves as a workaround for AC03_CPU_14 that led to the following a...
```diff diff --git a/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c b/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c index be8bbedc933b..b4d22b3ab7cc 100644 --- a/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c +++ b/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c @@ -22,7 +22,...
05ce38d489dbc96eb1dd700b287f949cb8cc0610
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: selftests: Fix xVAL init in arch_timer_edge_cases
Problem Details: arch_timer_edge_cases hits the following assertion in < 10% of the test runs: ==== Test Assertion Failure ==== arm64/arch_timer_edge_cases.c:490: timer_get_cntct(timer) >= DEF_CNT + (timer_get_cntfrq() * (uint64_t)(delta_2_ms) / 1000) pid=17110 tid=17110 errno=4 - Interrupted system call 1 0...
```diff diff --git a/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c b/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c index a813b4c6c817..be8bbedc933b 100644 --- a/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c +++ b/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c @@ -191,8 +19...
050632ae6571d0f148fa0d4b90b6409a12645461
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: selftests: Fix thread migration in arch_timer_edge_cases
Problem Details: arch_timer_edge_cases tries to migrate itself across host cpus. Before the first test, it migrates to cpu 0 by setting up an affinity mask with only bit 0 set. After that it looks for the next possible cpu in the current affinity mask which still has only bit 0 set. So there is no migration at all. Fi...
```diff diff --git a/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c b/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c index c4716e0c1438..a813b4c6c817 100644 --- a/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c +++ b/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c @@ -849,17 +8...
9a9864fd09c7e52440c05e70609bf5ee8da425d0
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: selftests: Fix help text for arch_timer_edge_cases
Problem Details: Fix the help text for arch_timer_edge_cases to show the correct option for setting the wait time. Signed-off-by: Sebastian Ott <sebott@redhat.com> Link: https://lore.kernel.org/r/20250605103613.14544-2-sebott@redhat.com Signed-off-by: Marc Zyngier <maz@kernel.org>
```diff diff --git a/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c b/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c index a36a7e2db434..c4716e0c1438 100644 --- a/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c +++ b/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c @@ -986,7 +98...
6678791ee3da0b78c28fe7d77814097f53cbb8df
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Add assignment-specific sysreg accessor
Problem Details: Assigning a value to a system register doesn't do what it is supposed to be doing if that register is one that has RESx bits. The main problem is that we use __vcpu_sys_reg(), which can be used both as a lvalue and rvalue. When used as a lvalue, the bit masking occurs *before* the new value is assigne...
```diff diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index d941abc6b5ee..3b84ad91116b 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -1107,6 +1107,17 @@ static inline u64 *___ctxt_sys_reg(const struct kvm_cpu_context *ctxt, int r) #define...
91274fd4ed9ba110b02c53d71d2778b7d13b49ac
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Fix warning in ivpu_gem_bo_free()
Problem Details: Don't WARN if imported buffers are in use in ivpu_gem_bo_free() as they can be indeed used in the original context/driver. Fixes: 647371a6609d ("accel/ivpu: Add GEM buffer object management") Cc: stable@vger.kernel.org # v6.3 Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Reviewed-by: Lizhi Hou <...
```diff diff --git a/drivers/accel/ivpu/ivpu_gem.c b/drivers/accel/ivpu/ivpu_gem.c index 5908268ca45e..248bfebeaa22 100644 --- a/drivers/accel/ivpu/ivpu_gem.c +++ b/drivers/accel/ivpu/ivpu_gem.c @@ -285,7 +285,8 @@ static void ivpu_gem_bo_free(struct drm_gem_object *obj) list_del(&bo->bo_list_node); mutex_unlock(&v...
8337204c58899fe422db765b481711eb2d95eb0b
Analyze and fix the following issue in the Linux kernel code: futex: Handle invalid node numbers supplied by user
Problem Details: syzbot used a negative node number which was not rejected early and led to invalid memory access in node_possible(). Reject negative node numbers except for FUTEX_NO_NODE. [bigeasy: Keep the FUTEX_NO_NODE check] Closes: https://lore.kernel.org/all/6835bfe3.a70a0220.253bc2.00b5.GAE@google.com/ Fixes:...
```diff diff --git a/kernel/futex/core.c b/kernel/futex/core.c index 565f9717c6ca..b652d2f60c40 100644 --- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -583,8 +583,8 @@ int get_futex_key(u32 __user *uaddr, unsigned int flags, union futex_key *key, if (futex_get_value(&node, naddr)) return -EFAULT; - if ...
0ecb4232fc65e659ca7020f8bb2e0fc347acfb7d
Analyze and fix the following issue in the Linux kernel code: selftests/futex: Set the home_node in futex_numa_mpol
Problem Details: The test fails at the MPOL step if multiple nodes are available. The reason is that mbind() sets the policy but the home_node, which is retrieved by the futex code, is not set. This causes to retrieve the current node and with multiple nodes it fails on one of the iterations. Use numa_set_mempolicy_ho...
```diff diff --git a/tools/testing/selftests/futex/functional/futex_numa_mpol.c b/tools/testing/selftests/futex/functional/futex_numa_mpol.c index 564dbd02d2f4..a9ecfb2d3932 100644 --- a/tools/testing/selftests/futex/functional/futex_numa_mpol.c +++ b/tools/testing/selftests/futex/functional/futex_numa_mpol.c @@ -210,6...
1a9dcf69c7a97e733aa2fc026db22f22928ca7b7
Analyze and fix the following issue in the Linux kernel code: selftests/futex: getopt() requires int as return value.
Problem Details: Mark reported that futex_priv_hash fails on ARM64. It turns out that the command line parsing does not terminate properly and ends in the default case assuming an invalid option was passed. Use an int as the return type for getopt(). Closes: https://lore.kernel.org/all/31869a69-063f-44a3-a079-ba71b25...
```diff diff --git a/tools/testing/selftests/futex/functional/futex_numa_mpol.c b/tools/testing/selftests/futex/functional/futex_numa_mpol.c index 20a9d3ecf743..564dbd02d2f4 100644 --- a/tools/testing/selftests/futex/functional/futex_numa_mpol.c +++ b/tools/testing/selftests/futex/functional/futex_numa_mpol.c @@ -144,7...
3172fb986666dfb71bf483b6d3539e1e587fa197
Analyze and fix the following issue in the Linux kernel code: perf/core: Fix WARN in perf_cgroup_switch()
Problem Details: There may be concurrency between perf_cgroup_switch and perf_cgroup_event_disable. Consider the following scenario: after a new perf cgroup event is created on CPU0, the new event may not trigger a reprogramming, causing ctx->is_active to be 0. In this case, when CPU1 disables this perf event, it execu...
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index d78608323916..d7cf008f3d75 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -207,6 +207,19 @@ static void perf_ctx_unlock(struct perf_cpu_context *cpuctx, __perf_ctx_unlock(&cpuctx->ctx); } +typedef struct { + struct perf_cpu_con...
3b7a34aebbdf2a4b7295205bf0c654294283ec82
Analyze and fix the following issue in the Linux kernel code: perf: Fix dangling cgroup pointer in cpuctx
Problem Details: Commit a3c3c6667("perf/core: Fix child_total_time_enabled accounting bug at task exit") moves the event->state update to before list_del_event(). This makes the event->state test in list_del_event() always false; never calling perf_cgroup_event_disable(). As a result, cpuctx->cgrp won't be cleared pro...
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index 1cc98b9b3c0b..d78608323916 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -2120,18 +2120,6 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx) if (event->group_leader == event) del_event_from_groups(even...
61988e36dc5457cdff7ae7927e8d9ad1419ee998
Analyze and fix the following issue in the Linux kernel code: perf: Fix cgroup state vs ERROR
Problem Details: While chasing down a missing perf_cgroup_event_disable() elsewhere, Leo Yan found that both perf_put_aux_event() and perf_remove_sibling_event() were also missing one. Specifically, the rule is that events that switch to OFF,ERROR need to call perf_cgroup_event_disable(). Unify the disable paths to e...
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index 26dec1d8a5ab..1cc98b9b3c0b 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -2149,8 +2149,9 @@ perf_aux_output_match(struct perf_event *event, struct perf_event *aux_event) } static void put_event(struct perf_event *event); -stati...
4f6fc782128355931527cefe3eb45338abd8ab39
Analyze and fix the following issue in the Linux kernel code: perf: Fix sample vs do_exit()
Problem Details: Baisheng Gao reported an ARM64 crash, which Mark decoded as being a synchronous external abort -- most likely due to trying to access MMIO in bad ways. The crash further shows perf trying to do a user stack sample while in exit_mmap()'s tlb_finish_mmu() -- i.e. while tearing down the address space it ...
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index f34c99f8ce8f..26dec1d8a5ab 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -7439,6 +7439,10 @@ perf_sample_ustack_size(u16 stack_size, u16 header_size, if (!regs) return 0; + /* No mm, no stack, no dump. */ + if (!current->mm)...
a47e36dc5d90dc664cac87304c17d50f1595d634
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Trigger device recovery on engine reset/resume failure
Problem Details: Trigger full device recovery when the driver fails to restore device state via engine reset and resume operations. This is necessary because, even if submissions from a faulty context are blocked, the NPU may still process previously submitted faulty jobs if the engine reset fails to abort them. Such j...
```diff diff --git a/drivers/accel/ivpu/ivpu_job.c b/drivers/accel/ivpu/ivpu_job.c index 1c8e283ad985..fae8351aa330 100644 --- a/drivers/accel/ivpu/ivpu_job.c +++ b/drivers/accel/ivpu/ivpu_job.c @@ -986,7 +986,8 @@ void ivpu_context_abort_work_fn(struct work_struct *work) return; if (vdev->fw->sched_mode == VPU_...
98d3f772ca7d6822bdfc8c960f5f909574db97c9
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Use dma_resv_lock() instead of a custom mutex
Problem Details: This fixes a potential race conditions in: - ivpu_bo_unbind_locked() where we modified the shmem->sgt without holding the dma_resv_lock(). - ivpu_bo_print_info() where we read the shmem->pages without holding the dma_resv_lock(). Using dma_resv_lock() also protects against future syncronisatio...
```diff diff --git a/drivers/accel/ivpu/ivpu_gem.c b/drivers/accel/ivpu/ivpu_gem.c index c193a80241f5..5908268ca45e 100644 --- a/drivers/accel/ivpu/ivpu_gem.c +++ b/drivers/accel/ivpu/ivpu_gem.c @@ -33,6 +33,16 @@ static inline void ivpu_dbg_bo(struct ivpu_device *vdev, struct ivpu_bo *bo, con (bool)bo->base.base.i...
714d02b41939d2720379e11ef25227aec4e5bec9
Analyze and fix the following issue in the Linux kernel code: ovl: fix regression caused by lookup helpers API changes
Problem Details: The lookup helpers API was changed by merge of vfs-6.16-rc1.async.dir to pass a non-const qstr pointer argument to lookup_one*() helpers. All of the callers of this API were changed to pass a pointer to temp copy of qstr, except overlays that was passing a const pointer to dentry->d_name that was chan...
```diff diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index bf722daf19a9..f75c49ceb460 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -1371,7 +1371,7 @@ out: bool ovl_lower_positive(struct dentry *dentry) { struct ovl_entry *poe = OVL_E(dentry->d_parent); - struct qstr *name = &dentry->d...
8af7a919c52f02514a145f995cbdf0deadb8075a
Analyze and fix the following issue in the Linux kernel code: netlink: specs: rt-link: decode ip6gre
Problem Details: Driver tests now require GRE tunnels, while we don't configure them with YNL, YNL will complain when it sees link types it doesn't recognize. Teach it decoding ip6gre tunnels. The attrs are largely the same as IPv4 GRE. Correct the type of encap-limit, but note that this attr is only used in ip6gre, s...
```diff diff --git a/Documentation/netlink/specs/rt-link.yaml b/Documentation/netlink/specs/rt-link.yaml index 6521125162e6..b41b31eebcae 100644 --- a/Documentation/netlink/specs/rt-link.yaml +++ b/Documentation/netlink/specs/rt-link.yaml @@ -1717,7 +1717,7 @@ attribute-sets: type: u8 - name: e...
de92258e3b22bd4ce920715cc91f09d788e5badf
Analyze and fix the following issue in the Linux kernel code: netlink: specs: rt-link: add missing byte-order properties
Problem Details: A number of fields in the ip tunnels are lacking the big-endian designation. I suspect this is not intentional, as decoding the ports with the right endian seems objectively beneficial. Fixes: 6ffdbb93a59c ("netlink: specs: rt_link: decode ip6tnl, vti and vti6 link attrs") Fixes: 077b6022d24b ("doc/ne...
```diff diff --git a/Documentation/netlink/specs/rt-link.yaml b/Documentation/netlink/specs/rt-link.yaml index 5ec3d35b7a38..6521125162e6 100644 --- a/Documentation/netlink/specs/rt-link.yaml +++ b/Documentation/netlink/specs/rt-link.yaml @@ -1685,15 +1685,19 @@ attribute-sets: - name: iflags t...
11709abccf93b08adde95ef313c300b0d4bc28f1
Analyze and fix the following issue in the Linux kernel code: s390/mm: Fix in_atomic() handling in do_secure_storage_access()
Problem Details: Kernel user spaces accesses to not exported pages in atomic context incorrectly try to resolve the page fault. With debug options enabled call traces like this can be seen: BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1523 in_atomic(): 1, irqs_disabled(): 0, non_block: ...
```diff diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index da84ff6770de..8b3f6dd00eab 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -442,6 +442,8 @@ void do_secure_storage_access(struct pt_regs *regs) if (rc) BUG(); } else { + if (faulthandler_disabled()) + return handle_fault_...
501fe52aa908c96f2c9b8d54767938a1a5960354
Analyze and fix the following issue in the Linux kernel code: net: wwan: mhi_wwan_mbim: use correct mux_id for multiplexing
Problem Details: Recent Qualcomm chipsets like SDX72/75 require MBIM sessionId mapping to muxId in the range (0x70-0x8F) for the PCIe tethered use. This has been partially addressed by the referenced commit, mapping the default data call to muxId = 112, but the multiplexed data calls scenario was not properly consider...
```diff diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c index 8755c5e6a65b..c814fbd756a1 100644 --- a/drivers/net/wwan/mhi_wwan_mbim.c +++ b/drivers/net/wwan/mhi_wwan_mbim.c @@ -550,8 +550,8 @@ static int mhi_mbim_newlink(void *ctxt, struct net_device *ndev, u32 if_id, struct mhi_mbim...
1e1f706fc2ce90eaaf3480b3d5f27885960d751c
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211/mac80211: correctly parse S1G beacon optional elements
Problem Details: S1G beacons are not traditional beacons but a type of extension frame. Extension frames contain the frame control and duration fields, followed by zero or more optional fields before the frame body. These optional fields are distinct from the variable length elements. The presence of optional fields i...
```diff diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 420c7f9aa6ee..ce377f7fb912 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -111,6 +111,8 @@ /* bits unique to S1G beacon */ #define IEEE80211_S1G_BCN_NEXT_TBTT 0x100 +#define IEEE80211_S1G_BCN_CSSID 0x200 +#d...
e56a50ff7c12983aba710bd02a2c2ad401379e91
Analyze and fix the following issue in the Linux kernel code: um: remove "extern" from implementation of sigchld_handler
Problem Details: There is no need to mark the function as extern in the implementation. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202506051226.X8r7X5aa-lkp@intel.com/ Fixes: 8420e08fe3a5 ("um: Track userspace children dying in SECCOMP mode") Signed-off-by: Benjamin Be...
```diff diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index f1787be3983c..0dfaf96bb7da 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -691,8 +691,8 @@ void __init init_IRQ(void) os_setup_epoll(); } -extern void sigchld_handler(int sig, struct siginfo *unused_si, - struct uml_pt_re...
27a041040f2c6cfbbc24053bce9acb2e801e4e71
Analyze and fix the following issue in the Linux kernel code: um: fix unused variable warning
Problem Details: The code was updated to access the PID of the userspace stub process in a different way, making the local cpu variable obsolete. Remove it. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202506050008.AwXLNxQX-lkp@intel.com/ Fixes: 406d17c6c370 ("um: Implem...
```diff diff --git a/arch/x86/um/tls_32.c b/arch/x86/um/tls_32.c index 21cbb70cf771..cb3f17627d16 100644 --- a/arch/x86/um/tls_32.c +++ b/arch/x86/um/tls_32.c @@ -25,7 +25,6 @@ int host_gdt_entry_tls_min; static int do_set_thread_area(struct task_struct* task, struct user_desc *info) { int ret; - u32 cpu; if (i...
bc1a65eb81a21e2aa3c3dca058ee8adf687b6ef5
Analyze and fix the following issue in the Linux kernel code: net: dsa: b53: do not touch DLL_IQQD on bcm53115
Problem Details: According to OpenMDK, bit 2 of the RGMII register has a different meaning for BCM53115 [1]: "DLL_IQQD 1: In the IDDQ mode, power is down0: Normal function mode" Configuring RGMII delay works without setting this bit, so let's keep it at the default. For other chips, we alway...
```diff diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index be4493b769f4..862bdccb7439 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1354,8 +1354,7 @@ static void b53_adjust_531x5_rgmii(struct dsa_switch *ds, int port, * tx_clk aligned tim...
5ea0d42c1980e6d10e5cb56a78021db5bfcebaaf
Analyze and fix the following issue in the Linux kernel code: net: dsa: b53: allow RGMII for bcm63xx RGMII ports
Problem Details: Add RGMII to supported interfaces for BCM63xx RGMII ports so they can be actually used in RGMII mode. Without this, phylink will fail to configure them: [ 3.580000] b53-switch 10700000.switch GbE3 (uninitialized): validation of rgmii with support 0000000,00000000,00000000,000062ff and advertisemen...
```diff diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 3f4934f974c8..be4493b769f4 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1439,6 +1439,10 @@ static void b53_phylink_get_caps(struct dsa_switch *ds, int port, __set_bit(PHY_INTERFAC...
75f4f7b2b13008803f84768ff90396f9d7553221
Analyze and fix the following issue in the Linux kernel code: net: dsa: b53: do not configure bcm63xx's IMP port interface
Problem Details: The IMP port is not a valid RGMII interface, but hard wired to internal, so we shouldn't touch the undefined register B53_RGMII_CTRL_IMP. While this does not seem to have any side effects, let's not touch it at all, so limit RGMII configuration on bcm63xx to the actual RGMII ports. Fixes: ce3bf94871f...
```diff diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index c186ee3fb28d..3f4934f974c8 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -22,6 +22,7 @@ #include <linux/gpio.h> #include <linux/kernel.h> #include <linux/math.h> +#include <linux/m...
4af523551d876ab8b8057d1e5303a860fd736fcb
Analyze and fix the following issue in the Linux kernel code: net: dsa: b53: do not enable RGMII delay on bcm63xx
Problem Details: bcm63xx's RGMII ports are always in MAC mode, never in PHY mode, so we shouldn't enable any delays and let the PHY handle any delays as necessary. This fixes using RGMII ports with normal PHYs like BCM54612E, which will handle the delay in the PHY. Fixes: ce3bf94871f7 ("net: dsa: b53: add support for...
```diff diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 8a6a370c8580..c186ee3fb28d 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1330,24 +1330,7 @@ static void b53_adjust_63xx_rgmii(struct dsa_switch *ds, int port, off = B53_RGMII_CTRL...
1237c2d4a8db79dfd4369bff6930b0e385ed7d5c
Analyze and fix the following issue in the Linux kernel code: net: dsa: b53: do not enable EEE on bcm63xx
Problem Details: BCM63xx internal switches do not support EEE, but provide multiple RGMII ports where external PHYs may be connected. If one of these PHYs are EEE capable, we may try to enable EEE for the MACs, which then hangs the system on access of the (non-existent) EEE registers. Fix this by checking if the switc...
```diff diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 132683ed3abe..8a6a370c8580 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -2353,6 +2353,9 @@ int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy) { int ret; +...
919d763d609428c2680ec8159257d9655f002f89
Analyze and fix the following issue in the Linux kernel code: net: ti: icssg-prueth: Fix swapped TX stats for MII interfaces.
Problem Details: In MII mode, Tx lines are swapped for port0 and port1, which means Tx port0 receives data from PRU1 and the Tx port1 receives data from PRU0. This is an expected hardware behavior and reading the Tx stats needs to be handled accordingly in the driver. Update the driver to read Tx stats from the PRU1 fo...
```diff diff --git a/drivers/net/ethernet/ti/icssg/icssg_stats.c b/drivers/net/ethernet/ti/icssg/icssg_stats.c index e8241e998aa9..7159baa0155c 100644 --- a/drivers/net/ethernet/ti/icssg/icssg_stats.c +++ b/drivers/net/ethernet/ti/icssg/icssg_stats.c @@ -28,6 +28,14 @@ void emac_update_hardware_stats(struct prueth_emac...
3c3c3248496a3a1848ec5d923f2eee0edf60226e
Analyze and fix the following issue in the Linux kernel code: selftests: netfilter: nft_nat.sh: add test for reverse clash with nat
Problem Details: This will fail without the previous bug fix because we erronously believe that the clashing entry went way. However, the clash exists in the opposite direction due to an existing nat mapping: PASS: IP statless for ns2-LgTIuS ERROR: failed to test udp ns1-x4iyOW to ns2-LgTIuS with dnat rule step 2, r...
```diff diff --git a/tools/testing/selftests/net/netfilter/nft_nat.sh b/tools/testing/selftests/net/netfilter/nft_nat.sh index 9e39de26455f..a954754b99b3 100755 --- a/tools/testing/selftests/net/netfilter/nft_nat.sh +++ b/tools/testing/selftests/net/netfilter/nft_nat.sh @@ -866,6 +866,24 @@ EOF ip netns exec "$ns0" n...
50d9ce9679dd50df2dc51ada717fa875bc248fad
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_nat: also check reverse tuple to obtain clashing entry
Problem Details: The logic added in the blamed commit was supposed to only omit nat source port allocation if neither the existing nor the new entry are subject to NAT. However, its not enough to lookup the conntrack based on the proposed tuple, we must also check the reverse direction. Otherwise there are esoteric c...
```diff diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c index aad84aabd7f1..f391cd267922 100644 --- a/net/netfilter/nf_nat_core.c +++ b/net/netfilter/nf_nat_core.c @@ -248,7 +248,7 @@ static noinline bool nf_nat_used_tuple_new(const struct nf_conntrack_tuple *tuple, const struct nf_conn...
38399f2b0fe4d44226bfb7eba9e137251c8b2571
Analyze and fix the following issue in the Linux kernel code: selftests: netfilter: nft_concat_range.sh: add datapath check for map fill bug
Problem Details: commit 0935ee6032df ("selftests: netfilter: add test case for recent mismatch bug") added a regression check for incorrect initial fill of the result map that was fixed with 791a615b7ad2 ("netfilter: nf_set_pipapo: fix initial map fill"). The test used 'nft get element', i.e., control plane checks for...
```diff diff --git a/tools/testing/selftests/net/netfilter/nft_concat_range.sh b/tools/testing/selftests/net/netfilter/nft_concat_range.sh index 86b8ce742700..cd12b8b5ac0e 100755 --- a/tools/testing/selftests/net/netfilter/nft_concat_range.sh +++ b/tools/testing/selftests/net/netfilter/nft_concat_range.sh @@ -378,7 +37...
ea77c397bff8b6d59f6d83dae1425b08f465e8b5
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_set_pipapo_avx2: fix initial map fill
Problem Details: If the first field doesn't cover the entire start map, then we must zero out the remainder, else we leak those bits into the next match round map. The early fix was incomplete and did only fix up the generic C implementation. A followup patch adds a test case to nft_concat_range.sh. Fixes: 791a615b7...
```diff diff --git a/net/netfilter/nft_set_pipapo_avx2.c b/net/netfilter/nft_set_pipapo_avx2.c index c15db28c5ebc..be7c16c79f71 100644 --- a/net/netfilter/nft_set_pipapo_avx2.c +++ b/net/netfilter/nft_set_pipapo_avx2.c @@ -1113,6 +1113,25 @@ bool nft_pipapo_avx2_estimate(const struct nft_set_desc *desc, u32 features, ...
9d9fca62dc49d96f97045b6d8e7402a95f8cf92a
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc_submit: add back fix
Problem Details: Daniele noticed that the fix in commit 2d2be279f1ca ("drm/xe: fix UAF around queue destruction") looks to have been unintentionally removed as part of handling a conflict in some past merge commit. Add it back. Fixes: ac44ff7cec33 ("Merge tag 'drm-xe-fixes-2024-10-10' of https://gitlab.freedesktop.org...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index 80f748baad3f..2b61d017eeca 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -229,6 +229,17 @@ static bool exec_queue_killed_or_banned_or_wedged(struct xe_exec_queue *q) static v...
5dc1ea903588a73fb03b3a3e5a041a7c63a4bccd
Analyze and fix the following issue in the Linux kernel code: drm/panel-simple: fix the warnings for the Evervision VGG644804
Problem Details: The panel lacked the connector type which causes a warning. Adding the connector type reveals wrong bus_flags and bits per pixel. Fix all of it. Fixes: 1319f2178bdf ("drm/panel-simple: add Evervision VGG644804 panel entry") Signed-off-by: Michael Walle <mwalle@kernel.org> Reviewed-by: Neil Armstrong <...
```diff diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 33a37539de57..3aaac96c0bfb 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -2199,13 +2199,14 @@ static const struct display_timing evervision_vgg644804_timing = { stati...
4d20c1b073e6b501ec82db2d409f27a8eccb2b5e
Analyze and fix the following issue in the Linux kernel code: dt-bindings: vendor-prefixes: Add prefix for Huiling
Problem Details: Shenzhen Huiling Information Technology Co. Ltd. specializes in the research and manufacturing of display and touch screens for industrial usage. https://en.szhuiling.com/ Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by...
```diff diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 6136c8832a66..30c8def3c3ab 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -670,6 +670,8 @@ patte...
cf8651f7319d12a6fd81e1d001afb0958ee2bf28
Analyze and fix the following issue in the Linux kernel code: riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions
Problem Details: The Firmware Features extension (FWFT) was added as part of the SBI 3.0 specification. Add SBI definitions to use this extension. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Tested-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by...
```diff diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 3d250824178b..bb077d0c912f 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -35,6 +35,7 @@ enum sbi_ext_id { SBI_EXT_DBCN = 0x4442434E, SBI_EXT_STA = 0x535441, SBI_EXT_NACL = 0x4E41434C, + SBI_EXT...
b55eb6eb2a7427428c59b293a0900131fc849595
Analyze and fix the following issue in the Linux kernel code: pidfs: never refuse ppid == 0 in PIDFD_GET_INFO
Problem Details: In systemd we spotted an issue after switching to ioctl(PIDFD_GET_INFO) for obtaining pid number the pidfd refers to, that for processes with a parent from outer pidns PIDFD_GET_INFO unexpectedly yields -ESRCH [1]. It turned out that there's an arbitrary check blocking this, which is not really sensibl...
```diff diff --git a/fs/pidfs.c b/fs/pidfs.c index c1f0a067be40..69919be1c9d8 100644 --- a/fs/pidfs.c +++ b/fs/pidfs.c @@ -366,7 +366,7 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg) kinfo.pid = task_pid_vnr(task); kinfo.mask |= PIDFD_INFO_PID; - if (kinfo.pid == 0 || kinfo.tgid...
3d11125ff624b540334f7134d98b94f3b980e85d
Analyze and fix the following issue in the Linux kernel code: bcachefs: add cond_resched() to handle_overwrites()
Problem Details: Fix soft lockup warnings in btree nodes can. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/btree_node_scan.c b/fs/bcachefs/btree_node_scan.c index 5a97a6b8a757..a35847734a60 100644 --- a/fs/bcachefs/btree_node_scan.c +++ b/fs/bcachefs/btree_node_scan.c @@ -363,6 +363,8 @@ static int handle_overwrites(struct bch_fs *c, min_heap_sift_down(nodes_heap, 0, &found_btree_node_h...
29cc6fb7c068c773049d3bde14b939033893eff4
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix subvol to missing root repair
Problem Details: We had a bug where the root inode of a subvolume was erronously deleted: bch2_evict_inode() called bch2_inode_rm(), meaning the VFS inode's i_nlink was somehow set to 0 when it shouldn't have - the inode in the btree indicated it clearly was not unlinked. This has been addressed with additional safety...
```diff diff --git a/fs/bcachefs/subvolume.c b/fs/bcachefs/subvolume.c index 60c10365c285..020587449123 100644 --- a/fs/bcachefs/subvolume.c +++ b/fs/bcachefs/subvolume.c @@ -130,10 +130,20 @@ static int check_subvol(struct btree_trans *trans, "subvolume %llu points to missing subvolume root %llu:%u", ...
09fb85ae565645b982e9030dbb2ff6707f2cdddc
Analyze and fix the following issue in the Linux kernel code: bcachefs: Run may_delete_deleted_inode() checks in bch2_inode_rm()
Problem Details: We had a bug where bch2_evict_inode() incorrectly called bch2_inode_rm() - the journal clearly showed the inode was not unlinked. We've got checks that we use in recovery when cleaning up deleted inodes, lift them to bch2_inode_rm() as well. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/errcode.h b/fs/bcachefs/errcode.h index 6e0bf7ff2641..ac3264134a15 100644 --- a/fs/bcachefs/errcode.h +++ b/fs/bcachefs/errcode.h @@ -214,6 +214,8 @@ x(EINVAL, remove_would_lose_data) \ x(EINVAL, no_resize_with_buckets_nouse) \ x(EINVAL, inode_unpack_error) \ + x(EINVAL...
9f2dc5f39431a17d304e5845a3f7e78905473442
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix oops in btree_node_seq_matches()
Problem Details: btree_update_nodes_written() needs to wait on in-flight writes to old nodes before marking them as freed. But it has no reason to pin those old nodes in memory, so some trickyness ensues. The update we're completing deleted references to those nodes from the btree, so we know if they've been evicted t...
```diff diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index e3639008be5c..d2ecb782919b 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -684,12 +684,31 @@ static void btree_update_nodes_written(struct btree_update *as) /* * Wai...
2bf380c005adcc653464215a5170afa3367c0b22
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix dirent_casefold_mismatch repair
Problem Details: Instead of simply recreating a mis-casefolded dirent, use the str_hash repair code, which will rename it if necessary - the dirent might have been created again with the correct casefolding. Factor out out bch2_str_hash_repair key() from __bch2_str_hash_check_key() for the new path to use, and export ...
```diff diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c index 36bccd2a2763..300f7cc8abdf 100644 --- a/fs/bcachefs/dirent.c +++ b/fs/bcachefs/dirent.c @@ -288,7 +288,7 @@ int bch2_dirent_init_name(struct bkey_i_dirent *dirent, return 0; } -static struct bkey_i_dirent *dirent_create_key(struct btree_trans *...
b938d3c970175b2f3d22865dc077482fc6137828
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix bch2_fsck_rename_dirent() for casefold
Problem Details: bch2_fsck_renamed_dirent was creating bch_dirent keys open-coded - but we need to use the appropriate helper, if the directory is casefolded. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index dedb80f71049..4a72dbdcc0e6 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -2184,6 +2184,10 @@ static int check_dirent(struct btree_trans *trans, struct btree_iter *iter, *hash_info = bch2_hash_info_init(c, &i->inode); dir->first_this_i...
01d925f7e18360f740e7b75bfad9b6e55fd4dc53
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix -Wc23-extensions in bch2_check_dirents()
Problem Details: Clang warns (or errors with CONFIG_WERROR=y): fs/bcachefs/fsck.c:2325:2: error: label followed by a declaration is a C23 extension [-Werror,-Wc23-extensions] 2325 | int ret = bch2_trans_run(c, | ^ On clang-17 and older, this is an unconditional error: fs/bcachefs/fsck....
```diff diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index 458f61c33958..dedb80f71049 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -2313,10 +2313,11 @@ int bch2_check_dirents(struct bch_fs *c) struct snapshots_seen s; struct bch_hash_info hash_info; bool need_second_pass = false, did_second...
dd2922dcfaa3296846265e113309e5f7f138839f
Analyze and fix the following issue in the Linux kernel code: fs/resctrl: Restore the rdt_last_cmd_clear() calls after acquiring rdtgroup_mutex
Problem Details: A lockdep fix removed two rdt_last_cmd_clear() calls that were used to clear the last_cmd_status buffer but called without holding the required rdtgroup_mutex. The impacted resctrl commands are writing to the cpus or cpus_list files and creating a new monitor or control group. With stale data in the l...
```diff diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index cc37f58b47dd..1beb124e25f6 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -536,6 +536,8 @@ static ssize_t rdtgroup_cpus_write(struct kernfs_open_file *of, goto unlock; } + rdt_last_cmd_clear(); + if (rdtgrp->mode == RDT...
079afb081c4288e94d5e4223d3eb6306d853c68b
Analyze and fix the following issue in the Linux kernel code: io_uring/futex: mark wait requests as inflight
Problem Details: Inflight marking is used so that do_exit() -> io_uring_files_cancel() will find requests with files that reference an io_uring instance, so they can get appropriately canceled before the files go away. However, it's also called before the mm goes away. Mark futex/futexv wait requests as being inflight...
```diff diff --git a/io_uring/futex.c b/io_uring/futex.c index 5a3991b0d1a7..692462d50c8c 100644 --- a/io_uring/futex.c +++ b/io_uring/futex.c @@ -145,6 +145,8 @@ int io_futex_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) !futex_validate_input(iof->futex_flags, iof->futex_mask)) return -EINVAL; ...
847a4bf1b4bdcc224196d77714f71e36822fed70
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: pcie: fix non-MSIX handshake register
Problem Details: When reading the interrupt status after a FW reset handshake timeout, read the actual value not the mask for the non-MSIX case. Fixes: ab606dea80c4 ("wifi: iwlwifi: pcie: add support for the reset handshake in MSI") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Emmanuel Grumbach ...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c index 38ad719161e6..c8f4f3a1d2eb 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c @@ -125,7 +125,7 @@ void iwl_tran...
960c7e6d388034d219dafffa6da0a5c2ccd5ff30
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mld: avoid panic on init failure
Problem Details: In case of an error during init, in_hw_restart will be set, but it will never get cleared. Instead, we will retry to init again, and then we will act like we are in a restart when we are actually not. This causes (among others) to a NULL pointer dereference when canceling rx_omi::finished_work, that w...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mld.c b/drivers/net/wireless/intel/iwlwifi/mld/mld.c index 8cdd960c5245..e8820e7cf8fa 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/mld.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/mld.c @@ -653,7 +653,8 @@ iwl_mld_nic_error(struct iwl_op_mode *op_mode...
264c844abb29530b3e16d255f1eb2ccb06316b1f
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: fix assert on suspend
Problem Details: After using DEFINE_RAW_FLEX, cmd is a pointer to iwl_rxq_sync_cmd, and not a variable containing both the command and notification. Adjust hcmd->data and hcmd->len assignment as well. Fixes: 7438843df8cf ("wifi: iwlwifi: mvm: Avoid -Wflex-array-member-not-at-end warning") Signed-off-by: Miri Korenblit...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 0f056a6641bd..956b491ae5a4 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -6360,8 +6360,8 @@ void iwl_mvm_sync_rx_qu...
1a576136f8d7089ef7f427dee8aa919a6edaef69
Analyze and fix the following issue in the Linux kernel code: drm/ttm: Fix compile error when CONFIG_SHMEM is not set
Problem Details: When CONFIG_SHMEM is not set, the following compiler error occurs: ld: vmlinux.o: in function `ttm_backup_backup_page': (.text+0x10363bc): undefined reference to `shmem_writeout' make[3]: *** [/work/build/trace/nobackup/linux.git/scripts/Makefile.vmlinux:91: vmlinux.unstripped] Error 1 This is ...
```diff diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index f094797f3b2b..ded28c71d89c 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -188,6 +188,7 @@ source "drivers/gpu/drm/display/Kconfig" config DRM_TTM tristate depends on DRM && MMU + select SHMEM help GPU memory ...
99e80508980583b1c0150b953b64a629211c4e23
Analyze and fix the following issue in the Linux kernel code: drm/xe: Make VMA tile_present, tile_invalidated access rules clear
Problem Details: Document VMA tile_invalidated access rules, use READ_ONCE / WRITE_ONCE for opportunistic checks of tile_present and tile_invalidated, move tile_invalidated state change from page fault handler to PT code under the correct locks, and add lockdep asserts to TLB invalidation paths. v2: - Assert VM dma-r...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c index e0e68eda82bd..e2d975b2fddb 100644 --- a/drivers/gpu/drm/xe/xe_gt_pagefault.c +++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c @@ -69,8 +69,12 @@ static bool access_is_atomic(enum access_type access_type) static bool vma_...
791d76005de0ab556b590473eb4cbfede727fce0
Analyze and fix the following issue in the Linux kernel code: drm/i915/display: Fix u32 overflow in SNPS PHY HDMI PLL setup
Problem Details: When configuring the HDMI PLL, calculations use DIV_ROUND_UP_ULL and DIV_ROUND_DOWN_ULL macros, which internally rely on do_div. However, do_div expects a 32-bit (u32) divisor, and at higher data rates, the divisor can exceed this limit. This leads to incorrect division results and ultimately misconfig...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_snps_hdmi_pll.c b/drivers/gpu/drm/i915/display/intel_snps_hdmi_pll.c index c6321dafef4f..74bb3bedf30f 100644 --- a/drivers/gpu/drm/i915/display/intel_snps_hdmi_pll.c +++ b/drivers/gpu/drm/i915/display/intel_snps_hdmi_pll.c @@ -41,12 +41,12 @@ static s64 interp(s64...
12c331b29c7397ac3b03584e12902990693bc248
Analyze and fix the following issue in the Linux kernel code: gve: add missing NULL check for gve_alloc_pending_packet() in TX DQO
Problem Details: gve_alloc_pending_packet() can return NULL, but gve_tx_add_skb_dqo() did not check for this case before dereferencing the returned pointer. Add a missing NULL check to prevent a potential NULL pointer dereference when allocation fails. This improves robustness in low-memory scenarios. Fixes: a57e5de...
```diff diff --git a/drivers/net/ethernet/google/gve/gve_tx_dqo.c b/drivers/net/ethernet/google/gve/gve_tx_dqo.c index a27f1574a733..9d705d94b065 100644 --- a/drivers/net/ethernet/google/gve/gve_tx_dqo.c +++ b/drivers/net/ethernet/google/gve/gve_tx_dqo.c @@ -764,6 +764,9 @@ static int gve_tx_add_skb_dqo(struct gve_tx_r...
531bef26d189b28bf0d694878c0e064b30990b6c
Analyze and fix the following issue in the Linux kernel code: drm/xe/svm: Fix regression disallowing 64K SVM migration
Problem Details: When changing the condition from >= SZ_64K, it was changed to <= SZ_64K. This disallows migration of 64K, which is the exact minimum allowed. Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/5057 Fixes: a9ac0fa455b0 ("drm/xe: Strict migration policy for atomic SVM faults") Cc: stable@vger...
```diff diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c index f27fb9b588de..83c63fd7b481 100644 --- a/drivers/gpu/drm/xe/xe_svm.c +++ b/drivers/gpu/drm/xe/xe_svm.c @@ -820,7 +820,7 @@ bool xe_svm_range_needs_migrate_to_vram(struct xe_svm_range *range, struct xe_vm return false; } - if (pre...
942349413a49670e8bed246e2185fd3a053227be
Analyze and fix the following issue in the Linux kernel code: um: fix SECCOMP 32bit xstate register restore
Problem Details: There was a typo that caused the extended FP state to be copied into the wrong location on 32 bit. On 32 bit we only store the xstate internally as that already contains everything. However, for compatibility, the mcontext on 32 bit first contains the legacy FP state and then the xstate. The code copi...
```diff diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c index 49015be1aaaf..a827c2e01aa5 100644 --- a/arch/um/os-Linux/start_up.c +++ b/arch/um/os-Linux/start_up.c @@ -296,10 +296,6 @@ static bool __init init_seccomp(void) int n; unsigned long sp; - /* doesn't work on 32-bit right now */ - ...