id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
d9d021218162b6c4fe0bdf42b2b340f1aae23a12
Analyze and fix the following issue in the Linux kernel code: accel/ethosu: reject DMA commands with uninitialized length
Problem Details: cmd_state_init() initializes the command state with memset(0xff), leaving dma->len at U64_MAX to signal missing setup. The only setter is NPU_SET_DMA0_LEN; if userspace omits this command and issues NPU_OP_DMA_START, dma->len remains U64_MAX. In dma_length(), a positive stride added to U64_MAX wraps t...
```diff diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index 27c5fdbe9a5d..2cb7964ddfa5 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -164,6 +164,9 @@ static u64 dma_length(struct ethosu_validated_cmdstream_info *info, s8 mode = dma_st->m...
ee6d9b6e51626f259c6f0e38d94f91be4fd14754
Analyze and fix the following issue in the Linux kernel code: accel/ethosu: fix arithmetic issues in dma_length()
Problem Details: dma_length() derives DMA region usage from command stream values and updates region_size[]: len = ((len + stride[0]) * size0 + stride[1]) * size1 region_size[region] = max(..., len + dma->offset) Several arithmetic issues can corrupt the derived region size: - signed stride values may underf...
```diff diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index 52b6a8752c75..27c5fdbe9a5d 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -2,6 +2,7 @@ /* Copyright 2025 Arm, Ltd. */ #include <linux/err.h> +#include <linux/overflow.h> #incl...
e703843f242b28e35ac79408de571ae110c740b5
Analyze and fix the following issue in the Linux kernel code: accel/ethosu: fix wrong weight index in NPU_SET_SCALE1_LENGTH on U85
Problem Details: On non-U65 hardware (e.g. U85), opcode 0x4093 is NPU_SET_WEIGHT2_LENGTH. The BASE handler for the same opcode correctly assigns to st.weight[2].base, but the LENGTH handler mistakenly assigns cmds[1] to st.weight[1].length instead of st.weight[2].length. This leaves weight[2].length at its initialised...
```diff diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index 863cdadb137a..52b6a8752c75 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -598,7 +598,7 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev, if (ethosu...
ef911805d86a05363d3ec2fa9835a41def83bb7e
Analyze and fix the following issue in the Linux kernel code: accel/ethosu: reject NPU_OP_RESIZE commands from userspace
Problem Details: NPU_OP_RESIZE is a U85-only command that the driver does not yet implement. The existing WARN_ON(1) placeholder fires unconditionally whenever userspace submits this command via DRM_IOCTL_ETHOSU_GEM_CREATE, causing unbounded kernel log spam. If panic_on_warn is set the kernel panics, giving any unpriv...
```diff diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index ced99cf9cdfc..863cdadb137a 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -431,8 +431,7 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev, return re...
66782cfa0085369e2d8c861042f7c6d43431bdb3
Analyze and fix the following issue in the Linux kernel code: cxl/pci: Fix the incorrect check of pci_read_config_word() return
Problem Details: pci_read_config_word() returns PCIBIOS_* status on error which are positive values. The check should be for non-zero values to indicate error. Fix cxl_set_mem_enable() to check for non-zero return value instead of negative value. While fixing this, also convert the error to negative errno value when r...
```diff diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c index d1f487b3d809..43885c59a7f2 100644 --- a/drivers/cxl/core/pci.c +++ b/drivers/cxl/core/pci.c @@ -187,8 +187,8 @@ static int cxl_set_mem_enable(struct cxl_dev_state *cxlds, u16 val) int rc; rc = pci_read_config_word(pdev, d + PCI_DVSEC_CXL_C...
00f547e0dfecf83014fb32bcba587c6b684c1362
Analyze and fix the following issue in the Linux kernel code: accel/ethosu: fix IFM region index out-of-bounds in command stream parser
Problem Details: NPU_SET_IFM_REGION extracts the region index with param & 0x7f, giving a maximum value of 127. However region_size[] and output_region[] in struct ethosu_validated_cmdstream_info are both sized to NPU_BASEP_REGION_MAX (8), giving valid indices [0..7]. Every other region assignment in the same switch u...
```diff diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index 7994e7073903..ced99cf9cdfc 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -464,7 +464,7 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev, st.ifm.bro...
fa20c1f8f4e094abe0169d39fce8181bc26d6dab
Analyze and fix the following issue in the Linux kernel code: perf sched: Fix thread reference leaks in timehist_get_thread()
Problem Details: timehist_get_thread() acquires a thread reference via machine__findnew_thread() and an idle thread reference via get_idle_thread() (which calls thread__get()). Two error paths in the idle_hist block return NULL without releasing these references: - When get_idle_thread() fails, the thread reference ...
```diff diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 4aa7833cae6e..7bd61028327b 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -2546,12 +2546,16 @@ static struct thread *timehist_get_thread(struct perf_sched *sched, idle = get_idle_thread(sample->cpu); ...
1e7921d7227de5da0dfc167943092c823ec7e49b
Analyze and fix the following issue in the Linux kernel code: perf tools: Add bounds check to cpu__get_node()
Problem Details: cpu__get_node() accesses cpunode_map[cpu.cpu] without checking against max_cpu_num, the allocation size of cpunode_map. Callers such as builtin-kmem.c:evsel__process_alloc_event() pass sample->cpu from perf.data events, which may exceed the host's CPU count when analyzing cross-machine recordings. Ad...
```diff diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index b1e5c29c6e3e..d3432622b2ad 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -576,6 +576,10 @@ int cpu__get_node(struct perf_cpu cpu) return -1; } + /* cpunode_map allocated for max_cpu_num entries; input may be ...
7ccd2e6cecd5bb02a5a15f0dd7199d1e81380bda
Analyze and fix the following issue in the Linux kernel code: perf tools: Guard remaining test_bit calls from OOB sample CPU
Problem Details: auxtrace.c:filter_cpu() and builtin-script.c:filter_cpu() call test_bit(cpu, cpu_bitmap) where cpu_bitmap is declared with MAX_NR_CPUS bits. When the CPU value from a perf.data event is corrupt or absent (e.g. negative or >= MAX_NR_CPUS), test_bit reads out of bounds. Add bounds checks before test_bi...
```diff diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index f4aa255fc329..9ac29bdc3cd5 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -2646,7 +2646,7 @@ static int cleanup_scripting(void) static bool filter_cpu(struct perf_sample *sample) { - if (cpu_list && s...
1ec3cca2d8b6b9ff6584ca626d4c8918bbf48d44
Analyze and fix the following issue in the Linux kernel code: ocfs2: fix out-of-bounds write in ocfs2_remove_refcount_extent
Problem Details: [BUG] Unlinking a refcounted file whose refcount tree has leaf blocks triggers a fortify panic due to an out-of-bounds write. [CAUSE] When the last leaf block is removed from a refcount tree, ocfs2_remove_refcount_extent() converts the root back to leaf mode with a bulk memset on &rb->rf_records. rf_r...
```diff diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 8eee5be4d1ed..7323bde70caa 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -2131,10 +2131,15 @@ static int ocfs2_remove_refcount_extent(handle_t *handle, rb->rf_flags = 0; rb->rf_parent = 0; rb->rf_cpos = 0; - m...
57dcfd9049d497c31151787a0696d59f0a98f8e6
Analyze and fix the following issue in the Linux kernel code: ocfs2: fix race between ocfs2_control_install_private() and ocfs2_control_release()
Problem Details: Move atomic_inc(&ocfs2_control_opened) and the handshake state update inside ocfs2_control_lock to close a race window where ocfs2_control_release() can observe ocfs2_control_opened dropping to zero (resetting ocfs2_control_this_node and running_proto) while ocfs2_control_install_private() is about to ...
```diff diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 5803f1dee679..91e19d33847c 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -327,18 +327,14 @@ static int ocfs2_control_install_private(struct file *file) ocfs2_control_this_node = p->op_this_node; running_proto.pv_major = p...
03ad858ce8064861ea580021976dc19b7aabb549
Analyze and fix the following issue in the Linux kernel code: ocfs2/dlm: require a ref for locking_state debugfs open
Problem Details: debug_lockres_open() copies inode->i_private into struct debug_lockres and debug_lockres_release() later drops that pointer with dlm_put(). That only works if open successfully pins the struct dlm_ctxt. Today open calls dlm_grab(dlm) but ignores its return value. Once the last domain unregister has ...
```diff diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c index fe4fdd09bae3..564567358620 100644 --- a/fs/ocfs2/dlm/dlmdebug.c +++ b/fs/ocfs2/dlm/dlmdebug.c @@ -560,6 +560,7 @@ static int debug_lockres_open(struct inode *inode, struct file *file) struct dlm_ctxt *dlm = inode->i_private; struct debug_l...
ca1afd88f5eaaff9168e1466e5401385edf59543
Analyze and fix the following issue in the Linux kernel code: ocfs2: reject FITRIM ranges shorter than a cluster
Problem Details: ocfs2_trim_mainbm() trims the global bitmap in cluster units, but its too-short range validation only checks sb->s_blocksize. On filesystems with a cluster size larger than the block size, a FITRIM range that is at least one block but shorter than one cluster is accepted and shifted down to len == 0. ...
```diff diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 6e5fd3f12a84..be09e766ac1f 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -7576,7 +7576,7 @@ int ocfs2_trim_mainbm(struct super_block *sb, struct fstrim_range *range) len = range->len >> osb->s_clustersize_bits; minlen = range->minlen >> osb->s...
e234973f286ed2e8961a24561ec91594ec3e3ff8
Analyze and fix the following issue in the Linux kernel code: ocfs2: validate fast symlink target during inode read
Problem Details: ocfs2_validate_inode_block() already rejects several inconsistent self-contained dinodes before they are exposed to the rest of the filesystem. Fast symlinks need the same treatment. A zero-cluster symlink is treated as a fast symlink and later read through page_get_link() and ocfs2_fast_symlink_read...
```diff diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 432eac01c176..6fc29920ecb2 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -1639,6 +1639,29 @@ int ocfs2_validate_inode_block(struct super_block *sb, } } + if (S_ISLNK(le16_to_cpu(di->i_mode)) && + !le32_to_cpu(di->i_clusters)) { + int m...
a291c77c034b7a81849ce9b71cc9ecda9e587d89
Analyze and fix the following issue in the Linux kernel code: ocfs2: add journal NULL check in ocfs2_checkpoint_inode()
Problem Details: During unmount, ocfs2_journal_shutdown() frees the journal and sets osb->journal to NULL. Later, when VFS evicts remaining cached inodes, ocfs2_evict_inode() -> ocfs2_clear_inode() -> ocfs2_checkpoint_inode() -> ocfs2_ci_fully_checkpointed() dereferences osb->journal, causing a NULL pointer dereference...
```diff diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 6397170f302f..f8b3b2a3d630 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -196,6 +196,9 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode) if (ocfs2_mount_local(osb)) return; + if (!osb->journal) + return; + if (!oc...
6371a07148ee979af22a9d6f4c277462953a9a4a
Analyze and fix the following issue in the Linux kernel code: ocfs2: fix buffer head management in ocfs2_read_blocks()
Problem Details: In ocfs2_read_blocks(), caller should't assume that buffer head returned by 'sb_getblk()' is exclusively owned and so 'put_bh()' always drops b_count from 1 to 0. If it is not so, buffer head remains on hold and likely to be returned by the next call to 'sb_getblk()' unchanged - that is, with BH_Uptod...
```diff diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c index 701d27d908d4..6114299b121e 100644 --- a/fs/ocfs2/buffer_head_io.c +++ b/fs/ocfs2/buffer_head_io.c @@ -350,8 +350,6 @@ read_failure: wait_on_buffer(bh); put_bh(bh); bhs[i] = NULL; - } else if (bh && buffer_uptodate(bh)...
9bd541e09dffff27e5bec0f9f45b0228173a5375
Analyze and fix the following issue in the Linux kernel code: ocfs2: reject oversized group bitmap descriptors
Problem Details: ocfs2_validate_gd_parent() only bounds bg_bits against the parent allocator's chain geometry. A malicious descriptor can still claim a bg_size/bg_bits pair that exceeds the bitmap bytes that physically fit in the group descriptor block, so later bitmap scans and bit updates can run past bg_bitmap. Ad...
```diff diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index d284e0e37252..a4a2b87a45fe 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -231,8 +231,16 @@ static int ocfs2_validate_gd_parent(struct super_block *sb, int resize) { unsigned int max_bits; + unsigned int max_bitmap_bits; + u...
9ac9a08e4ac4bc063e56e1aff266c5e8aa5c6c03
Analyze and fix the following issue in the Linux kernel code: lib: kunit_iov_iter: repeatedly call alloc_pages_bulk()
Problem Details: alloc_pages_bulk() is not guaranteed to return all requested pages in a single call. Call it repeatedly until all pages have been allocated or no more progress is being made. Link: https://lore.kernel.org/20260526-kunit_iov_iter-alloc_bulk-v2-1-24fbcd995c61@weissschuh.net Fixes: 2d71340ff1d4 ("iov_it...
```diff diff --git a/lib/tests/kunit_iov_iter.c b/lib/tests/kunit_iov_iter.c index f02f7b7aa796..1e6fce9cb255 100644 --- a/lib/tests/kunit_iov_iter.c +++ b/lib/tests/kunit_iov_iter.c @@ -53,7 +53,7 @@ static void *__init iov_kunit_create_buffer(struct kunit *test, size_t npages) { struct page **pages; - un...
9a79524d1420e6b79a6868208c264f4518d1318e
Analyze and fix the following issue in the Linux kernel code: kcov: use WRITE_ONCE() for selftest mode stores
Problem Details: The KCOV selftest enables coverage by setting current->kcov_mode to KCOV_MODE_TRACE_PC without installing a coverage area. If an interrupt records coverage in that window, the access should fault and expose the bug. When building for QEMU raspi0 (Raspberry Pi Zero, ARMv6, CONFIG_CPU_V6K=y, CONFIG_CUR...
```diff diff --git a/kernel/kcov.c b/kernel/kcov.c index fd2503030729..1df373fb562b 100644 --- a/kernel/kcov.c +++ b/kernel/kcov.c @@ -1119,10 +1119,10 @@ static void __init selftest(void) * potentially traced functions in this region. */ start = jiffies; - current->kcov_mode = KCOV_MODE_TRACE_PC; + WRITE_ONCE(...
93612d48fa42b3d1a637eb9279e15281c611c000
Analyze and fix the following issue in the Linux kernel code: ocfs2: rebase copied fsdlm LVB pointers in locking_state
Problem Details: The locking_state debugfs iterator snapshots struct ocfs2_lock_res by value under ocfs2_dlm_tracking_lock and later formats that copy in ocfs2_dlm_seq_show(). That is fine for the inline fields, but the userspace fsdlm stack stores the LVB through lksb_fsdlm.sb_lvbptr. Once the iterator drops the tra...
```diff diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 7283bb2c5a31..a23dd8f86c89 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3134,6 +3134,22 @@ static void *ocfs2_dlm_seq_next(struct seq_file *m, void *v, loff_t *pos) * - Add last pr/ex unlock times and first lock wait time in usecs */...
13f77972b94c51f6e5b94d672025601363440a94
Analyze and fix the following issue in the Linux kernel code: mm/migrate: find_mm_struct: fix race between security checks and suid exec
Problem Details: The target task can execute a setuid binary between ptrace_may_access() and get_task_mm(). Protect this critical section with exec_update_lock. I don't think cpuset_mems_allowed(task) should be called under exec_update_lock, but this patch just tries to add the minimal fix. Perhaps we can later add ...
```diff diff --git a/mm/migrate.c b/mm/migrate.c index d8090cdda4f9..d9b23909d716 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2555,24 +2555,29 @@ static struct mm_struct *find_mm_struct(pid_t pid, nodemask_t *mem_nodes) } task = find_get_task_by_vpid(pid); - if (!task) { + if (!task) return ERR_PTR(-ESRCH...
3bf1c285dc406067eae5b3a7072afad81ad4a4fc
Analyze and fix the following issue in the Linux kernel code: zram: clear trailing bytes of compressed writeback pages
Problem Details: Patch series "zram: writeback fixes", v2. Brian (privately) reported a "leak" of writeback bitmap in certain cases, so that backing device can store less pages; and a theoretical data leak in the trailing bytes of compressed writeback pages. Both issues are low risk. This patch (of 2): When compre...
```diff diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 602abfe23797..7917fc7a2a29 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -2134,6 +2134,8 @@ static int read_from_zspool_raw(struct zram *zram, struct page *page, u32 index) zs_obj_read_end(zram...
3e8d8eb8d7f5b1ec3993ad4dbb8140a55f789f90
Analyze and fix the following issue in the Linux kernel code: zram: do not leak blk idx at the end of writeback
Problem Details: zram_writeback_slots() loop can terminate with valid reserved backing device blk_idx. The problem is that cleanup code doesn't release that reserved blk_idx before zram_writeback_slots() returns, which leads to blk_idx leak (it becomes permanently busy and can not be used for actual writeback.) This d...
```diff diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 07111455eecf..602abfe23797 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1127,6 +1127,9 @@ next: if (req) release_wb_req(req); + if (blk_idx != INVALID_BDEV_BLOCK) + zram_release_bdev_bl...
29a1ea41456b79d657e5f5deced1239477d03af1
Analyze and fix the following issue in the Linux kernel code: memcg: multi objcg charge support
Problem Details: Commit 01b9da291c49 ("mm: memcontrol: convert objcg to be per-memcg per-node type") split a memcg's single obj_cgroup into one per NUMA node so that reparenting LRU folios can take per-node lru locks. As a side effect, the per-CPU obj_stock_pcp -- which caches exactly one cached_objcg -- thrashes on w...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ac7c99e32f99..e24114a4493a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -150,15 +150,15 @@ static void obj_cgroup_release(struct percpu_ref *ref) * However, it can be PAGE_SIZE or (x * PAGE_SIZE). * * The following sequence can lead to it: -...
7a09fb91c285ba1b253f7c72f86cf37b373afb10
Analyze and fix the following issue in the Linux kernel code: memcg: int16_t for cached slab stats
Problem Details: Currently struct obj_stock_pcp stores cached slab stats in 'int' which is 4 bytes per counter on 64-bit machines. Switch them to int16_t to shrink the cached metadata. The existing PAGE_SIZE flush in __account_obj_stock() bounds *bytes at PAGE_SIZE on 4KiB and 16KiB page archs, well within int16_t. ...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 8bbcc7bc42e3..ac7c99e32f99 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2032,8 +2032,8 @@ struct obj_stock_pcp { uint16_t nr_bytes; #endif int16_t node_id; - int nr_slab_reclaimable_b; - int nr_slab_unreclaimable_b; + int16_t nr_slab_reclaimabl...
37a7f91e44f41f1b4cd60d1f89a4de7cf871d158
Analyze and fix the following issue in the Linux kernel code: memcg: uint16_t for nr_bytes in obj_stock_pcp
Problem Details: Currently struct obj_stock_pcp stores nr_bytes in an 'unsigned int' which is 4 bytes on 64-bit machines. Switch the field to uint16_t to shrink the per-CPU cache. The kernel supports PAGE_SIZE_4KB, _8KB, _16KB, _32KB, _64KB and _256KB (see HAVE_PAGE_SIZE_* in arch/Kconfig). After the PAGE_SIZE-align...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e983fa590af8..8bbcc7bc42e3 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2020,8 +2020,17 @@ static DEFINE_PER_CPU_ALIGNED(struct memcg_stock_pcp, memcg_stock) = { struct obj_stock_pcp { local_trylock_t lock; - unsigned int nr_bytes; struct obj...
e0d4e7405f267ae31ffafd5673ce14d0d9e4cbe0
Analyze and fix the following issue in the Linux kernel code: memcg: store node_id instead of pglist_data pointer
Problem Details: Patch series "memcg: shrink obj_stock_pcp and cache multiple objcgs", v3. Commit 01b9da291c49 ("mm: memcontrol: convert objcg to be per-memcg per-node type") split a memcg's single obj_cgroup into one per NUMA node so that reparenting LRU folios can take per-node lru locks. As a side effect, the per-...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 92269740eef1..e983fa590af8 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2022,7 +2022,7 @@ struct obj_stock_pcp { local_trylock_t lock; unsigned int nr_bytes; struct obj_cgroup *cached_objcg; - struct pglist_data *cached_pgdat; + int16_t node_i...
952923ff200817506a9a5fd1dd1b811745f25746
Analyze and fix the following issue in the Linux kernel code: selftests/memfd: remove unused variable 'sig' in fuse_test
Problem Details: fuse_test.c: In function 'sealing_thread_fn': fuse_test.c:165:13: warning: unused variable 'sig' [-Wunused-variable] 165 | int sig, r; | ^~~ Remove unused 'sig' to fix -Wunused-variable warning. Link: https://lore.kernel.org/20260524193732.48853-3-eva.kurchatova@virt...
```diff diff --git a/tools/testing/selftests/memfd/fuse_test.c b/tools/testing/selftests/memfd/fuse_test.c index dbc171a3806d..510056c1b0d0 100644 --- a/tools/testing/selftests/memfd/fuse_test.c +++ b/tools/testing/selftests/memfd/fuse_test.c @@ -162,7 +162,7 @@ static void *global_p = NULL; static int sealing_threa...
528db7d37e08dc7eae70d046cda5a2ee30208448
Analyze and fix the following issue in the Linux kernel code: selftests/memfd: fix -Wmaybe-uninitialized warning in memfd_test
Problem Details: Patch series "selftests/memfd: fix compilation warnings". This patchset fixes warnings about unused but initialized variables, and unused dummy buffer passed to pwrite() syscall in the tests. This patch (of 2): memfd_test.c: In function 'mfd_fail_grow_write.part.0': memfd_test.c:685:13: warning...
```diff diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c index 2ca07ea7202a..cdab3a837624 100644 --- a/tools/testing/selftests/memfd/memfd_test.c +++ b/tools/testing/selftests/memfd/memfd_test.c @@ -688,9 +688,9 @@ static void mfd_assert_grow_write(int fd) if (huget...
39376b9cac1cef505e1fa9a0a6105cf0de7c6734
Analyze and fix the following issue in the Linux kernel code: mm/vmscan: unify writeback reclaim statistic and throttling
Problem Details: Currently MGLRU and non-MGLRU handle the reclaim statistic and writeback handling very differently, especially throttling. Basically MGLRU just ignored the throttling part. Let's just unify this part, use a helper to deduplicate the code so both setups will share the same behavior. Test using follow...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 7494ac73e3f1..e8a90911bf88 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1946,6 +1946,44 @@ static int current_may_throttle(void) return !(current->flags & PF_LOCAL_THROTTLE); } +static void handle_reclaim_writeback(unsigned long nr_taken, + struct pgli...
0491e9f75c1515ecff3dfb7d7bd4243e6f47027d
Analyze and fix the following issue in the Linux kernel code: mm/mglru: consolidate common code for retrieving evictable size
Problem Details: Patch series "mm/mglru: improve reclaim loop and dirty folio", v7. This series cleans up and slightly improves MGLRU's reclaim loop and dirty writeback handling. As a result, we can see an up to ~30% increase in some workloads like MongoDB with YCSB and a huge decrease in file refault, no swap involv...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 76193a84a2af..5901219dd7fc 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4088,27 +4088,33 @@ static void set_initial_priority(struct pglist_data *pgdat, struct scan_control sc->priority = clamp(priority, DEF_PRIORITY / 2, DEF_PRIORITY); } -static bool lruvec_is...
7e6cc35f5283eab81a14231a64ecd640b690c48c
Analyze and fix the following issue in the Linux kernel code: mm/damon/core: trace esz at first setup
Problem Details: DAMON traces effective size quota from the second update, only if a change has been made by the update. Tracing only changed updates was an intentional decision to avoid unnecessary same value tracing. Always skipping the first value is just an unintended mistake. The mistake makes the tracepoint ba...
```diff diff --git a/mm/damon/core.c b/mm/damon/core.c index b33920873871..265d51ade25b 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2899,6 +2899,8 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s) if (!quota->total_charged_sz && !quota->charged_from) { quota->charged_from = jiffies...
83b25befc1ab1f6e331691c4caf41f919fd082d2
Analyze and fix the following issue in the Linux kernel code: Docs/admin-guide/mm/damon/usage: clarify current_value of quota goals
Problem Details: The sysfs interface for DAMON quota goals includes a `current_value` file. This file is not updated by the kernel and only serves to receive user input. Clarify in the documentation that the kernel does not update `current_value`, and that reading it only has meaning when `target_metric` is set to `us...
```diff diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index d46875e603d8..011296f1e7c2 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -474,10 +474,12 @@ to ``N-1``. Each directory represents each...
d63e9d829e42b29201ebbcf0a070acea8ed40b2c
Analyze and fix the following issue in the Linux kernel code: mm/damon: fix missing parens in macro arguments
Problem Details: Patch series "mm/damon: fix macro arguments and clarify quota goals doc", v2. This patch (of 2): The DAMON iterator macros do not wrap their pointer arguments with parentheses. This can cause build failures when the argument is a complex expression due to operator precedence issues. Add missing pa...
```diff diff --git a/include/linux/damon.h b/include/linux/damon.h index 638ee65f88dc..6f7edb3590ef 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -963,13 +963,13 @@ static inline unsigned long damon_sz_region(struct damon_region *r) list_for_each_entry_safe(p, next, &(ctx)->probes, list) #defin...
4c0ed883e0516aee79496b6277cbea63a08b2676
Analyze and fix the following issue in the Linux kernel code: mm/page_alloc: fix defrag_mode for non-reclaimable allocations
Problem Details: When defrag_mode is enabled, ALLOC_NOFRAGMENT is enforced to prevent migratetype fallbacks and keep pageblocks clean. The allocator relies on reclaim and compaction to free pages of the correct type before allowing fallback as a last resort. However, non-reclaimable allocations such as GFP_ATOMIC can...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 0ebffb0bb98b..7e3c79e79e5b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4853,8 +4853,19 @@ retry: } /* Caller is not willing to reclaim, we can't balance anything */ - if (!can_direct_reclaim) + if (!can_direct_reclaim) { + /* + * Reclaim/c...
ea8ea212d4154f8e445cf282e246c47649a18a59
Analyze and fix the following issue in the Linux kernel code: leds: trigger: netdev: don't recurse on the netdev ops lock
Problem Details: get_device_state() calls __ethtool_get_link_ksettings() on the trigger's netdev, which will soon take the dev's ops lock. Three of its callers already hold that lock and one doesn't, so the function would either deadlock or run unprotected depending on the path. Make get_device_state() expect the dev'...
```diff diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index 12cb3311ea22..64c078e997f2 100644 --- a/drivers/leds/trigger/ledtrig-netdev.c +++ b/drivers/leds/trigger/ledtrig-netdev.c @@ -26,6 +26,7 @@ #include <linux/phy.h> #include <linux/rtnetlink.h> #include <linux/time...
e50f6245be53e612dc3296b53c890a0d4a2d806a
Analyze and fix the following issue in the Linux kernel code: net: sched: don't recurse on the netdev ops lock in qdiscs
Problem Details: cbs_set_port_rate() and taprio_set_picos_per_byte() are reached from two paths and both already hold the device's ops lock: *_change(), via tc_modify_qdisc() which calls netdev_lock_ops(dev) before dispatching to the qdisc ops. *_dev_notifier() on NETDEV_UP / NETDEV_CHANGE, where caller hol...
```diff diff --git a/net/sched/sch_cbs.c b/net/sched/sch_cbs.c index b952353ec2a5..85b41ffc63ff 100644 --- a/net/sched/sch_cbs.c +++ b/net/sched/sch_cbs.c @@ -327,7 +327,7 @@ static void cbs_set_port_rate(struct net_device *dev, struct cbs_sched_data *q) s64 port_rate; int err; - err = __ethtool_get_link_ksetting...
20398c41d0014ba08363c8e7ad98006e6e28747f
Analyze and fix the following issue in the Linux kernel code: net: bridge: don't recurse on the port's netdev ops lock
Problem Details: port_cost() calls __ethtool_get_link_ksettings() on the port device, which will soon take the port's ops lock. br_port_carrier_check() is reached via the NETDEV_CHANGE notifier from linkwatch, which already holds the port's ops lock, so the call would deadlock. Make port_cost() expect the port's ops l...
```diff diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index d39571e13744..049d1d25bc26 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -19,6 +19,7 @@ #include <linux/if_ether.h> #include <linux/slab.h> #include <net/dsa.h> +#include <net/netdev_lock.h> #include <net/sock.h> #include <linux/if_vl...
a6882c1583262d5bd86a798198820842e6d32b62
Analyze and fix the following issue in the Linux kernel code: net: team: don't recurse on the port's netdev ops lock
Problem Details: __team_port_change_send() calls __ethtool_get_link_ksettings() on the port, which will soon take the port's ops lock. The notifier caller already holds it while the slave-add/del callers do not, so the function would either deadlock or run unprotected depending on the path. Make __team_port_change_sen...
```diff diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c index f51388d50307..feaa75fbf8fc 100644 --- a/drivers/net/team/team_core.c +++ b/drivers/net/team/team_core.c @@ -1375,7 +1375,9 @@ static int team_port_add(struct team *team, struct net_device *port_dev, list_add_tail_rcu(&port->list, &...
107b097790e903651385a96dd96f9be158702730
Analyze and fix the following issue in the Linux kernel code: net: bonding: don't recurse on the slave's netdev ops lock
Problem Details: bond_update_speed_duplex() calls __ethtool_get_link_ksettings() on the slave, which will soon take the slave's ops lock. One of its callers already holds it and the other three don't, so the function would either deadlock or run unprotected depending on the path. Make the helper expect the slave's ops...
```diff diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 82e779f7916b..0bcab797e468 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -787,6 +787,10 @@ down: * values are invalid, set speed and duplex to -1, * and return. Return 1 if speed or d...
f32fe1d79a18592b96342a0016cd62cf9601a054
Analyze and fix the following issue in the Linux kernel code: net: ethtool: add netif_get_link_ksettings() for correct ops-locked use
Problem Details: __ethtool_get_link_ksettings() is exported and called from sysfs and many drivers. It invokes ethtool_ops->get_link_ksettings so by our own docs it should be holding netdev lock for ops locked devices. Looks like commit 2bcf4772e45a ("net: ethtool: try to protect all callback with netdev instance lock"...
```diff diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 1cb0740ba331..f51346a6a686 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -325,6 +325,8 @@ struct ethtool_link_ksettings { extern int __ethtool_get_link_ksettings(struct net_device *dev, struct ethtool_link_ks...
c8b04142078a9ccb9e402ab7c38de7123256f4a5
Analyze and fix the following issue in the Linux kernel code: perf sched: Fix comp_cpus heap overflow with cross-machine recordings
Problem Details: setup_map_cpus() allocates comp_cpus based on sysconf(_SC_NPROCESSORS_CONF), the host machine's CPU count. But map_switch_event() indexes comp_cpus using cpus_nr derived from bitmap_weight(comp_cpus_mask, MAX_CPUS), where comp_cpus_mask is declared as DECLARE_BITMAP(..., MAX_CPUS) with MAX_CPUS=4096. ...
```diff diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 36da451447b5..4aa7833cae6e 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1670,7 +1670,7 @@ static int map_switch_event(struct perf_sched *sched, struct perf_sample *sampl new_cpu = true; } } else ...
8cbca8a480e15f6326ce94287570993f27a4b2d5
Analyze and fix the following issue in the Linux kernel code: perf sched: Fix NULL dereference in latency_runtime_event
Problem Details: latency_runtime_event() passes the return value of machine__findnew_thread() directly to thread_atoms_search() at line 1216, before checking for NULL at line 1220. thread_atoms_search() calls pid_cmp() which dereferences the thread pointer via thread__tid(), causing a NULL pointer dereference if the a...
```diff diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 13b801496a01..36da451447b5 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1213,13 +1213,15 @@ static int latency_runtime_event(struct perf_sched *sched, const u32 pid = perf_sample__intval(sample, "pid"...
66ea9de60396a4dea5276bc87025884691876c36
Analyze and fix the following issue in the Linux kernel code: perf sched: Fix thread reference leak in latency_switch_event
Problem Details: In latency_switch_event(), after acquiring thread references for sched_out and sched_in via machine__findnew_thread(), the first add_sched_out_event() failure path does 'return -1', bypassing the out_put label that calls thread__put() on both references. The second and third add_sched_out_event() fail...
```diff diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index e7bd3f331cb8..13b801496a01 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -1180,7 +1180,7 @@ static int latency_switch_event(struct perf_sched *sched, } } if (add_sched_out_event(out_events, prev_state...
a5498ccf8079fc91c938f122ff9697b0c526b2fd
Analyze and fix the following issue in the Linux kernel code: perf tools: Guard test_bit from out-of-bounds sample CPU
Problem Details: When PERF_SAMPLE_CPU is absent from a perf.data file, sample->cpu is initialized to (u32)-1 by evsel__parse_sample(). Five call sites pass this value directly to test_bit(sample->cpu, cpu_bitmap), reading massively out of bounds past the DECLARE_BITMAP(..., MAX_NR_CPUS) allocation of 4096 bits. Add a...
```diff diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index b918f9eed5fd..8a0eb30eac24 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -295,7 +295,8 @@ static int process_sample_event(const struct perf_tool *tool, goto out_put; } - if (ann->cpu_list ...
824b18f607d82503a956d3e00f9e9c0b24efcbca
Analyze and fix the following issue in the Linux kernel code: perf lock contention: Enable end-timestamp accounting for cgroup aggregation
Problem Details: update_lock_stat() handles lock contentions that start but never reach a contention_end event (e.g., locks still held when profiling stops), but previously treated LOCK_AGGR_CGROUP as a no-op due to missing cgroup context in userspace. Fix this by adding a cgroup_id field to struct tstamp_data, record...
```diff diff --git a/tools/perf/util/bpf_lock_contention.c b/tools/perf/util/bpf_lock_contention.c index eb8e29b8064b..b1cfa63a488f 100644 --- a/tools/perf/util/bpf_lock_contention.c +++ b/tools/perf/util/bpf_lock_contention.c @@ -470,8 +470,8 @@ static void update_lock_stat(int map_fd, int pid, u64 end_ts, stat_key...
2eeb342aff66477e0db9833a6393e581a6dac4f3
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Consult MCCS FreeSync cap only if requested & supported
Problem Details: When the do_mccs parameter is false, we don't call dm_helpers_read_mccs_caps, so sink->mccs_caps.freesync_supported is unlikely to be true. Fixes: 6f71d5dd3206 ("drm/amd/display: Read sink freesync support via mccs") Bug: https://gitlab.freedesktop.org/drm/amd/-/work_items/5286 Signed-off-by: Michel D...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 5fc5d5608506..122982b7a7b9 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -13446,17 +13446,15 @@ void amdgpu_dm_upda...
a50676d5a72a26829d4885ff7d62df8d82f462b1
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: Unwind debug trap enable on copy_to_user failure
Problem Details: If kfd_dbg_trap_enable() fails while copying runtime_info to userspace, it had already activated the trap, set debug_trap_enabled, taken an extra process reference, and opened the debug event file. Return -EFAULT without unwinding that state, leaving inconsistent trap state and a refcount imbalance tha...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c index 0f7aa51b629e..0dd1fd448059 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c @@ -832,6 +832,12 @@ int kfd_dbg_trap_enable(struct kfd_process *target, uint32_t fd, ...
d097095dda7449f85d963911584112555071b2f5
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/userq: Fix reading timeline points in wait ioctl
Problem Details: Use correct u64 type. Signed-off-by: David Rosca <david.rosca@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 0ac98160dfb6ab3c6d7b38e0ff9687780beed9cb)
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index a41fb72dba94..f74ad378e407 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c @@ -593,7 +593,7 @@ free_syncobj_handles: static int...
3b347d011773d147b62f84ec60a7824629148be2
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: fix SMI event cross-process information leak
Problem Details: kfd_smi_ev_enabled() skips the suser privilege check when pid=0. PROCESS_START, PROCESS_END, and VMFAULT events are emitted with pid=0 while carrying another process's PID and command name, so any /dev/kfd user in the render group can monitor all GPU workloads. Pass the target process PID into kfd_smi...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c index 15975c23a88e..dfbde5a571f6 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c @@ -254,8 +254,10 @@ void kfd_smi_event_update_vmfault(struct kfd_nod...
e1686ca81dbf3edbde589b7daf312b45cbf76e03
Analyze and fix the following issue in the Linux kernel code: of: reserved_mem: avoid post-init UAF when alloc_reserved_mem_array() fails
Problem Details: The global pointer 'reserved_mem' continues to reference the reserved_mem_array which lives in __initdata if alloc_reserved_mem_array() fails. of_reserved_mem_lookup() is exported for post-init use, that would dereference freed memory and trigger a use-after-free. So reset reserved_mem_count to 0 when...
```diff diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index ce1d5530ec0f..d918dc7f07fb 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -69,29 +69,32 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, * the initial static array is ...
56ae73c92e200e630c2bdf1e98c88b86c8483b37
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: always resume_all after suspend_all
Problem Details: Need to restore any good queues even if the suspend_all failed for some. Always run remove_queue as that will schedule a GPU reset is removing the queue fails. v2: move resume_all after remove Fixes: eb067d65c33e ("drm/amdkfd: Update BadOpcode Interrupt handling with MES") Reviewed-by: Amber Lin <Am...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 5150511cefc5..2e010c1f8828 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -3264,32 +3264,24 @@ int k...
9117d8be850baf0f89b65ff399442fb59b1a1beb
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/gfx: move fault and EOP IRQ get/put to hw_init/hw_fini
Problem Details: priv_reg / priv_inst / bad_op and (on v11+) userq EOP IRQs are acquired in late_init but released in hw_fini. This split forced gfx_v9_0_hw_fini() to defensively guard each put with amdgpu_irq_enabled() because hw_fini runs on paths that may not reach late_init. amdgpu_ip_block_hw_fini() only runs af...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 58c69dcb527f..0780c5e5de4f 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -7530,6 +7530,24 @@ static int gfx_v10_0_hw_init(struct amdgpu_ip_block *ip_block) i...
115bf5ca318e18a3dc1888ec6271c7052774952a
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Consult MCCS FreeSync cap only if requested & supported
Problem Details: When the do_mccs parameter is false, we don't call dm_helpers_read_mccs_caps, so sink->mccs_caps.freesync_supported is unlikely to be true. Fixes: 6f71d5dd3206 ("drm/amd/display: Read sink freesync support via mccs") Bug: https://gitlab.freedesktop.org/drm/amd/-/work_items/5286 Signed-off-by: Michel D...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 04e440521f67..1ed697a3a453 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -13837,17 +13837,15 @@ void amdgpu_dm_upda...
961323c26ad4c895e3b0ea1711fc41dfd6368c12
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: Fix infinite loop parsing CRAT with zero subtype length
Problem Details: Malformed ACPI CRAT tables can advertise a zero or undersized subtype length. The parser then fails to advance the cursor and loops forever while the remaining image still looks large enough for a generic header. Validate sub_type_hdr->length on each iteration before parsing or advancing. Return -EINV...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c index af2ae144f508..f28259d13818 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c @@ -1404,6 +1404,14 @@ int kfd_parse_crat_table(void *crat_image, struct list_head *device_li...
8bfd3aeeb7d4c140434bb9e604fca39ebb3e2937
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: fix sysfs topology prop length on buffer truncation
Problem Details: sysfs_show_gen_prop() accumulated snprintf()'s return value into the offset. snprintf() reports bytes that would have been written, not bytes actually written, so a truncated sysfs show could over-report its length. Use sysfs_emit_at(), which returns only the bytes written. Signed-off-by: Yongqiang Su...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index dc1c6bd1252f..00517c3d0e6a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -198,8 +198,7 @@ struct kfd_topology_device *kfd_create_topology_device( ...
342981fff32802a819d6fc7cf3c9fedf9f3d9d60
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: drop retry loop in amdgpu_hmm_range_get_pages
Problem Details: Since commit c08972f55594 ("drm/amdgpu: fix amdgpu_hmm_range_get_pages") moved mmu_interval_read_begin() out of the per-chunk loop, the captured notifier_seq is no longer refreshed across retries. As a result, the existing -EBUSY retry path can never make progress: hmm_range_fault() returns -EBUSY o...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c index e452444b33b0..99bc9ad67d5b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hmm.c @@ -174,7 +174,6 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *noti...
01112e241e37f9ac98b6f418d93ce2e0b87b7ee0
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: Unwind debug trap enable on copy_to_user failure
Problem Details: If kfd_dbg_trap_enable() fails while copying runtime_info to userspace, it had already activated the trap, set debug_trap_enabled, taken an extra process reference, and opened the debug event file. Return -EFAULT without unwinding that state, leaving inconsistent trap state and a refcount imbalance tha...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c index 0f7aa51b629e..0dd1fd448059 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_debug.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_debug.c @@ -832,6 +832,12 @@ int kfd_dbg_trap_enable(struct kfd_process *target, uint32_t fd, ...
1e815068fba5ea2684c146b445a3b1f6da7eddee
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: use unsigned types for local pipe and REG_GET counters
Problem Details: Two small type fixes that match how the values are actually consumed: - decide_zstate_support() iterates from 0 to pipe_count, which is unsigned. Make the loop index unsigned int. - hpo_enc401_read_state() reads HDMI_PIXEL_ENCODING and HDMI_DEEP_COLOR_DEPTH via REG_GET_2(), which internally casts...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c index 5f088d113b9f..38c79239004c 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c @@ -1060,7 +1060,7 @@ static bool...
0ac98160dfb6ab3c6d7b38e0ff9687780beed9cb
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/userq: Fix reading timeline points in wait ioctl
Problem Details: Use correct u64 type. Signed-off-by: David Rosca <david.rosca@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index a41fb72dba94..f74ad378e407 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c @@ -593,7 +593,7 @@ free_syncobj_handles: static int...
182bdd59be41595e211ac98406d3637fc6141017
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: deprecate guilty handling
Problem Details: The guilty handling tried to establish a second way of signaling problems with the GPU back to userspace. This caused quite a bunch of issue we had to work around, especially lifetime issues with the drm_sched_entity. Just drop the handling altogether and use the dma_fence based approach instead. v2:...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 32af8cce3df8..c42ae3e6fdd1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -60,11 +60,6 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, if (!p-...
92a8dba246d371fe268280e5fd74b0955688e6df
Analyze and fix the following issue in the Linux kernel code: drm/amdkfd: fix SMI event cross-process information leak
Problem Details: kfd_smi_ev_enabled() skips the suser privilege check when pid=0. PROCESS_START, PROCESS_END, and VMFAULT events are emitted with pid=0 while carrying another process's PID and command name, so any /dev/kfd user in the render group can monitor all GPU workloads. Pass the target process PID into kfd_smi...
```diff diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c index 15975c23a88e..dfbde5a571f6 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c @@ -254,8 +254,10 @@ void kfd_smi_event_update_vmfault(struct kfd_nod...
fa2886555bdcf6869848e1ef5d4ba19d8b43b95c
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Fix DCN42B version detection
Problem Details: In resource_parse_asic_id, the check for GC_11_0_4 was unbounded, which caused it to override the detection of DCN42B. Signed-off-by: Matthew Stewart <Matthew.Stewart2@amd.com> Reviewed-by: Roman Li <Roman.Li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/display/include/dal_asic_id.h b/drivers/gpu/drm/amd/display/include/dal_asic_id.h index 7d8944d27d92..ca77d29ebacc 100644 --- a/drivers/gpu/drm/amd/display/include/dal_asic_id.h +++ b/drivers/gpu/drm/amd/display/include/dal_asic_id.h @@ -261,8 +261,8 @@ enum { #define ASICREV...
d35617ef465b935503e4616c1ce35775a6bc1b71
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: Fix user-triggerable BUG()/BUG_ON() calls
Problem Details: Replace BUG()/BUG_ON() with error logs and safe returns in several places where they can be triggered by invalid userspace input, preventing DoS via kernel panic. Signed-off-by: Ce Sun <cesun102@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index d2d70c4b2ac5..1dddfde91c49 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -717,7 +717,12 @@ void amdgpu_device_mm_access(struct amdgpu_device *a...
1ff3f528e67d20e2b1483dcaba899dc7832b2e6b
Analyze and fix the following issue in the Linux kernel code: rpmsg: char: Fix use-after-free on probe error path
Problem Details: rpmsg_chrdev_probe() stores the newly allocated eptdev in the default endpoint's priv pointer before calling rpmsg_chrdev_eptdev_add(). If rpmsg_chrdev_eptdev_add() then fails, its error path frees eptdev while the default endpoint may still dispatch callbacks with the stale priv pointer. Avoid publis...
```diff diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c index ca9cf8858a5e..bff5aefee212 100644 --- a/drivers/rpmsg/rpmsg_char.c +++ b/drivers/rpmsg/rpmsg_char.c @@ -104,6 +104,9 @@ static int rpmsg_ept_cb(struct rpmsg_device *rpdev, void *buf, int len, struct rpmsg_eptdev *eptdev = priv; struc...
bf29346fc39355cc57118e4e825109f66ac3542d
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: ignore call depth accounting for retbleed in verifier tests
Problem Details: When running the selftests on a retbleed-affected platform (eg: Skylake), with call depth accounting enabled (CONFIG_CALL_DEPTH_TRACKING=y) _and_ with retbleed=stuff, some verifier selftests fail to validate the jited instructions. For example: MATCHED SUBSTR: ' endbr64' MATCHED SUBSTR: ' no...
```diff diff --git a/tools/testing/selftests/bpf/progs/verifier_private_stack.c b/tools/testing/selftests/bpf/progs/verifier_private_stack.c index 046f7445a458..bb8206e10880 100644 --- a/tools/testing/selftests/bpf/progs/verifier_private_stack.c +++ b/tools/testing/selftests/bpf/progs/verifier_private_stack.c @@ -94,6 ...
80b89d0226a05e8b67969de99c31b51fcd54f76a
Analyze and fix the following issue in the Linux kernel code: bpf: Take mmap_lock in zap_pages()
Problem Details: zap_vma_range() requires the owning mm's mmap_lock to be held. Taking mmap_read_lock under arena->lock would AB-BA against arena_vm_close() and arena_map_mmap(), both of which run with mmap_write_lock held and then acquire arena->lock. Instead drop arena->lock, mmget_not_zero() the vma's mm, take mmap...
```diff diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c index 1727503b25d8..9b2dea229b38 100644 --- a/kernel/bpf/arena.c +++ b/kernel/bpf/arena.c @@ -60,6 +60,8 @@ struct bpf_arena { struct list_head vma_list; /* protects vma_list */ struct mutex lock; + u64 zap_gen; + struct mutex zap_mutex; struct irq_wo...
fbd6dc50d9aedc594ec3196211a190170a275ab6
Analyze and fix the following issue in the Linux kernel code: bpf: clean up btf_scan_decl_tags()
Problem Details: Refactor the newly introduced btf_scan_decl_tags() to improve readability and maintainability. The current implementation uses a manual if-else chain and a magic number offset to strip the "arg:" prefix from declaration tags. Replace the if-else logic with a table-driven approach using a static const ...
```diff diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 68921d9172b5..55aa3ba1b1e0 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -7808,14 +7808,28 @@ static int btf_scan_decl_tags(struct bpf_verifier_env *env, u32 arg_idx, bool is_global, u32 *tags) { int id = btf_named_start_id(btf, false...
786d2d84416a9a1c1a47b71a68d679d886284be2
Analyze and fix the following issue in the Linux kernel code: module: decompress: check return value of module_extend_max_pages()
Problem Details: module_extend_max_pages() calls kvrealloc() internally and returns -ENOMEM on allocation failure. The return value is never checked. If the initial allocation fails, info->pages remains NULL and info->max_pages remains 0. Subsequent calls to module_get_next_page() will attempt to dynamically grow the ...
```diff diff --git a/kernel/module/decompress.c b/kernel/module/decompress.c index 36f52a232a12..cce098671be9 100644 --- a/kernel/module/decompress.c +++ b/kernel/module/decompress.c @@ -307,6 +307,8 @@ int module_decompress(struct load_info *info, const void *buf, size_t size) */ n_pages = DIV_ROUND_UP(size, PAGE...
93790c374b9d77f3db15786d7d432872d92751cf
Analyze and fix the following issue in the Linux kernel code: net/mlx5: convert miss_list allocation to kvmalloc_array()
Problem Details: dr_icm_buddy_init_ste_cache() allocates the per-buddy miss_list using the open-coded kvmalloc(n * sizeof(*p), ...) form. The neighbouring allocations in the same function already use the kvcalloc()/ kvzalloc_objs() forms; switch this last one to kvmalloc_array() for consistency and for the size_mul ov...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c index 7a0a15822392..fa4d24b3dfaa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_icm_pool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/stee...
b6197b386677ae5268d4702e23849d9ad53051ad
Analyze and fix the following issue in the Linux kernel code: Reapply "bnxt_en: bring back rtnl_lock() in the bnxt_open() path"
Problem Details: This reverts commit 850d9248d2eac662f869c766a598c877690c74e5. This reapplies commit 325eb217e41f ("bnxt_en: bring back rtnl_lock() in the bnxt_open() path"). Breno reports a lockdep warning in bnxt. During FW reset the driver may end up calling netif_set_real_num_tx_queues() (if queue count changes), ...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 008c34cff7b4..35e1f8f663c7 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -14388,13 +14388,28 @@ static void bnxt_unlock_sp(struct bnxt *bp) netde...
3c94f241f776562c489876ff506f366224565c21
Analyze and fix the following issue in the Linux kernel code: udp: clear skb->dev before running a sockmap verdict
Problem Details: On the UDP receive path skb->dev is repurposed as dev_scratch (the truesize/state cache set by udp_set_dev_scratch()), through the union { struct net_device *dev; unsigned long dev_scratch; } in sk_buff. When a UDP socket is in a sockmap, sk_data_ready is sk_psock_verdict_data_ready(), which calls udp...
```diff diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 0ac2bf4f8759..70f6cbd4ef73 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -2011,6 +2011,14 @@ try_again: } WARN_ON_ONCE(!skb_set_owner_sk_safe(skb, sk)); + + /* + * skb->dev still aliases the UDP rx dev_scratch (its charge was freed + * on dequeue ...
e374b22e9b07b72a25909621464ff74096151bfb
Analyze and fix the following issue in the Linux kernel code: sctp: purge outqueue on stale COOKIE-ECHO handling
Problem Details: sctp_stream_update() is only invoked when the association is moved into COOKIE_WAIT during association setup/reconfiguration. In this path, the outbound stream scheduler state (stream->out_curr) is expected to be clean, since no user data should have been transmitted yet unless the state machine has al...
```diff diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 8e89a870780c..9b23c11cbb9e 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -2598,11 +2598,7 @@ static enum sctp_disposition sctp_sf_do_5_2_6_stale( */ sctp_add_cmd_sf(commands, SCTP_CMD_DEL_NON_PRIMARY, SCTP_NULL());...
06152e33686112d5d49a44301eb0d55d0012d48d
Analyze and fix the following issue in the Linux kernel code: ASoC: Intel: catpt: Cleanup components_kcontrols[]
Problem Details: Fix alignment and drop redundant comments. While at it, declare the mute-boolean explicitly. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20260603085827.1964796-8-cezary.rojewski@intel.com Sig...
```diff diff --git a/sound/soc/intel/catpt/pcm.c b/sound/soc/intel/catpt/pcm.c index faa9c483c98e..8fb0efb67eb1 100644 --- a/sound/soc/intel/catpt/pcm.c +++ b/sound/soc/intel/catpt/pcm.c @@ -968,6 +968,7 @@ static int catpt_loopback_mute_put(struct snd_kcontrol *kctl, struct snd_ctl_ele return 1; } +static bool ca...
f95ac7d0c7bdd2082fb97b2d32dda0e751e2683f
Analyze and fix the following issue in the Linux kernel code: ASoC: Intel: catpt: Drop manipulation of the obsolete direction flag
Problem Details: Setting up direction for struct dma_slave_config is obsolete, see the description of the struct. The transfer performed by the catpt-driver is also always DMA_MEM_TO_MEM not DMA_MEM_TO_DEV with preparation step being dmaengine_prep_dma_memcpy(). DW's ->device_prep_dma_memcpy() always fixes the direct...
```diff diff --git a/sound/soc/intel/catpt/dsp.c b/sound/soc/intel/catpt/dsp.c index 60ec561d670c..960344991b11 100644 --- a/sound/soc/intel/catpt/dsp.c +++ b/sound/soc/intel/catpt/dsp.c @@ -44,7 +44,6 @@ struct dma_chan *catpt_dma_request_config_chan(struct catpt_dev *cdev) } memset(&config, 0, sizeof(config)); ...
e727fe9be1738ebc0caa5cc901f0299404b6bbe6
Analyze and fix the following issue in the Linux kernel code: regulator: bq257xx: drop confusing configuration of_node
Problem Details: The driver reuses the OF node of the parent multi-function device but still sets the of_node field of the regulator configuration to any prior OF node. Since the MFD child device does not have an OF node set until probe is called, this field is set to NULL on first probe and to the reused OF node if t...
```diff diff --git a/drivers/regulator/bq257xx-regulator.c b/drivers/regulator/bq257xx-regulator.c index 09c466052c04..577b277efd7f 100644 --- a/drivers/regulator/bq257xx-regulator.c +++ b/drivers/regulator/bq257xx-regulator.c @@ -143,7 +143,6 @@ static int bq257xx_regulator_probe(struct platform_device *pdev) { str...
b47ff80f280e18ad2310f44293cc057d9b64ff11
Analyze and fix the following issue in the Linux kernel code: bonding: annotate data-races arcound churn variables
Problem Details: These fields are updated asynchronously by the bonding state machine in ad_churn_machine() while holding bond->mode_lock. bond_info_show_slave() and bond_fill_slave_info() read them without bond->mode_lock being held, we need to add READ_ONCE() and WRITE_ONCE() annotations. Note that AD_CHURN_MONITOR...
```diff diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index f0aa7d2f2171..985ef66dc333 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -1386,8 +1386,8 @@ static void ad_churn_machine(struct port *port) { if (port->sm_vars & AD_PORT_CHURNED) { port...
7561c7fbc694308da73300f036719e63e42bf0b4
Analyze and fix the following issue in the Linux kernel code: net/802/mrp: fix vector attribute parsing in mrp_pdu_parse_vecattr
Problem Details: In mrp_pdu_parse_vecattr(), vector attribute events are encoded three per byte and valen tracks the number of events left to process. The parser decrements valen after processing the first and second events from each event byte, but not after processing the third one. When valen is exactly a multiple ...
```diff diff --git a/net/802/mrp.c b/net/802/mrp.c index ff0e80574e6b..160a3b14569c 100644 --- a/net/802/mrp.c +++ b/net/802/mrp.c @@ -703,6 +703,12 @@ static int mrp_pdu_parse_vecattr(struct mrp_applicant *app, valen = be16_to_cpu(get_unaligned(&mrp_cb(skb)->vah->lenflags) & MRP_VECATTR_HDR_LEN_MASK); + /*...
9fc237f8d49f06d05f0f8e80361047b718894e81
Analyze and fix the following issue in the Linux kernel code: rtase: Avoid sleeping in get_stats64()
Problem Details: The .ndo_get_stats64 callback must not sleep because it can be called when reading /proc/net/dev. rtase_get_stats64() calls rtase_dump_tally_counter(), which polls the tally counter dump bit with read_poll_timeout(). This may sleep while waiting for the hardware counter dump to complete. Use read_pol...
```diff diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index 6ccbefb5acf2..55105d34bc79 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -1565,8 +1565,9 @@ static void rtase_dump_tally_co...
3a5f3f7aff18bcc36a57839cf50cf0cc8de707f3
Analyze and fix the following issue in the Linux kernel code: ieee802154: 6lowpan: only accept IPv6 packets in lowpan_xmit()
Problem Details: The aoe driver (or similar) generates a non-IPv6 packet (e.g., ETH_P_AOE) and queues it for transmission via dev_queue_xmit() on a 6LoWPAN interface (configured by the user or test case). Since the packet is not IPv6, the 6LoWPAN header_ops->create function (lowpan_header_create or header_create) retu...
```diff diff --git a/net/ieee802154/6lowpan/tx.c b/net/ieee802154/6lowpan/tx.c index 0c07662b44c0..4df76ff50699 100644 --- a/net/ieee802154/6lowpan/tx.c +++ b/net/ieee802154/6lowpan/tx.c @@ -255,6 +255,11 @@ netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *ldev) pr_debug("package xmit\n"); + if (sk...
791c91dc7a9dfb2457d5e29b8216a6484b9c4b40
Analyze and fix the following issue in the Linux kernel code: ipv6: mcast: Fix use-after-free when processing MLD queries
Problem Details: When processing an MLD query, a pointer to the multicast group address is retrieved when initially parsing the packet. This pointer is later dereferenced without being reloaded despite the fact that the skb header might have been reallocated following the pskb_may_pull() calls, leading to a use-after-f...
```diff diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 3330adcf26db..d9b855d5191b 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -1424,9 +1424,9 @@ out: static void __mld_query_work(struct sk_buff *skb) { struct mld2_query *mlh2 = NULL; - const struct in6_addr *group; unsigned long max_delay; s...
84683b5b60c7274e2c8f7f413d39d78d3db5540f
Analyze and fix the following issue in the Linux kernel code: vxlan: vnifilter: fix spurious notification on VNI update
Problem Details: When a VNI is re-added with the same attributes (e.g. same group or no group), vxlan_vni_update() sends a spurious RTM_NEWTUNNEL notification even though nothing changed. The bug is that 'if (changed)' tests whether the pointer is non-NULL, not the bool value it points to. Since every caller passes a ...
```diff diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c index f2a202d46892..3e76f4e21094 100644 --- a/drivers/net/vxlan/vxlan_vnifilter.c +++ b/drivers/net/vxlan/vxlan_vnifilter.c @@ -661,7 +661,7 @@ static int vxlan_vni_update(struct vxlan_dev *vxlan, if (ret) return ret; ...
aa6ca1c5c338907817374b59f7551fd855a88754
Analyze and fix the following issue in the Linux kernel code: vxlan: vnifilter: send notification on VNI add
Problem Details: When a new VNI is added to a vxlan device with vnifilter enabled, no RTM_NEWTUNNEL notification is sent to userspace. This means 'bridge monitor vni' never shows VNI add events, even though VNI delete events are reported correctly. The bug is in vxlan_vni_add(), where the notification is guarded by 'i...
```diff diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c index 2042369379ff..f2a202d46892 100644 --- a/drivers/net/vxlan/vxlan_vnifilter.c +++ b/drivers/net/vxlan/vxlan_vnifilter.c @@ -759,8 +759,7 @@ static int vxlan_vni_add(struct vxlan_dev *vxlan, err = vxlan_vni_update_group(...
08326b92c7a414a73b5b308d1daf0e91e0134dfc
Analyze and fix the following issue in the Linux kernel code: cxl/test: Fix __fortify_panic
Problem Details: Fix a runtime assertion in setup_xor_mapping(). Fortify complains that it is potentially overflowing the xormaps array per __counted_by(nr_maps). Quiet the false positive by initializing @nr_maps earlier. memcpy: detected buffer overflow: 32 byte write of buffer size 0 WARNING: lib/string_helpers.c:...
```diff diff --git a/tools/testing/cxl/test/cxl_translate.c b/tools/testing/cxl/test/cxl_translate.c index 16328b2112b2..25a27e01ac21 100644 --- a/tools/testing/cxl/test/cxl_translate.c +++ b/tools/testing/cxl/test/cxl_translate.c @@ -236,8 +236,8 @@ static int setup_xor_mapping(void) if (!cximsd) return -ENOMEM; ...
6c9d2e87df40d606f1c85143e9acb1ecff463d5e
Analyze and fix the following issue in the Linux kernel code: cxl/fwctl: Fix __fortify_panic
Problem Details: Fix a runtime assertion in cxlctl_get_supported_features(). Fortify complains that it is potentially overflowing the entries array per __counted_by_le(num_entries). Quiet the false positive by initializing @num_entries earlier. memcpy: detected buffer overflow: 48 byte write of buffer size 0 WARNING...
```diff diff --git a/drivers/cxl/core/features.c b/drivers/cxl/core/features.c index 3435db9ea6b1..85185af46b72 100644 --- a/drivers/cxl/core/features.c +++ b/drivers/cxl/core/features.c @@ -423,6 +423,7 @@ static void *cxlctl_get_supported_features(struct cxl_features_state *cxlfs, rpc_out->size = struct_size(feat...
16329b510f76e5b824e05bf8add8b29850f1f16f
Analyze and fix the following issue in the Linux kernel code: cxl/region: Validate partition index before array access
Problem Details: construct_region() reads cxled->part and uses it to index cxlds->part[] without checking for a negative value. If the partition was never resolved, part remains at its initial value of -1, causing an out-of-bounds array access. Add a guard to return -EBUSY when part is negative. The check was dropped...
```diff diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index e50dc716d4e8..cc41c08c0c0c 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -3714,6 +3714,9 @@ static struct cxl_region *construct_region(struct cxl_root_decoder *cxlrd, int rc, part = READ_ONCE(cxled->part); s...
ab1ecaabe74b7d86c38ab2ab44bd56cdcc33645a
Analyze and fix the following issue in the Linux kernel code: rtase: Reset TX subqueue when clearing TX ring
Problem Details: rtase_tx_clear() clears the TX ring and resets the ring indexes. However, the TX queue state and BQL accounting are not reset at the same time. This may leave __QUEUE_STATE_STACK_XOFF asserted after rtase_sw_reset(), preventing new TX packets from being scheduled. Reset the TX subqueue when clearing ...
```diff diff --git a/drivers/net/ethernet/realtek/rtase/rtase_main.c b/drivers/net/ethernet/realtek/rtase/rtase_main.c index ef13109c49cf..6ccbefb5acf2 100644 --- a/drivers/net/ethernet/realtek/rtase/rtase_main.c +++ b/drivers/net/ethernet/realtek/rtase/rtase_main.c @@ -239,6 +239,8 @@ static void rtase_tx_clear(struct...
1d31eb27e570daa04f5373345f9ac98c95863be9
Analyze and fix the following issue in the Linux kernel code: octeontx2-af: npc: Fix CPT channel mask in npc_install_flow
Problem Details: Use the CPT-aware NIX channel mask in the npc_install_flow path so that when the host PF installs steering rules in kernel for a VF used from userspace (e.g. DPDK), MCAM entries see the same channel mask semantics as other RX paths. Fixes: 56bcef528bd8 ("octeontx2-af: Use npc_install_flow API for prom...
```diff diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h index de3fbd3d15d6..65397daae4c2 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h @@ -1145,6 +1145,7 @@ int rvu_cpt_lf_teardown(struct ...
17b22e7a389e02e72912ab2904eac08da613c49e
Analyze and fix the following issue in the Linux kernel code: x86/pmem: Check for platform_device_alloc() retval
Problem Details: Add proper error handling for the case when platform_device_alloc() returns NULL due to memory allocation failure. This prevents a potential NULL pointer dereference when trying to use the pdev pointer without checking if allocation succeeded. [ bp: Massage commit message. ] Signed-off-by: Li Jun <...
```diff diff --git a/arch/x86/kernel/pmem.c b/arch/x86/kernel/pmem.c index 23154d24b117..04fb221716ff 100644 --- a/arch/x86/kernel/pmem.c +++ b/arch/x86/kernel/pmem.c @@ -27,6 +27,8 @@ static __init int register_e820_pmem(void) * simply here to trigger the module to load on demand. */ pdev = platform_device_all...
1232b3104b4b2c0267f31608fe0f8a8758428f28
Analyze and fix the following issue in the Linux kernel code: dt-bindings: ethernet: eswin: fix hsp-sp-csr backward compatibility
Problem Details: Commit c36069c6f46c ("dt-bindings: ethernet: eswin: add optional TXD and RXD delay register offsets") added two optional cells to eswin,hsp-sp-csr but omitted minItems: 4. As a result, dt-schema implicitly required all 6 cells, which broke backward compatibility with existing 4-cell device trees. Add...
```diff diff --git a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml index b66ae6300faf..65882ff79d8d 100644 --- a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml +++ b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml @...
0861615c28de668669d748ef4eb913ea9262d13b
Analyze and fix the following issue in the Linux kernel code: sctp: validate cached peer INIT chunk length in COOKIE_ECHO processing
Problem Details: When a listening SCTP server processes a COOKIE_ECHO chunk, the cached peer INIT chunk embedded after the cookie is parsed and its parameters are later walked by sctp_process_init() using sctp_walk_params(). However, the chunk header length of this cached INIT chunk was not validated against the remai...
```diff diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index de86ac088289..85264862fb6b 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -1730,6 +1730,7 @@ struct sctp_association *sctp_unpack_cookie( struct sctp_signed_cookie *cookie; struct sk_buff *skb = chunk->skb; str...
899ee91156e57784090c5565e4f31bd7dbffbc5a
Analyze and fix the following issue in the Linux kernel code: net/sched: fix pedit partial COW leading to page cache corruption
Problem Details: tcf_pedit_act() computes the COW range for skb_ensure_writable() once before the key loop using tcfp_off_max_hint, but the hint does not account for the runtime header offset added by typed keys. This can leave part of the write region un-COW'd. Fix by moving skb_ensure_writable() inside the per-key l...
```diff diff --git a/include/net/tc_act/tc_pedit.h b/include/net/tc_act/tc_pedit.h index f58ee15cd858..cb7b82f2cbc7 100644 --- a/include/net/tc_act/tc_pedit.h +++ b/include/net/tc_act/tc_pedit.h @@ -15,7 +15,6 @@ struct tcf_pedit_parms { struct tc_pedit_key *tcfp_keys; struct tcf_pedit_key_ex *tcfp_keys_ex; int a...
cd2d36e8ae61832aaac3bddf5aafdab72821e6b9
Analyze and fix the following issue in the Linux kernel code: dmaengine: sh: rz-dmac: Set the Link End (LE) bit on the last descriptor
Problem Details: On an RZ/G2L-based system, it has been observed that when the DMA channels for all enabled IPs are active (TX and RX for one serial IP, TX and RX for one audio IP, and TX and RX for one SPI IP), shortly after all of them are started, the system can become irrecoverably blocked. In one debug session the...
```diff diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index 2a7124e4aea3..f1174d25da84 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -200,6 +200,7 @@ struct rz_dmac { /* LINK MODE DESCRIPTOR */ #define HEADER_LV BIT(0) +#define HEADER_LE BIT(1) #define HEADER_WBD ...
5fbf3a2a3b96ef5810e6e0fbc601f82067629bc5
Analyze and fix the following issue in the Linux kernel code: dmaengine: sh: rz-dmac: Fix incorrect NULL check for list_first_entry()
Problem Details: list_first_entry() does not return NULL when the list is empty, making the existing NULL check invalid. Use list_first_entry_or_null() instead. Fixes: 21323b118c16 ("dmaengine: sh: rz-dmac: Add device_tx_status() callback") Cc: stable@vger.kernel.org Tested-by: John Madieu <john.madieu.xa@bp.renesas.c...
```diff diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index 9f206a33dcc6..6d80cb668957 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -723,8 +723,8 @@ static u32 rz_dmac_chan_get_residue(struct rz_dmac_chan *channel, u32 crla, crtb, i; /* Get current processing virtual ...
731712403ddb39d1a76a11abf339a0615bc85de7
Analyze and fix the following issue in the Linux kernel code: dmaengine: sh: rz-dmac: Move interrupt request after everything is set up
Problem Details: Once the interrupt is requested, the interrupt handler may run immediately. Since the IRQ handler can access channel->ch_base, which is initialized only after requesting the IRQ, this may lead to invalid memory access. Likewise, the IRQ thread may access uninitialized data (the ld_free, ld_queue, and l...
```diff diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c index 625ff29024de..9f206a33dcc6 100644 --- a/drivers/dma/sh/rz-dmac.c +++ b/drivers/dma/sh/rz-dmac.c @@ -981,25 +981,6 @@ static int rz_dmac_chan_probe(struct rz_dmac *dmac, channel->index = index; channel->mid_rid = -EINVAL; - /* Request t...
5061b090db75c9fb98c8024779f771d92e5cf3a8
Analyze and fix the following issue in the Linux kernel code: ALSA: usb: qcom: Drop unused variables
Problem Details: Forgot to clean up the unused variables after the code refactoring, which leads to compile warnings. Reported-by: Mark Brown <broonie@kernel.org> Closes: https://lore.kernel.org/aiGUoChmVKE-xwvC@sirena.org.uk Fixes: f1f16e1809c8 ("ALSA: usb-audio: qcom: Use PAGE_ALIGN macro for buffer size calculation...
```diff diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c index 32982318fbed..b2b719238b0b 100644 --- a/sound/usb/qcom/qc_audio_offload.c +++ b/sound/usb/qcom/qc_audio_offload.c @@ -1042,8 +1042,6 @@ static int uaudio_transfer_buffer_setup(struct snd_usb_substream *subs, u32 len = xfe...
88fe2e3658726cb21ff2dcf9770bf672f9b9d31b
Analyze and fix the following issue in the Linux kernel code: ALSA: PCM: Fix wait queue list corruption in snd_pcm_drain() on linked streams
Problem Details: snd_pcm_drain() uses init_waitqueue_entry which does not clear entry.prev/next, and add_wait_queue with a conditional remove_wait_queue that is skipped when to_check is no longer in the group after concurrent UNLINK. The orphaned wait entry remains on the unlinked substream sleep queue. On the next d...
```diff diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index a541bb235cfa..302643c1c192 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -2199,9 +2199,8 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream, drain_no_period_wakeup = to_check->no_period_wakeup; drain_...
e0779713a1e2f891aeec53e629dbbd33f423c629
Analyze and fix the following issue in the Linux kernel code: PCI: qcom: Initialize DWC MSI lock for firmware-managed ECAM hosts
Problem Details: A lockdep warning is observed during boot on a Qcom firmware-managed platform: INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator. ... Call trace: re...
```diff diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 8cf0a27d166b..4f76d42457c2 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -1782,6 +1782,12 @@ static int qcom_pcie_ecam_host_init(struct pci_config_window *cfg)...
df996599cc69a9b74ff437c67751cf8a61f62e39
Analyze and fix the following issue in the Linux kernel code: verification/rvgen: Fix ltl2k writing True as a literal
Problem Details: The rvgen parser for LTL stores literal true values in the python representation (capitalised True), this doesn't build in C. The Literal class should already handle this case but ASTNode skips its strigification method and converts the value (true/false) directly. Fix by delegating ASTNode stringific...
```diff diff --git a/tools/verification/rvgen/rvgen/ltl2ba.py b/tools/verification/rvgen/rvgen/ltl2ba.py index 7f538598a868..016e7cf93bbb 100644 --- a/tools/verification/rvgen/rvgen/ltl2ba.py +++ b/tools/verification/rvgen/rvgen/ltl2ba.py @@ -122,10 +122,8 @@ class ASTNode: return self.op.expand(self, node, no...
5f845ad706c0b394ae274e9a930044f78bef782e
Analyze and fix the following issue in the Linux kernel code: verification/rvgen: Fix options shared among commands
Problem Details: After rvgen was refactored to use subparsers, the common options (-a and -D) were left in the main parser. This meant that they needed to be called /before/ the subcommand and using them without subcommand was allowed. This is not the original intent. rvgen -D "some description" container -n name D...
```diff diff --git a/tools/verification/rvgen/__main__.py b/tools/verification/rvgen/__main__.py index 3be7f85fe37b..5c923dc10d0f 100644 --- a/tools/verification/rvgen/__main__.py +++ b/tools/verification/rvgen/__main__.py @@ -18,14 +18,16 @@ if __name__ == '__main__': import sys parser = argparse.ArgumentP...