id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
62b01f72d93c7bc8fde3b2e5b5f783eca5f53324
Analyze and fix the following issue in the Linux kernel code: net: marvell: prestera: initialize err in prestera_port_sfp_bind
Problem Details: prestera_port_sfp_bind() returns err after walking the ports node. If no child node matches the port's front-panel id, err is never assigned. Initialize err to 0 because absence of a matching optional port device tree node is not an error. In that case no phylink is created and port creation should co...
```diff diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c index 41e19e9ad28d..a82e7a802985 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c @@ -373,7 +373,7 @@ static in...
ef0c9f75a19532d7675384708fc8621e10850104
Analyze and fix the following issue in the Linux kernel code: lib: Add stale 'raid6' directory to .gitignore file
Problem Details: I keep having to do this, because people think they can just move directories around and move the gitignore files around with them. You really can't do that - the old generated files stay around for others, and still need to be ignored in the old location. So when moving gitignore entries around beca...
```diff diff --git a/lib/.gitignore b/lib/.gitignore index 101a4aa92fb5..42aee3ddb374 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -5,3 +5,4 @@ /gen_crc32table /gen_crc64table /oid_registry_data.c +/raid6 ```
86f436567f2516a0083b210bedc933544826a2c3
Analyze and fix the following issue in the Linux kernel code: cpu: hotplug: Bound hotplug states sysfs output
Problem Details: states_show() adds CPU hotplug state names into a single sysfs buffer using sprintf(). With enough registered states, this can write past the end of the PAGE_SIZE buffer. Use sysfs_emit_at() so output is bounded. Fixes: 98f8cdce1db5 ("cpu/hotplug: Add sysfs state interface") Signed-off-by: Bradley Mo...
```diff diff --git a/kernel/cpu.c b/kernel/cpu.c index 3ed24c711e3f..77fdb2013ab8 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -2865,21 +2865,17 @@ static const struct attribute_group cpuhp_cpu_attr_group = { .name = "hotplug", }; -static ssize_t states_show(struct device *dev, - struct device_attribute *at...
673db10729fb121ea1b16fe57791a0cb9eac1eb5
Analyze and fix the following issue in the Linux kernel code: cpu: hotplug: Preserve per instance callback errors
Problem Details: cpuhp_invoke_callback() unwinds earlier callbacks for the same hotplug state when one instance fails. The rollback path currently reuses ret, so a successful rollback can hide the original error and make the failed transition look successful. Keep the rollback result separate from the original error. ...
```diff diff --git a/kernel/cpu.c b/kernel/cpu.c index 8df2d773fe3b..3ed24c711e3f 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -175,7 +175,7 @@ static int cpuhp_invoke_callback(unsigned int cpu, enum cpuhp_state state, struct cpuhp_step *step = cpuhp_get_step(state); int (*cbm)(unsigned int cpu, struct hlist_nod...
13a1e1a618858407fa12c391f664ea750651f6b2
Analyze and fix the following issue in the Linux kernel code: Revert "mm: limit filemap_fault readahead to VMA boundaries"
Problem Details: This reverts commit 7b32f64bc512b40b268776c5ac4d354b325b3197. This patch caused a significant performance regression, so revert it, and we can determine whether the approach is sensible or not moving forwards, and if so how to avoid this. There was a merge conflict with commit de97ae6222c1 ("mm/reada...
```diff diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 627771e82eb1..2c3718d592d6 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -1348,7 +1348,6 @@ struct readahead_control { struct file_ra_state *ra; /* private: use the readahead_* accessors instead */ pgoff_t _index; ...
44238b122ae834ac52748e59809a139a2cb8409b
Analyze and fix the following issue in the Linux kernel code: mm/vmscan: pass NULL to trace vmscan node reclaim
Problem Details: The tracepoint for node relcaims takes a `struct mem_cgroup *` as the third argument, so pass NULL instead of 0 to fix warning about using an integer as a pointer. Fixes the following warnings: mm/vmscan.c:6753:66: warning: Using plain integer as NULL pointer mm/vmscan.c:6757:58: warning: Using plain...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index 299b5d9e8836..8190c4abec84 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -6706,11 +6706,11 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order, return 1; set_task_reclaim_state(current, &sc.reclaim_state); - trace_mm_vmscan_direct_reclaim_b...
cea5702144615878600d3a39b5d8b3cc34719012
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix exclusive_cow test fork() handling
Problem Details: The test ignores the return value of fork(), so both the parent and the (newly created) child run the COW verification loops and then call hmm_buffer_free() before returning into the kselftest harness, which _exit()s each side. This duplicated teardown sequence has been observed to manifest as a SIGSE...
```diff diff --git a/tools/testing/selftests/mm/hmm-tests.c b/tools/testing/selftests/mm/hmm-tests.c index 8f4f82467043..e4c49699f3f7 100644 --- a/tools/testing/selftests/mm/hmm-tests.c +++ b/tools/testing/selftests/mm/hmm-tests.c @@ -1884,6 +1884,8 @@ TEST_F(hmm, exclusive_cow) unsigned long i; int *ptr; int ret...
8edb0e769ce2a996774df83485781dd9f4bc2d44
Analyze and fix the following issue in the Linux kernel code: selftests/mm: remove hardcoded THP sizing assumptions in hmm tests
Problem Details: migrate_partial_unmap_fault() and migrate_remap_fault() use hardcoded offsets based on a 2MB PMD size. Similarly, benchmark_thp_migration() assumes a fixed 2MB THP size when generating test buffer sizes. Derive offsets and test sizes from the runtime PMD page size returned by read_pmd_pagesize(). If...
```diff diff --git a/tools/testing/selftests/mm/hmm-tests.c b/tools/testing/selftests/mm/hmm-tests.c index deb6a7485650..8f4f82467043 100644 --- a/tools/testing/selftests/mm/hmm-tests.c +++ b/tools/testing/selftests/mm/hmm-tests.c @@ -22,6 +22,7 @@ #include <strings.h> #include <time.h> #include <pthread.h> +#includ...
224ed0e019b122d08580362abe57574a78f2b5fa
Analyze and fix the following issue in the Linux kernel code: selftests/mm: allow PUD-level entries in compound testcase of hmm tests
Problem Details: Patch series "selftests/mm: assorted fixes for hmm-tests", v3. This series fixes a few issues in hmm-tests that show up when page-size and huge-page configuration differ from the hardcoded assumptions the tests were written for (PMD/THP sizing, default hugepage size, and related cases). It also inclu...
```diff diff --git a/tools/testing/selftests/mm/hmm-tests.c b/tools/testing/selftests/mm/hmm-tests.c index 46e0c8c921c3..deb6a7485650 100644 --- a/tools/testing/selftests/mm/hmm-tests.c +++ b/tools/testing/selftests/mm/hmm-tests.c @@ -1602,8 +1602,8 @@ TEST_F(hmm2, snapshot) } /* - * Test the hmm_range_fault() HMM_...
e8ae6fd67021fafa9205330b3b248c9fc7216e0b
Analyze and fix the following issue in the Linux kernel code: mm/gup_test: reject wrapped user ranges
Problem Details: gup_test accepts an address and size from the debugfs ioctl and repeatedly compares against addr + size. If that addition wraps, the loop can be skipped and the ioctl returns success with size rewritten to zero. Compute the end address once with overflow checking and use that checked end for the loop...
```diff diff --git a/mm/gup_test.c b/mm/gup_test.c index 9dd48db897b9..eb4c9cda16ed 100644 --- a/mm/gup_test.c +++ b/mm/gup_test.c @@ -105,11 +105,15 @@ static int __gup_test_ioctl(unsigned int cmd, unsigned long i, nr_pages, addr, next; long nr; struct page **pages; + unsigned long end; int ret = 0; bool nee...
6a66c557a2ab2609575bafd15e093669c05f9711
Analyze and fix the following issue in the Linux kernel code: mm/damon/core: always put unsuccessfully committed target pids
Problem Details: damon_commit_target() puts and gets the destination and the source target pids. It puts the destination target pid because it will be overwritten by the source target pid. It gets the source pid because the caller is supposed to eventually put the pids. In more detail, the caller will call damon_des...
```diff diff --git a/mm/damon/core.c b/mm/damon/core.c index 265d51ade25b..7e4b9affc5b0 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1387,10 +1387,36 @@ static int damon_commit_target( return 0; } +/* + * damon_revert_target_commits() - revert unsuccessful target commits. + * @dst: Commit destination con...
878f41243c0ddc8201856c1d0c530df47cdaec87
Analyze and fix the following issue in the Linux kernel code: mm: page_isolation: avoid unsafe folio reads while scanning compound pages
Problem Details: page_is_unmovable() can inspect compound pages without holding a folio reference or any lock. The folio can therefore be freed, split or reused while the scanner is still looking at it. The existing HugeTLB handling already avoids folio_hstate() for this reason, but it still derives the hstate from f...
```diff diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 7a9d631945a3..32ce8a7d9df3 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -41,8 +41,14 @@ bool page_is_unmovable(struct zone *zone, struct page *page, * We need not scan over tail pages because we don't * handle each tail page ind...
b902890c62d200b3509cb5e09cf1e0a66553c128
Analyze and fix the following issue in the Linux kernel code: mm/shrinker: do not hold RCU lock in shrinker_debugfs_count_show()
Problem Details: Reading the debugfs "count" file of a memcg-aware shrinker can sleep inside an RCU read-side critical section: BUG: sleeping function called from invalid context at kernel/cgroup/rstat.c:421 RCU nest depth: 1, expected: 0 css_rstat_flush mem_cgroup_flush_stats zswap_shrinker_count shri...
```diff diff --git a/mm/shrinker_debug.c b/mm/shrinker_debug.c index affa64437302..cda4e86428c8 100644 --- a/mm/shrinker_debug.c +++ b/mm/shrinker_debug.c @@ -57,8 +57,6 @@ static int shrinker_debugfs_count_show(struct seq_file *m, void *v) if (!count_per_node) return -ENOMEM; - rcu_read_lock(); - memcg_aware ...
cc13a7a618fe8354f16d74c06aaf9565a68e9ebd
Analyze and fix the following issue in the Linux kernel code: selftests: mm: fix and speedup "droppable" test
Problem Details: The droppable test currently relies on creating memory pressure in a child process to trigger dropping the droppable pages. That not only takes a long time on some machines (allocating and filling all that memory), on large machines this will not work as we hardcode the area size to 134217728 bytes. ...
```diff diff --git a/tools/testing/selftests/mm/droppable.c b/tools/testing/selftests/mm/droppable.c index 30c8be37fcb9..57e1b6fc5569 100644 --- a/tools/testing/selftests/mm/droppable.c +++ b/tools/testing/selftests/mm/droppable.c @@ -17,10 +17,10 @@ int main(int argc, char *argv[]) { - size_t alloc_size = 13421772...
69ba1d76d93ab818245333cf400928477ba72053
Analyze and fix the following issue in the Linux kernel code: selftests/mm: clarify alternate unmapping in compaction_test
Problem Details: Add a comment explaining that every other entry in the list is unmapped to intentionally create fragmentation with locked pages before invoking check_compaction(). Link: https://lore.kernel.org/da5e0a8d5152e54152c0d2f456aac2fac35af291.1779296493.git.sayalip@linux.ibm.com Fixes: bd67d5c15cc1 ("Test com...
```diff diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c index de0633f9a7e5..5b582588e015 100644 --- a/tools/testing/selftests/mm/compaction_test.c +++ b/tools/testing/selftests/mm/compaction_test.c @@ -181,6 +181,9 @@ int main(int argc, char **argv) mem_fragme...
90c132f8379b788a0482dbeabc884d3ae5d82205
Analyze and fix the following issue in the Linux kernel code: selftests/mm: move hwpoison setup into run_test() and silence modprobe output for memory-failure category
Problem Details: run_vmtests.sh contains special handling to ensure the hwpoison_inject module is available for the memory-failure tests. This logic was implemented outside of run_test(), making the setup category-specific but managed globally. Move the hwpoison_inject handling into run_test() and restrict it to the ...
```diff diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh index 043aa3ed2596..8c296dedf047 100755 --- a/tools/testing/selftests/mm/run_vmtests.sh +++ b/tools/testing/selftests/mm/run_vmtests.sh @@ -180,6 +180,9 @@ pretty_name() { # Usage: run_test [test binary] [arbitra...
f3bd00507f226a419125df6064632bcbd47d8e70
Analyze and fix the following issue in the Linux kernel code: selftests/mm: skip uffd-stress test when nr_pages_per_cpu is zero
Problem Details: uffd-stress currently fails when the computed nr_pages_per_cpu evaluates to zero: nr_pages_per_cpu = bytes / page_size / nr_parallel This can occur on systems with large hugepage sizes (e.g. 1GB) and a high number of CPUs, where the total allocated memory is sufficient overall but not enough to prov...
```diff diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c index 43cc79590136..3401dd6028f0 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -489,9 +489,8 @@ int main(int argc, char **argv) gopts->nr_pages_per_cpu =...
f20ca8972e83f111c4300c60d74314568c8964bc
Analyze and fix the following issue in the Linux kernel code: selftests/mm: ensure destination is hugetlb-backed in hugetlb-mremap
Problem Details: The hugetlb-mremap selftest reserves the destination address using a anonymous base-page mapping before calling mremap() with MREMAP_FIXED, while the source region is hugetlb-backed. When remapping a hugetlb mapping into a base-page VMA may fail with: mremap: Device or resource busy This is obse...
```diff diff --git a/tools/testing/selftests/mm/hugetlb-mremap.c b/tools/testing/selftests/mm/hugetlb-mremap.c index 00b4c2cc95a6..ed3d92e862d8 100644 --- a/tools/testing/selftests/mm/hugetlb-mremap.c +++ b/tools/testing/selftests/mm/hugetlb-mremap.c @@ -32,7 +32,7 @@ #define MB_TO_BYTES(x) (x * 1024 * 1024) #defin...
1df31d5ef58dc6bdf0f2a8b809152d835c60b28e
Analyze and fix the following issue in the Linux kernel code: selftest/mm: register existing mapping with userfaultfd in hugetlb-mremap
Problem Details: Previously, register_region_with_uffd() created a new anonymous mapping and overwrote the address supplied by the caller before registering the range with userfaultfd. As a result, userfaultfd was applied to an unrelated anonymous mapping instead of the hugetlb region used by the test. Remove the ext...
```diff diff --git a/tools/testing/selftests/mm/hugetlb-mremap.c b/tools/testing/selftests/mm/hugetlb-mremap.c index d239905790dd..00b4c2cc95a6 100644 --- a/tools/testing/selftests/mm/hugetlb-mremap.c +++ b/tools/testing/selftests/mm/hugetlb-mremap.c @@ -86,25 +86,14 @@ static void register_region_with_uffd(char *addr,...
e5d3e1422e92d54e28e81fad8bfc7c1ecb41a353
Analyze and fix the following issue in the Linux kernel code: selftests/mm: free dynamically allocated PMD-sized buffers in split_huge_page_test
Problem Details: Dynamically allocated buffers of PMD size for file-backed THP operations (file_buf1 and file_buf2) were not freed on the success path and some failure paths. Since the function is called repeatedly in a loop for each split order, this can cause significant memory leaks. On architectures with large PM...
```diff diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index 9a50557069ad..32b991472f74 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -473,12 +473,15 @@ static void split_file_...
a2dde8a065d5c8d63b53b1c8f035017e4aeac0c2
Analyze and fix the following issue in the Linux kernel code: selftests/mm: size tmpfs according to PMD page size in split_huge_page_test
Problem Details: The split_file_backed_thp() test mounts a tmpfs with a fixed size of "4m". This works on systems with smaller PMD page sizes, but fails on configurations where the PMD huge page size is larger (e.g. 16MB). On such systems, the fixed 4MB tmpfs is insufficient to allocate even a single PMD-sized THP, c...
```diff diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index a1ccfabc5367..9a50557069ad 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -470,6 +470,8 @@ static void split_file_ba...
7bbdc459527075c4d0b96133de25a53822397af0
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix cgroup task placement and drop memory.current checks in hugetlb_reparenting_test.sh
Problem Details: The test currently moves the calling shell ($$) into the target cgroup before executing write_to_hugetlbfs. This results in the shell and any intermediate allocations being charged to the cgroup, introducing noise and nondeterminism in accounting. It also requires moving the shell back to the root cg...
```diff diff --git a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh index d724b6e45432..95f517c3bd16 100755 --- a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh +++ b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh @@ -105,22 +105,17 @@ fun...
76f9a212a0a93572a28b58d9869e9187c4022342
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix hugetlb pathname construction in hugetlb_reparenting_test.sh
Problem Details: The hugetlb_reparenting_test.sh script constructs hugetlb cgroup memory interface file names based on the configured huge page size. The script formats the size only in MB units, which causes mismatches on systems using larger huge pages where the kernel exposes normalized units (e.g. "1GB" instead o...
```diff diff --git a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh index 11f914831146..d724b6e45432 100755 --- a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh +++ b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh @@ -48,6 +48,13 @@ functi...
7f9c0920ff3debae3cb4d60260e3daf56ab68395
Analyze and fix the following issue in the Linux kernel code: selftests/mm: restore default nr_hugepages value via exit trap in hugetlb_reparenting_test.sh
Problem Details: The test modifies nr_hugepages during execution and restores it from cleanup() and again reconfigure it setup, which is invoked multiple times across test flow. This can lead to repeated allocation/freeing of hugepages. With set -e, failures in cleanup (e.g., rmdir/umount) can also cause early exit b...
```diff diff --git a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh index 0dd31892ff67..11f914831146 100755 --- a/tools/testing/selftests/mm/hugetlb_reparenting_test.sh +++ b/tools/testing/selftests/mm/hugetlb_reparenting_test.sh @@ -12,6 +12,8 @@ if [[ $...
404c04e010da2edc93cada07d4d50deda12a68e4
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix hugetlb pathname construction in charge_reserved_hugetlb.sh
Problem Details: The charge_reserved_hugetlb.sh script assumes hugetlb cgroup memory interface file names use the "<size>MB" format (e.g. hugetlb.1024MB.current). This assumption breaks on systems with larger huge pages such as 1GB, where the kernel exposes normalized units: hugetlb.1GB.current hugetlb.1GB.max ...
```diff diff --git a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh index e1945901fd20..a1cfd3a349db 100755 --- a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh +++ b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh @@ -94,6 +94,15 @@ function g...
a3f66e9b6e4dad38444656ffc28c28c33a4d4e1f
Analyze and fix the following issue in the Linux kernel code: selftests/mm: restore default nr_hugepages value via exit trap in charge_reserved_hugetlb.sh
Problem Details: Patch series "selftests/mm: fix failures and robustness improvements", v7. Powerpc systems with a 64K base page size exposed several issues while running mm selftests. Some tests assume specific hugetlb configurations, use incorrect interfaces, or fail instead of skipping when the required kernel feat...
```diff diff --git a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh index 44f4e703deb9..e1945901fd20 100755 --- a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh +++ b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh @@ -17,6 +17,7 @@ if ! comman...
a179686b917ca30232cb70eb4408d34d9de3814d
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix incorrect mmap() error handling with NULL instead of MAP_FAILED
Problem Details: mmap() returns MAP_FAILED, which is defined as (void *)-1, on error, not NULL. Several selftests incorrectly check the return value of mmap() using !ptr or ptr == NULL, which would erroneously treat MAP_FAILED as a valid pointer since MAP_FAILED is non-zero and non-NULL. This can lead to segfaults wh...
```diff diff --git a/tools/testing/selftests/mm/ksm_tests.c b/tools/testing/selftests/mm/ksm_tests.c index 64d1c63ae8c0..a050f4840cfa 100644 --- a/tools/testing/selftests/mm/ksm_tests.c +++ b/tools/testing/selftests/mm/ksm_tests.c @@ -174,7 +174,7 @@ static void *allocate_memory(void *ptr, int prot, int mapping, char ...
83ccc26e5e417792140c5b2026876ead8ce731d9
Analyze and fix the following issue in the Linux kernel code: selftests/mm: hugetlb-madvise: use kselftest framework
Problem Details: Convert hugetlb-madvise test to use kselftest framework for reporting and tracking successful and failing runs. While on it fix the check for base page size detection to actually use base_page_size. Link: https://lore.kernel.org/20260511162840.375890-11-rppt@kernel.org Signed-off-by: Mike Rapoport (M...
```diff diff --git a/tools/testing/selftests/mm/hugetlb-madvise.c b/tools/testing/selftests/mm/hugetlb-madvise.c index 898cc90b314f..e7dd8d06d986 100644 --- a/tools/testing/selftests/mm/hugetlb-madvise.c +++ b/tools/testing/selftests/mm/hugetlb-madvise.c @@ -26,12 +26,11 @@ #define validate_free_pages(exp_free) ...
79f33d19fce70bc8a3d5f16dfe24d28e789ce931
Analyze and fix the following issue in the Linux kernel code: selftests/mm: hugetlb-read-hwpoison: add SIGBUS handler
Problem Details: Patch series "make MM selftests more CI friendly", v4. There's a lot of dancing around HugeTLB settings in run_vmtests.sh. Some test need just a few default huge pages, some require at least 256 MB, and some just skip lots of tests if huge pages of all supported sizes are not available. The goal of ...
```diff diff --git a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c index 46230462ad48..ad3198b444ce 100644 --- a/tools/testing/selftests/mm/hugetlb-read-hwpoison.c +++ b/tools/testing/selftests/mm/hugetlb-read-hwpoison.c @@ -10,6 +10,7 @@ #include <sys/statfs.h...
1b6444331bebb4e586dab30b1fa0612ef482bab4
Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: enable clean pagecache folio collapse for writable files
Problem Details: collapse_file() is capable of collapsing pagecache folios from writable files to PMD folios. Now enable clean pagecache folio collapse in addition to read-only pagecache folio collapse by removing the inode_is_open_for_write() from file_thp_enabled() and only performing filemap_flush() if the file is ...
```diff diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 74bdf6ecd0cd..cbc0f0d3bf02 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -100,7 +100,7 @@ static inline bool file_thp_enabled(struct vm_area_struct *vma) if (!mapping_pmd_folio_support(vma->vm_file->f_mapping)) return false; - return !inode...
c85418be96666be9d6127448baad95ca404ee34e
Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: fix PMD collapse swap PTE accounting
Problem Details: mthp_collapse() uses mthp_present_ptes to decide whether a range has enough occupied PTEs to try collapse. Swap PTEs accepted by collapse_scan_pmd() are counted in unmapped, but are not represented in mthp_present_ptes. When lower orders are enabled, collapse_scan_pmd() relaxes max_ptes_none so the s...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 6de1a148222a..33ab5d12e1bc 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1502,6 +1502,14 @@ static enum scan_result mthp_collapse(struct mm_struct *mm, nr_occupied_ptes = bitmap_weight_from(cc->mthp_present_ptes, offset, offset + nr_p...
5a9c05d86683db5449b7fefd278c461cffb55234
Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: generalize __collapse_huge_page_* for mTHP support
Problem Details: generalize the order of the __collapse_huge_page_* and collapse_max_* functions to support future mTHP collapse. The current mechanism for determining collapse with the khugepaged_max_ptes_none value is not designed with mTHP in mind. This raises a key design issue: if we support user defined max_pte...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 69d34305b217..1075dadb9de3 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -353,30 +353,51 @@ static bool pte_none_or_zero(pte_t pte) * the shared zeropage for the given collapse operation. * @cc: The collapse control struct * @vma: The vma to che...
472ebd691d979c9f3545c469ac79d6575709bbdf
Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: generalize hugepage_vma_revalidate for mTHP support
Problem Details: Patch series "khugepaged: add mTHP collapse support", v19. The following series provides khugepaged with the capability to collapse anonymous memory regions to mTHPs. To achieve this we generalize the khugepaged functions to no longer depend on PMD_ORDER. Then during the PMD scan, we use a bitmap to...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 73e262cb30dd..cc1328cb6237 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -905,12 +905,13 @@ static int collapse_find_target_node(struct collapse_control *cc) /* * If mmap_lock temporarily dropped, revalidate vma - * before taking mmap_lock. + * a...
874611d193f29666184bcbcb8638eff87d63d019
Analyze and fix the following issue in the Linux kernel code: mm/page_alloc: only update NUMA min ratios on sysctl write
Problem Details: The sysctl handlers for min_unmapped_ratio and min_slab_ratio invoke setup_min_unmapped_ratio() and setup_min_slab_ratio() unconditionally after proc_dointvec_minmax(), even for read operations. These setup functions first zero all per-NUMA node thresholds (min_unmapped_pages and min_slab_pages) befor...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 81a9d4d1e6c0..ee902a468c2f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6653,7 +6653,8 @@ static int sysctl_min_unmapped_ratio_sysctl_handler(const struct ctl_table *tabl if (rc) return rc; - setup_min_unmapped_ratio(); + if (write) + setup_...
2956268efc457cb05d29c1bf94de1e8e684d7bbc
Analyze and fix the following issue in the Linux kernel code: alloc_tag: fix use-after-free in /proc/allocinfo after module unload
Problem Details: allocinfo_start() only reinitializes the codetag iterator at position 0. For subsequent reads (position > 0), it reuses cached iterator state from the previous batch. allocinfo_stop() drops mod_lock between read batches, which allows module unload to complete and free the module memory that the cache...
```diff diff --git a/lib/alloc_tag.c b/lib/alloc_tag.c index f2f574bcf383..551cc14bb1fd 100644 --- a/lib/alloc_tag.c +++ b/lib/alloc_tag.c @@ -45,6 +45,7 @@ int alloc_tag_ref_offs; struct allocinfo_private { struct codetag_iterator iter; + struct codetag_iterator reported_iter; bool print_header; }; @@ -58,16...
ab99ead646b1b833ecd57fe577a2816f2e848167
Analyze and fix the following issue in the Linux kernel code: drm/nouveau: fix reversed error cleanup order in ucopy functions
Problem Details: nouveau_uvmm_vm_bind_ucopy() and nouveau_exec_ucopy() place their error cleanup labels in allocation order rather than reverse allocation order. On a u_memcpya() failure for in_sync.s, the goto to err_free_ops (or err_free_pushs) frees the first allocation and then falls through to err_free_ins, which ...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_exec.c b/drivers/gpu/drm/nouveau/nouveau_exec.c index c01a01aee32b..a08ab1cfea9b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_exec.c +++ b/drivers/gpu/drm/nouveau/nouveau_exec.c @@ -331,10 +331,10 @@ nouveau_exec_ucopy(struct nouveau_exec_job_args *args, return 0...
c3027973f692077a1b66a9fb26d6a7c46c0dc72c
Analyze and fix the following issue in the Linux kernel code: drm/nouveau/acr: fix missing nvkm_done() in error path of nvkm_acr_oneinit()
Problem Details: In nvkm_acr_oneinit(), nvkm_kmap(acr->wpr) is invoked unconditionally at line 309 to obtain a mapping reference. Additionally, when both acr->wpr_fw and acr->wpr_comp are present, a second nvkm_kmap() is called inside the conditional block. Both mappings are expected to be released by nvkm_done(acr->wp...
```diff diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c index 4c7745cd6ae5..7fd967a2554f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c @@ -315,6 +315,7 @@ nvkm_acr_oneinit(struct nvkm_subdev *...
a1074dd62faa6572921d387e8a21589ccea00efc
Analyze and fix the following issue in the Linux kernel code: irqchip/crossbar: Fix parent domain resource leak
Problem Details: irq_domain_alloc_irqs_parent() is called in allocate_gic_irq() but irq_domain_free_irqs_parent() is never called which causes a resource leak. Fix this by calling irq_domain_free_irqs_parent() in crossbar_domain_free(). Fixes: 783d31863fb82 ("irqchip: crossbar: Convert dra7 crossbar to stacked domain...
```diff diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c index 4e19e9d8a41d..033b08782119 100644 --- a/drivers/irqchip/irq-crossbar.c +++ b/drivers/irqchip/irq-crossbar.c @@ -168,6 +168,7 @@ static void crossbar_domain_free(struct irq_domain *domain, unsigned int virq, irq_domain_reset_ir...
043db005a8d6932dc7d217c86307e9af0bc10ddc
Analyze and fix the following issue in the Linux kernel code: irqchip/crossbar: Use correct index in crossbar_domain_free()
Problem Details: crossbar_domain_free() resets the domain data and then uses the nulled out irq_data->hwirq member as index to reset the irq_map[] entry and to write the relevant crossbar register with a safe entry. That means it never frees the correct index and keeps the crossbar register connection to the source int...
```diff diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c index cd1134101ace..4e19e9d8a41d 100644 --- a/drivers/irqchip/irq-crossbar.c +++ b/drivers/irqchip/irq-crossbar.c @@ -158,9 +158,14 @@ static void crossbar_domain_free(struct irq_domain *domain, unsigned int virq, for (i = 0; i < nr_...
89038cc87d80c77e7aa6f42a64b2573b74af339f
Analyze and fix the following issue in the Linux kernel code: locking/rt: Fix the incorrect RCU protection in rt_spin_unlock()
Problem Details: rt_spin_unlock() releases the RCU protection before unlocking the lock. That opens the door for the following UAF scenario: T1 T2 spin_lock(&p->lock); rcu_read_lock(); invalidate(p); p = rcu_dereference(ptr); rcu_assign_pointer(ptr, NULL); if (!p) return; spin_unlock(&p->lock); spin_lock(...
```diff diff --git a/kernel/locking/spinlock_rt.c b/kernel/locking/spinlock_rt.c index db1e11b45de6..1d5e1b3c60bf 100644 --- a/kernel/locking/spinlock_rt.c +++ b/kernel/locking/spinlock_rt.c @@ -79,10 +79,27 @@ void __sched rt_spin_unlock(spinlock_t *lock) __releases(RCU) { spin_release(&lock->dep_map, _RET_IP_); ...
aa88278693cbfaf7a2acf961379973fbb63b165c
Analyze and fix the following issue in the Linux kernel code: 9p: Add missing read barrier in virtio zero-copy path
Problem Details: Commit 2b6e72ed747f ("9P: Add memory barriers to protect request fields over cb/rpc threads handoff") added a read barrier after p9_client_rpc() waits for req->status, pairing with the write barrier in p9_client_cb(). The virtio zero-copy wait path was missed. Add the same read barrier after the zero-...
```diff diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 4cdab7094b27..b0d0094ec8e2 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -532,6 +532,11 @@ req_retry_pinned: p9_debug(P9_DEBUG_TRANS, "virtio request kicked\n"); err = io_wait_event_killable(req->wq, READ_ONCE(req...
cc8b15a2c435bd1caf19741ba85286846a115764
Analyze and fix the following issue in the Linux kernel code: net/9p: Replace strlen() strcpy() pair with strscpy()
Problem Details: Use the result of strscpy() for the overflow check. Signed-off-by: David Laight <david.laight.linux@gmail.com> Message-ID: <20260606202744.5113-3-david.laight.linux@gmail.com> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
```diff diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index dbad3213ba84..eb685b52aeb2 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -940,14 +940,12 @@ p9_fd_create_unix(struct p9_client *client, struct fs_context *fc) if (!addr || !strlen(addr)) return -EINVAL; - if (strlen(addr) >= UNIX_PATH_M...
574aa0b4799470ac814479f1138d19efe6262255
Analyze and fix the following issue in the Linux kernel code: 9p: skip nlink update in cacheless mode to fix WARN_ON
Problem Details: v9fs_dec_count() unconditionally calls drop_nlink() on regular files, even when the inode's nlink is already zero. In cacheless mode the client refetches inode metadata from the server (the source of truth) on every operation, so by the time v9fs_remove() returns, the locally cached nlink may already r...
```diff diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index cdaa5034cbef..3a811db2dc19 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -490,10 +490,19 @@ static int v9fs_at_to_dotl_flags(int flags) * - ext4 (with dir_nlink feature enabled) sets nlink to 1 if a dir has more * than EXT4_LINK_MAX (650...
7d54894a1ee265a72d70f7cae1da6cc774cccc71
Analyze and fix the following issue in the Linux kernel code: net/9p: fix race condition on rdma->state in trans_rdma.c
Problem Details: The rdma->state field is modified without holding req_lock in both recv_done() and p9_cm_event_handler(), while rdma_request() accesses the same field under the req_lock spinlock. This inconsistent locking creates a race condition: - recv_done() running in softirq completion context sets rdma->state...
```diff diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index aa5bd74d333f..b4274f10fa44 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -128,25 +128,36 @@ p9_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) { struct p9_client *c = id->context; struct p9_trans_rdma *rdma = ...
96a6db3fd7763f676fb6a25658b11aaf0e4fa4f9
Analyze and fix the following issue in the Linux kernel code: 9p: v9fs_file_do_lock: replace WARN_ONCE with p9_debug
Problem Details: This warning depends on server-provided data, we should not use WARN here Reported-by: Yifei Chu <yifeichu24@gmail.com> Closes: https://lore.kernel.org/r/CAPJnbgJ7ZK7DCjCfG56hd_iKGePmAzudb4hOWd4=9r32nM+KcA@mail.gmail.com Signed-off-by: Dominique Martinet <asmadeus@codewreck.org> Message-ID: <20260529-...
```diff diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index c5e73c37baea..cddfb4b7ce4e 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -198,7 +198,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) res = -EAGAIN; break; default: - WARN_ONCE(1, "unknown lock status co...
314b58c01a9047567fd19446ca5fd46c473b89ff
Analyze and fix the following issue in the Linux kernel code: 9p: avoid returning ERR_PTR(0) from mkdir operations
Problem Details: When mkdir succeeds, v9fs_vfs_mkdir_dotl() and v9fs_vfs_mkdir() return ERR_PTR(0) which is incorrect. They should return NULL instead for success and ERR_PTR() only with negative error codes for failure. Return NULL instead of passing to ERR_PTR while err is zero Fixes smatch warnings: fs/9p/vfs_ino...
```diff diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 97abe65bf7c1..e4b15ebba3aa 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -672,27 +672,20 @@ v9fs_vfs_create(struct mnt_idmap *idmap, struct inode *dir, static struct dentry *v9fs_vfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, ...
1a3860d46e3eb47dbd60339783cdad7904486b9f
Analyze and fix the following issue in the Linux kernel code: 9p: avoid putting oldfid in p9_client_walk() error path
Problem Details: When p9_client_walk() is called with clone set to false, fid aliases oldfid. If the walk subsequently fails after the request has been sent, the error path jumps to clunk_fid, which currently calls p9_fid_put(fid) unconditionally. This drops a reference to oldfid even though ownership of oldfid remain...
```diff diff --git a/net/9p/client.c b/net/9p/client.c index 69d3efd340c0..ef64546c6d52 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1094,7 +1094,8 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname, clunk_fid: kfree(wqids); - p9_fid_put(fid); + if (fid != oldfid) + p9_fid_put(fid);...
82ef9a635d7130ca27ec9dd88c16afc39c83a4e8
Analyze and fix the following issue in the Linux kernel code: mailbox: imx: Forward the timeout/ error in imx_mu_generic_tx()
Problem Details: imx_mu_generic_tx() for the IMX_MU_TYPE_TXDB_V2 type polls on a register which may timeout and is recognized as an error. This error is siltently dropped and not dropped to the caller. Forward the error to the caller. Fixes: b5ef17917f3a7 ("mailbox: imx: fix TXDB_V2 channel race condition") Signed-of...
```diff diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 246a9a9e3952..0028073be4a7 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -227,6 +227,7 @@ static int imx_mu_generic_tx(struct imx_mu_priv *priv, u32 val; int ret, count; + ret = 0; switch...
1a58f6115bfb34eabcc7de8a3a9745b219179781
Analyze and fix the following issue in the Linux kernel code: tpm: fix event_size output in tpm1_binary_bios_measurements_show
Problem Details: Commit 186d124f07da ("tpm_eventlog.c: fix binary_bios_measurements") split the output to write the endian-converted event header first and then the variable-length event data. However, the split was at sizeof(struct tcpa_event) - 1, even though event_data was a zero-length array, and later a flexible ...
```diff diff --git a/drivers/char/tpm/eventlog/tpm1.c b/drivers/char/tpm/eventlog/tpm1.c index e7913b2853d5..0397e3361020 100644 --- a/drivers/char/tpm/eventlog/tpm1.c +++ b/drivers/char/tpm/eventlog/tpm1.c @@ -236,12 +236,12 @@ static int tpm1_binary_bios_measurements_show(struct seq_file *m, void *v) temp_ptr = (...
73851a7c43dfa52d2ed9415889b33daf85da0ed9
Analyze and fix the following issue in the Linux kernel code: tpm: tpm2-sessions: wait for async KPP completion in tpm_buf_append_salt
Problem Details: tpm_buf_append_salt() in drivers/char/tpm/tpm2-sessions.c calls crypto_kpp_generate_public_key() and crypto_kpp_compute_shared_secret() without installing a completion callback, discards both return values, and immediately frees the kpp_request via kpp_request_free(). When the resolved ecdh-nist-p256 K...
```diff diff --git a/drivers/char/tpm/tpm2-sessions.c b/drivers/char/tpm/tpm2-sessions.c index 795cd99dc6fe..a1ae5e1829cb 100644 --- a/drivers/char/tpm/tpm2-sessions.c +++ b/drivers/char/tpm/tpm2-sessions.c @@ -492,15 +492,17 @@ static void tpm2_KDFe(u8 z[EC_PT_SZ], const char *str, u8 *pt_u, u8 *pt_v, sha256_final(&...
ddd33806b8911fa2ef849e8bbbab1e3fcb26adc0
Analyze and fix the following issue in the Linux kernel code: tpm_crb: Check ACPI_COMPANION() against NULL during probe
Problem Details: Every platform driver can be forced to match a device that doesn't match its list of device IDs because of device_match_driver_override(), so platform drivers that rely on the existence of a device's ACPI companion object need to verify its presence. Accordingly, add a requisite ACPI_COMPANION() check...
```diff diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 7d1377e8e616..ceb4100ba400 100644 --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_crb.c @@ -786,8 +786,8 @@ static int crb_map_pluton(struct device *dev, struct crb_priv *priv, static int crb_acpi_probe(struct platform_devic...
c0c9cfb3b75def8bf200a2d4db09015806acfeaf
Analyze and fix the following issue in the Linux kernel code: tpm: tpm_tis_spi: Use wait_woken() in wait_for_tmp_stat()
Problem Details: wait_event_interruptible_timeout() evaluates its condition after setting the current task state to TASK_INTERRUPTIBLE. With CONFIG_DEBUG_ATOMIC_SLEEP this triggers a warning when the IRQ wait path is used: tpm_tis_status() tpm_tis_spi_read_bytes() tpm_tis_spi_transfer_full() ...
```diff diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 21d79ad3b164..153a57c79240 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -66,8 +66,8 @@ static int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, bool check_cancel) { struct tpm_...
595ca21f797e43da24cb80529fb8b29381ed8716
Analyze and fix the following issue in the Linux kernel code: tpm: Initialize name_size_alg for non-NULL name in tpm_buf_append_name()
Problem Details: tpm_buf_append_name() supports callers passing a pre-computed name for handles. When name is non-NULL, the code skips the tpm2_read_public() path but leaves name_size_alg uninitialized before it is used as the memcpy size argument. No current in-tree caller passes a non-NULL name, but future use cases...
```diff diff --git a/drivers/char/tpm/tpm2-sessions.c b/drivers/char/tpm/tpm2-sessions.c index c4da6fde748f..795cd99dc6fe 100644 --- a/drivers/char/tpm/tpm2-sessions.c +++ b/drivers/char/tpm/tpm2-sessions.c @@ -285,11 +285,14 @@ int tpm_buf_append_name(struct tpm_chip *chip, struct tpm_buf *buf, mso == TPM2_MSO_N...
de59d78e64039baa5fed455ddb905ba8263e7ede
Analyze and fix the following issue in the Linux kernel code: tpm: restore timeout for key creation commands
Problem Details: Commit 207696b17f38 ("tpm: use a map for tpm2_calc_ordinal_duration()") inadvertently reduced the timeout for TPM2 key creation commands (`CREATE_PRIMARY`, `CREATE`, `CREATE_LOADED`) from 300 seconds to 30 seconds. This causes intermittent timeout failures, with several failures observed across hundre...
```diff diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c index b11e6fa8b740..52ee350da867 100644 --- a/drivers/char/tpm/tpm2-cmd.c +++ b/drivers/char/tpm/tpm2-cmd.c @@ -71,9 +71,9 @@ static const struct { {TPM2_CC_HIERARCHY_CHANGE_AUTH, 2000}, {TPM2_CC_GET_CAPABILITY, 750}, {TPM2_CC_NV_READ,...
27dd2997746d54ebc079bb13161cc1bdd401d4a6
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_meta_bridge: fix NFT_META_BRI_IIFPVID stack leak
Problem Details: This needs to test for nonzero retval. Fixes: c54c7c685494 ("netfilter: nft_meta_bridge: add NFT_META_BRI_IIFPVID support") Closes: https://sashiko.dev/#/patchset/20260618061631.21919-1-fw%40strlen.de Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
```diff diff --git a/net/bridge/netfilter/nft_meta_bridge.c b/net/bridge/netfilter/nft_meta_bridge.c index 3d95f68e0906..e4c9aa1f64e2 100644 --- a/net/bridge/netfilter/nft_meta_bridge.c +++ b/net/bridge/netfilter/nft_meta_bridge.c @@ -44,7 +44,9 @@ static void nft_meta_bridge_get_eval(const struct nft_expr *expr, if...
b8b09dc2bf35a00d4e0556b5d6308c7b917ebda2
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_conntrack_expect: use conntrack GC to reap expectations
Problem Details: This patch replaces the timer API by GC worker approach for expectations, as it already happened in many other subsystems. Use the existing conntrack GC worker to iterate over the local list of expectations in the master conntrack to reap expired expectations. Check IPS_HELPER_BIT to run GC for expect...
```diff diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index 80f50fd0f7ad..be4a120d549e 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h @@ -54,8 +54,8 @@ struct nf_conntrack_expect { /* The conntrack of ...
af8d6ae09c0a5f8b8a0d5680203c74b3c1daa85b
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_reject: skip iphdr options when looking for icmp header
Problem Details: Not a big deal but this hould have used the real ip header length and not the base header size. As-is, if there are options then nf_skb_is_icmp_unreach() result will be random. Fixes: db99b2f2b3e2 ("netfilter: nf_reject: don't reply to icmp error messages") Signed-off-by: Florian Westphal <fw@strlen....
```diff diff --git a/net/ipv4/netfilter/nf_reject_ipv4.c b/net/ipv4/netfilter/nf_reject_ipv4.c index fecf6621f679..4626dc46808f 100644 --- a/net/ipv4/netfilter/nf_reject_ipv4.c +++ b/net/ipv4/netfilter/nf_reject_ipv4.c @@ -89,7 +89,7 @@ static bool nf_skb_is_icmp_unreach(const struct sk_buff *skb) if (iph->protocol !...
e409c23c2d0630f3b95efd12428b2e58800b7645
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_flow_offload: zero device address for non-ether case
Problem Details: LLM points out that the skip causes unitialised stack array to propagate down into dev_fill_forward_path(). Its not clear to me that there is a guarantee that a later ctx.dev->netdev_ops->ndo_fill_forward_path() would always fix this up. Cc: Felix Fietkau <nbd@nbd.name> Fixes: 45ca3e61999e ("netfilte...
```diff diff --git a/net/netfilter/nf_flow_table_path.c b/net/netfilter/nf_flow_table_path.c index 1e7e216b9f89..98c03b487f52 100644 --- a/net/netfilter/nf_flow_table_path.c +++ b/net/netfilter/nf_flow_table_path.c @@ -53,8 +53,10 @@ static int nft_dev_fill_forward_path(const struct nf_flow_route *route, struct neigh...
bff1c8b49a9cb5c04af20f4e7d43bf4af5863bc6
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_meta_bridge: add validate callback for get operations
Problem Details: Blamed commit added NFT_META_BRI_IIFHWADDR to the set validate callback, yet this is a get operation. Add a get validate callback and move the NFT_META_BRI_IIFHWADDR key there. AFAICS this is harmless, NFT_META_BRI_IIFHWADDR can deal with a NULL input device and the set handler ignores a NFT_META_BRI...
```diff diff --git a/include/net/netfilter/nft_meta.h b/include/net/netfilter/nft_meta.h index f74e63290603..6cf1d910bbf8 100644 --- a/include/net/netfilter/nft_meta.h +++ b/include/net/netfilter/nft_meta.h @@ -40,6 +40,8 @@ void nft_meta_set_eval(const struct nft_expr *expr, void nft_meta_set_destroy(const struct nft...
213be32f46a29ca15a314df06c3424ecffd6c90a
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_payload: reject offsets exceeding 65535 bytes
Problem Details: Large offsets were rejected based on netlink policy, but blamed commit removed the policy without updating nft_payload_inner_init() to use the truncation-check helper. Silent truncation is not a problem, but not wanted either, so add a check. Fixes: 077dc4a27579 ("netfilter: nft_payload: extend offse...
```diff diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c index ef2a80dfc68f..345eff140d56 100644 --- a/net/netfilter/nft_payload.c +++ b/net/netfilter/nft_payload.c @@ -224,11 +224,17 @@ static int nft_payload_init(const struct nft_ctx *ctx, const struct nlattr * const tb[]) { struct nf...
4a597a87e2e2f608edb6be2c510dc826b4fdfb53
Analyze and fix the following issue in the Linux kernel code: netfilter: ipset: make sure gc is properly stopped
Problem Details: Sashiko noticed that when destroying a set, cancel_delayed_work_sync() was called while gc calls queue_delayed_work() unconditionally which can lead not to properly shutting down the gc. Fixes: f66ee0410b1c ("netfilter: ipset: Fix "INFO: rcu detected stall in hash_xxx" reports") Signed-off-by: Jozsef ...
```diff diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h index 00c27b95207f..dedf59b661dd 100644 --- a/net/netfilter/ipset/ip_set_hash_gen.h +++ b/net/netfilter/ipset/ip_set_hash_gen.h @@ -606,7 +606,7 @@ mtype_cancel_gc(struct ip_set *set) struct htype *h = set->data; if...
3ca9982a8882470aa0ac4e8bb9a552b181d1efcd
Analyze and fix the following issue in the Linux kernel code: netfilter: ipset: fix order of kfree_rcu() and rcu_assign_pointer()
Problem Details: Sashiko pointed out that kfree_rcu() was called before rcu_assign_pointer() in handling the comment extension. Fix the order so that rcu_assign_pointer() called first. Fixes: b57b2d1fa53f ("netfilter: ipset: Prepare the ipset core to use RCU at set level") Signed-off-by: Jozsef Kadlecsik <kadlec@netfi...
```diff diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c index 3706b4a85a0f..a531b654b8d9 100644 --- a/net/netfilter/ipset/ip_set_core.c +++ b/net/netfilter/ipset/ip_set_core.c @@ -351,8 +351,8 @@ ip_set_init_comment(struct ip_set *set, struct ip_set_comment *comment, if (unlikely(...
1171192ac9af46ddf65caf4162f1b64c58ae37f4
Analyze and fix the following issue in the Linux kernel code: netfilter: ipset: Don't use test_bit() in lockless RCU readers in bitmap types
Problem Details: The pair of the patch "netfilter: ipset: Don't use test_bit() in lockless RCU readers in hash types" for the bitmap types. Fixes: 02a3231b6d82 ("netfilter: nf_conntrack_expect: store netns and zone in expectation") Fixes: b0da3905bb1e ("netfilter: ipset: Bitmap types using the unified code base") Sign...
```diff diff --git a/net/netfilter/ipset/ip_set_bitmap_gen.h b/net/netfilter/ipset/ip_set_bitmap_gen.h index 798c7993635e..bb9b5bed10e1 100644 --- a/net/netfilter/ipset/ip_set_bitmap_gen.h +++ b/net/netfilter/ipset/ip_set_bitmap_gen.h @@ -165,6 +165,7 @@ mtype_add(struct ip_set *set, void *value, const struct ip_set_ex...
e4b4984e28c16406ecb318444dea4a8bf47def3e
Analyze and fix the following issue in the Linux kernel code: netfilter: ipset: Don't use test_bit() in lockless RCU readers in hash types
Problem Details: Sashiko pointed out that there are a few lockless RCU readers using test_bit() which is a relaxed atomic operation and provides no memory barrier guarantees. Use test_bit_acquire() instead where the operation may run parallel with add/del/gc, i.e. is not one from the next cases - protected by region l...
```diff diff --git a/net/netfilter/ipset/ip_set_hash_gen.h b/net/netfilter/ipset/ip_set_hash_gen.h index 04e4627ddfc1..00c27b95207f 100644 --- a/net/netfilter/ipset/ip_set_hash_gen.h +++ b/net/netfilter/ipset/ip_set_hash_gen.h @@ -689,7 +689,7 @@ retry: continue; pos = smp_load_acquire(&n->pos); for (j = 0...
601d3c21b2e26b676cc67ae8804e991bbbcd4507
Analyze and fix the following issue in the Linux kernel code: md/raid1: protect head_position for read balance
Problem Details: KCSAN reports a data race between raid1_end_read_request() and raid1_read_request(). The completion path updates conf->mirrors[disk].head_position in update_head_pos() without a lock, while the read-balance heuristic reads the same field locklessly in is_sequential() and choose_best_rdev(). KCSAN rep...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 41d9094fa50a..afe2ca96ad8c 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -359,8 +359,8 @@ static inline void update_head_pos(int disk, struct r1bio *r1_bio) { struct r1conf *conf = r1_bio->mddev->private; - conf->mirrors[disk].head_po...
69ad6ce47f9bf2b9fe0ed69b042db993d33bbf12
Analyze and fix the following issue in the Linux kernel code: md/raid1: free r1_bio when REQ_NOWAIT is set and read would block on retry
Problem Details: When a read is retried, raid1_read_request() may be called with a pre-allocated r1_bio. If wait_read_barrier() fails for a REQ_NOWAIT read, the bio is completed and the function returns immediately. In this case the existing r1_bio is leaked. This fixes a leak of pre-allocated r1_bio structures for re...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index e2a50816e5a0..41d9094fa50a 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1363,6 +1363,12 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio, */ if (!wait_read_barrier(conf, bio->bi_iter.bi_sector, nowait)) { bi...
a286cb88ddb26c5f4377859d8e77233d9181eb82
Analyze and fix the following issue in the Linux kernel code: md/raid1: honor REQ_NOWAIT when waiting for behind writes
Problem Details: raid1 supports REQ_NOWAIT reads by avoiding waits in the barrier path through wait_read_barrier(). However, a read can still block on a WriteMostly device when the array uses a bitmap and there are outstanding behind writes. In that case raid1 unconditionally calls wait_behind_writes(), which may slee...
```diff diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index 7d778fe1c47c..0f02e2956398 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -2064,18 +2064,23 @@ static void bitmap_end_behind_write(struct mddev *mddev) bitmap->mddev->bitmap_info.max_write_behind); } -static void bitm...
393d687131d8aa8c7e4de2cb494438e145d20fc2
Analyze and fix the following issue in the Linux kernel code: md/raid10: fix writes_pending and barrier reference leaks on discard failures
Problem Details: raid10_make_request() acquires a writes_pending reference with md_write_start() before calling raid10_handle_discard(). Several failure paths in raid10_handle_discard() complete the bio and return without releasing the corresponding reference, causing md_write_end() to be skipped. Call md_write_end() ...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index c123a8c76ddc..0a3cfdd3f5df 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1639,6 +1639,7 @@ static int raid10_handle_discard(struct mddev *mddev, struct bio *bio) if (!wait_barrier(conf, bio->bi_opf & REQ_NOWAIT)) { bio_wouldblo...
e045d6ed33f8faa3e3dd6dc33c62ec01e3ad275d
Analyze and fix the following issue in the Linux kernel code: md/raid10: fix writes_pending leak on write request failures
Problem Details: raid10_make_request() acquires a writes_pending reference with md_write_start() before dispatching write requests. Several failure paths in raid10_write_request() complete the bio and return without reaching the normal write completion path, causing the corresponding md_write_end() to be skipped. Make...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index cee5a253a281..c123a8c76ddc 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1349,7 +1349,7 @@ retry_wait: } } -static void raid10_write_request(struct mddev *mddev, struct bio *bio, +static bool raid10_write_request(struct mddev *md...
8e065a1602511282fc0da2dc89445e0eb71a681c
Analyze and fix the following issue in the Linux kernel code: md/raid1: fix writes_pending and barrier reference leaks on write failures
Problem Details: raid1_make_request() acquires a writes_pending reference with md_write_start() before calling raid1_write_request(). Several failure paths in raid1_write_request() complete the bio and return without reaching the normal write completion path, causing the corresponding md_write_end() to be skipped. Mak...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 5b9368bd9e70..632d72607e11 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1501,7 +1501,7 @@ static void raid1_start_write_behind(struct mddev *mddev, struct r1bio *r1_bio, } -static void raid1_write_request(struct mddev *mddev, struct...
de9aa5ea2d9ea55234e78af1e6182979aa4f646a
Analyze and fix the following issue in the Linux kernel code: docs: ipmi: Fix path of the "hotmod" module parameter
Problem Details: The correct path of the "hotmod" module parameter should be /sys/module/ipmi_si/parameters/hotmod. Fix it. Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev> Message-ID: <20260620122747.7902-1-zenghui.yu@linux.dev> Signed-off-by: Corey Minyard <corey@minyard.net>
```diff diff --git a/Documentation/driver-api/ipmi.rst b/Documentation/driver-api/ipmi.rst index f52ab2df2569..d08cee98e34a 100644 --- a/Documentation/driver-api/ipmi.rst +++ b/Documentation/driver-api/ipmi.rst @@ -495,7 +495,7 @@ tuned to the user's desired performance. The driver supports a hot add and remove of i...
a6bfdfcc6711d1d5a92e98644359dedc67c0c858
Analyze and fix the following issue in the Linux kernel code: ieee802154: allow legacy LLSEC ADD/DEL ops to pass strict validation
Problem Details: The LLSEC ADD/DEL doit handlers under the legacy IEEE802154_NL family consume IEEE802154_ATTR_LLSEC_KEY_BYTES and IEEE802154_ATTR_LLSEC_KEY_USAGE_COMMANDS, both declared in net/ieee802154/nl_policy.c as bare length entries with no .type (defaulting to NLA_UNSPEC). Generic netlink strict validation reje...
```diff diff --git a/net/ieee802154/ieee802154.h b/net/ieee802154/ieee802154.h index fd9778f70550..e765adc4b88f 100644 --- a/net/ieee802154/ieee802154.h +++ b/net/ieee802154/ieee802154.h @@ -16,6 +16,15 @@ void ieee802154_nl_exit(void); .flags = GENL_ADMIN_PERM, \ } +#define IEEE802154_OP_RELAXED(_cmd, _func) ...
9c1e0b6d49471a712511d23fc9d06901561135e8
Analyze and fix the following issue in the Linux kernel code: ieee802154: admin-gate legacy LLSEC dump operations
Problem Details: In net/ieee802154/netlink.c, the legacy IEEE802154_NL family ops table builds the LLSEC dump entries (LLSEC_LIST_KEY, LLSEC_LIST_DEV, LLSEC_LIST_DEVKEY, LLSEC_LIST_SECLEVEL) with IEEE802154_DUMP() which sets no .flags, so generic netlink runs them ungated. The modern nl802154 family admin-gates the equ...
```diff diff --git a/net/ieee802154/ieee802154.h b/net/ieee802154/ieee802154.h index c5d91f78301a..fd9778f70550 100644 --- a/net/ieee802154/ieee802154.h +++ b/net/ieee802154/ieee802154.h @@ -23,6 +23,14 @@ void ieee802154_nl_exit(void); .dumpit = _dump, \ } +#define IEEE802154_DUMP_PRIV(_cmd, _func, _dump) \ +...
649147cb3f8b3c0c9aeba5d89d69a6ef221c12c2
Analyze and fix the following issue in the Linux kernel code: mac802154: Prevent overwrite return code in mac802154_perform_association()
Problem Details: When assoc_status not equal to IEEE802154_ASSOCIATION_SUCCESSFUL, the return value assigned to either "-ERANGE" or "-EPERM" but this return value will be overwritten to 0 after exiting the conditional scope. So, jump to clear_assoc label to preserve the return value when assoc_status not equal to IEEE8...
```diff diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c index 0a31ac8d8415..300d4584533e 100644 --- a/net/mac802154/scan.c +++ b/net/mac802154/scan.c @@ -594,6 +594,7 @@ int mac802154_perform_association(struct ieee802154_sub_if_data *sdata, "Negative ASSOC RESP received from %8phC: %s\n", &ceaddr, l...
4db86f8ab11b5a41bfc36680be837e6ac1375ec6
Analyze and fix the following issue in the Linux kernel code: ieee802154: fix kernel-infoleak in dgram_recvmsg()
Problem Details: KMSAN reported a kernel-infoleak in move_addr_to_user(): BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:131 [inline] BUG: KMSAN: kernel-infoleak in _inline_copy_to_user include/linux/uaccess.h:205 [inline] BUG: KMSAN: kernel-infoleak in _copy_to_user+0xcc/0x120 lib...
```diff diff --git a/net/ieee802154/header_ops.c b/net/ieee802154/header_ops.c index 41a556be1017..a9f0c8df5ae4 100644 --- a/net/ieee802154/header_ops.c +++ b/net/ieee802154/header_ops.c @@ -173,10 +173,13 @@ ieee802154_hdr_get_addr(const u8 *buf, int mode, bool omit_pan, { int pos = 0; - addr->mode = mode; - - if...
84a04eb5b210643bd67aab81ff805d32f62aa865
Analyze and fix the following issue in the Linux kernel code: mac802154: llsec: add skb_cow_data() before in-place crypto
Problem Details: llsec_do_encrypt_unauth(), llsec_do_encrypt_auth(), llsec_do_decrypt_unauth(), and llsec_do_decrypt_auth() all perform in-place cryptographic transformations on skb data. They build a scatterlist with sg_init_one() pointing into the skb's linear data area and then pass the same scatterlist as both src...
```diff diff --git a/net/mac802154/llsec.c b/net/mac802154/llsec.c index e8512578398e..5e7cc11fab3a 100644 --- a/net/mac802154/llsec.c +++ b/net/mac802154/llsec.c @@ -710,6 +710,7 @@ int mac802154_llsec_encrypt(struct mac802154_llsec *sec, struct sk_buff *skb) { struct ieee802154_hdr hdr; int rc, authlen, hlen; + ...
6d7f7bcf225b2d566176bf6229dbd1252940cb3c
Analyze and fix the following issue in the Linux kernel code: ieee802154: ca8210: fix pointer truncation in kfifo on 64-bit
Problem Details: ca8210_test_int_driver_write() and ca8210_test_int_user_read() exchange a kmalloc'd buffer pointer through a struct kfifo, but pass a literal '4' as the byte count to kfifo_in()/kfifo_out(). This is correct on 32-bit (pointer = 4 bytes), but on 64-bit only the low 4 bytes of the 8-byte pointer are wri...
```diff diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index bf837adfebb2..01af4f9cf7f2 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -595,7 +595,7 @@ static int ca8210_test_int_driver_write( fifo_buffer = kmemdup(buf, len, GFP_KERNEL); if (!fi...
e09390e439bd7cca30dd10893b1f64802961667a
Analyze and fix the following issue in the Linux kernel code: ieee802154: ca8210: fix cas_ctl leak on spi_async failure
Problem Details: ca8210_spi_transfer() allocates cas_ctl with kzalloc_obj(GFP_ATOMIC) and relies entirely on the SPI completion callback ca8210_spi_transfer_complete() to free it. The spi_async() API only invokes the completion callback on successful submission. On failure it returns a negative error code without eve...
```diff diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index ed4178155a5d..bf837adfebb2 100644 --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -919,9 +919,10 @@ static int ca8210_spi_transfer( if (status < 0) { dev_crit( &spi->dev, - "status %d f...
de3ab9bd3133899efb92e4cd05ba4203e58fc0a3
Analyze and fix the following issue in the Linux kernel code: sched/mmcid: Fix OOB clear_bit when CID is MM_CID_UNSET in fixup path
Problem Details: In mm_cid_fixup_cpus_to_tasks(), when rq->curr has the target mm and mm_cid.active is set, the CID is checked with cid_in_transit() before setting the transition bit. In per-CPU mode a newly forked or exec'd task can be running with mm_cid.cid == MM_CID_UNSET because CIDs are assigned lazily on schedu...
```diff diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8b791e9e9f67..3cc6fb1d2054 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -10909,8 +10909,19 @@ static void mm_cid_fixup_cpus_to_tasks(struct mm_struct *mm) } else if (rq->curr->mm == mm && rq->curr->mm_cid.active) { unsigned int...
e69ed6fc9fb3b386b5fcdb9f51623f122cee2ebd
Analyze and fix the following issue in the Linux kernel code: ieee802154: Remove WARN_ON() in cfg802154_pernet_exit()
Problem Details: There's no need to call WARN_ON() in cfg802154_pernet_exit(), since every point of failure in cfg802154_switch_netns() is covered with WARN_ON(), so remove it. Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 66e5c2672cd1 ("ieee802154: add netns support") Reviewed-by: Miqu...
```diff diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c index 987c633e2c54..c0b8712018a1 100644 --- a/net/ieee802154/core.c +++ b/net/ieee802154/core.c @@ -358,7 +358,7 @@ static void __net_exit cfg802154_pernet_exit(struct net *net) rtnl_lock(); list_for_each_entry(rdev, &cfg802154_rdev_list, list) { ...
0569f67ed6a7af838e2141da93c68e6b6013f483
Analyze and fix the following issue in the Linux kernel code: ieee802154: Avoid calling WARN_ON() on -ENOMEM in cfg802154_switch_netns()
Problem Details: It's pointless to call WARN_ON() in case of an allocation failure in dev_change_net_namespace() and device_rename(), since it only leads to useless splats caused by deliberate fault injections, so avoid it. Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 66e5c2672cd1 ("ie...
```diff diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c index 84d514430e45..987c633e2c54 100644 --- a/net/ieee802154/core.c +++ b/net/ieee802154/core.c @@ -228,8 +228,10 @@ int cfg802154_switch_netns(struct cfg802154_registered_device *rdev, continue; wpan_dev->netdev->netns_immutable = false; err ...
a2e06b4bef20b59446d5088e938c2be53cc4e6c6
Analyze and fix the following issue in the Linux kernel code: ieee802154: Restore initial state on failed device_rename() in cfg802154_switch_netns()
Problem Details: Currently, the return value of device_rename() is not acted upon. To avoid an inconsistent state in case of failure, roll back the changes made before the device_rename() call. Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 66e5c2672cd1 ("ieee802154: add netns support")...
```diff diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c index 89b671b12600..84d514430e45 100644 --- a/net/ieee802154/core.c +++ b/net/ieee802154/core.c @@ -233,31 +233,36 @@ int cfg802154_switch_netns(struct cfg802154_registered_device *rdev, wpan_dev->netdev->netns_immutable = true; } - if (err) { - ...
71b57aca295d61276a60e131d8f62b0cc7cf1a35
Analyze and fix the following issue in the Linux kernel code: ACPI: IPMI: Fix inverted interface check in ipmi_bmc_gone()
Problem Details: Before commit a1a69b297e47 ("ACPI / IPMI: Fix race caused by the unprotected ACPI IPMI user"), ipmi_bmc_gone() skipped entries whose interface number did not match the SMI being removed, then killed the matching entry: if (ipmi_device->ipmi_ifnum != iface) continue; __ipmi_dev_kill(ipmi_device); ...
```diff diff --git a/drivers/acpi/acpi_ipmi.c b/drivers/acpi/acpi_ipmi.c index 79ce6e72bf29..2dbed92d54b3 100644 --- a/drivers/acpi/acpi_ipmi.c +++ b/drivers/acpi/acpi_ipmi.c @@ -490,7 +490,7 @@ static void ipmi_bmc_gone(int iface) mutex_lock(&driver_data.ipmi_lock); list_for_each_entry_safe(iter, temp, &driv...
78ad5c7722b7bed9d35ffc5b45eb0f12e2c22fee
Analyze and fix the following issue in the Linux kernel code: ACPI: resource: Amend kernel-doc style
Problem Details: The functions are referred as func() in the kernel-doc. The % (percent) character makes the rendering for constants as described in the respective documentation. Amend all these. Fixes: 8e345c991c8c ("ACPI: Centralized processing of ACPI device resources") Signed-off-by: Andy Shevchenko <andriy.shevch...
```diff diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index bc8050d8a6f5..56df4599d360 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -871,7 +871,7 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index, EXPORT_SYMBOL_GPL(acpi_dev_resource_interrupt); /** -...
b2b42ad22828da9cdb876eedb8914134e0759355
Analyze and fix the following issue in the Linux kernel code: ACPI: sysfs: Fix path of module parameters in comments
Problem Details: The correct path of module parameters should be /sys/module/acpi/parameters/xxx. Fix them. Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev> Link: https://patch.msgid.link/20260611142518.77343-1-zenghui.yu@linux.dev Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
```diff diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index a625de3c3c8b..908cc5c7e643 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -17,12 +17,12 @@ #ifdef CONFIG_ACPI_DEBUG /* * ACPI debug sysfs I/F, including: - * /sys/modules/acpi/parameters/debug_layer - * /sys/modules/acpi/paramet...
b91d287fa7a1ba0727eed5823c6ee4924ee5fa31
Analyze and fix the following issue in the Linux kernel code: thermal: intel: Fix dangling resources on thermal_throttle_online() failure
Problem Details: The function thermal_throttle_add_dev() may fail and abort a CPU hotplug online operation. Since the failure occurs within the online callback, thermal_throttle_online(), the CPU hotplug framework does not invoke the corresponding offline callback. As a result, the hardware and software resources set u...
```diff diff --git a/drivers/thermal/intel/therm_throt.c b/drivers/thermal/intel/therm_throt.c index 44fa4dd15dd1..45a8ef4a608b 100644 --- a/drivers/thermal/intel/therm_throt.c +++ b/drivers/thermal/intel/therm_throt.c @@ -529,8 +529,13 @@ static int thermal_throttle_online(unsigned int cpu) { struct thermal_state *...
4cc70f75853bebac022334b6a86b953348072f74
Analyze and fix the following issue in the Linux kernel code: arm64/hw_breakpoint: reject unaligned watchpoints that would truncate BAS
Problem Details: hw_breakpoint_arch_parse() positions the BAS bit pattern in hw->ctrl.len with offset = hw->address & alignment_mask; /* 0..7 */ hw->ctrl.len <<= offset; ctrl.len is an 8-bit bitfield (struct arch_hw_breakpoint_ctrl::len is u32 :8), so the shift silently drops any bits past bit 7. For non-compat AA...
```diff diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c index ab76b36dce82..73cce8ac8368 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c @@ -559,6 +559,15 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, else alignment_mask = 0x7; ...
998d4d789d2d625e1d8c77c1b6c3951e30e81bb0
Analyze and fix the following issue in the Linux kernel code: arm64: static_call: include asm/insns.h
Problem Details: I came a cross a missing declaration in a randconfig build: arch/arm64/kernel/static_call.c:16:5: error: call to undeclared function 'aarch64_insn_adrp_get_offset'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 16 | aarch64_insn_...
```diff diff --git a/arch/arm64/kernel/static_call.c b/arch/arm64/kernel/static_call.c index 8b3a19e10871..c126edced022 100644 --- a/arch/arm64/kernel/static_call.c +++ b/arch/arm64/kernel/static_call.c @@ -2,6 +2,7 @@ #include <linux/static_call.h> #include <linux/memory.h> #include <asm/text-patching.h> +#include ...
1ac287e2af9a9112fe271427ef45eceb26bce8b4
Analyze and fix the following issue in the Linux kernel code: s390/pkey: Check length in pkey_pckmo handler implementation
Problem Details: Explicitly check the length of the target buffer in the pkey_pckmo implementation of the key_to_protkey() handler function. The handler function fails, if the generated output data exceeds the length of the provided target buffer. Cc: stable@vger.kernel.org Fixes: 8fcc231ce3be ("s390/pkey: Introduce p...
```diff diff --git a/drivers/s390/crypto/pkey_pckmo.c b/drivers/s390/crypto/pkey_pckmo.c index ea774ab89180..0cc015cc9f6b 100644 --- a/drivers/s390/crypto/pkey_pckmo.c +++ b/drivers/s390/crypto/pkey_pckmo.c @@ -257,6 +257,10 @@ static int pckmo_key2protkey(const u8 *key, u32 keylen, goto out; break; } + if...
b3d4ab2d7df9426f7f1d3671d7e2108f2ca6e970
Analyze and fix the following issue in the Linux kernel code: s390/pkey: Check length in PKEY_VERIFYPROTK ioctl
Problem Details: Explicitly check the buffer length request structure provided by user-space and fail, if it exceeds the buffer size. Cc: stable@vger.kernel.org Fixes: 8fcc231ce3be ("s390/pkey: Introduce pkey base with handler registry and handler modules") Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com...
```diff diff --git a/drivers/s390/crypto/pkey_api.c b/drivers/s390/crypto/pkey_api.c index d6b595eb3370..28e1007005f2 100644 --- a/drivers/s390/crypto/pkey_api.c +++ b/drivers/s390/crypto/pkey_api.c @@ -334,6 +334,13 @@ static int pkey_ioctl_verifyprotk(struct pkey_verifyprotk __user *uvp) if (copy_from_user(&kvp, uv...
f4c2d8668d85ed125985da663c824a9c25498257
Analyze and fix the following issue in the Linux kernel code: netfilter: flowtable: fix and simplify IP6IP6 tunnel handling
Problem Details: Fix nf_flow_ip6_tunnel_proto() to use pskb_may_pull() instead of skb_header_pointer() to ensure the outer IPv6 header is in the skb headroom, which is required for subsequent packet processing. Move ctx->offset update inside the IPPROTO_IPV6 conditional block since it should only be adjusted when an IP...
```diff diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index d7c90a8533ec..bf8e40af60b0 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1851,6 +1851,13 @@ static int ip6_tnl_fill_forward_path(struct net_device_path_ctx *ctx, struct dst_entry *dst; int err; + if (!(t->parms.flags & I...
5feba91006ec92da57acc1cc2e34df623b98541e
Analyze and fix the following issue in the Linux kernel code: netfilter: xt_cluster: reject template conntracks in hash match
Problem Details: xt_cluster_mt() treats any non-NULL nf_ct_get() result as a fully initialized conntrack and passes it to xt_cluster_hash(). This causes a state confusion bug when the raw table CT target attaches a template conntrack to skb->_nfct before normal conntrack processing. Templates carry IPS_TEMPLATE status...
```diff diff --git a/net/netfilter/xt_cluster.c b/net/netfilter/xt_cluster.c index 908fd5f2c3c8..eaf2511d63f0 100644 --- a/net/netfilter/xt_cluster.c +++ b/net/netfilter/xt_cluster.c @@ -107,7 +107,7 @@ xt_cluster_mt(const struct sk_buff *skb, struct xt_action_param *par) } ct = nf_ct_get(skb, &ctinfo); - if (ct ...
c9c9b37f8c5505224e8d206184df3bb668ee00cf
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_queue: pin bridge device while NFQUEUE holds fake dst
Problem Details: The br_netfilter fake rtable is embedded in struct net_bridge and is attached to bridged packets with skb_dst_set_noref(). If such a packet is queued to NFQUEUE, __nf_queue() upgrades that fake dst with skb_dst_force(). At that point the queued skb can hold a real dst reference after bridge teardown h...
```diff diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h index 3978c3174cdb..fc3e81c07364 100644 --- a/include/net/netfilter/nf_queue.h +++ b/include/net/netfilter/nf_queue.h @@ -18,6 +18,7 @@ struct nf_queue_entry { unsigned int id; unsigned int hook_index; /* index in hook_entrie...
e62d4192e593630f355094adc467058a05bdc935
Analyze and fix the following issue in the Linux kernel code: perf: Fix addr_filter_ranges lifetime
Problem Details: Lee Jia Jie reported that since event::addr_filter_ranges is used under RCU, it should be RCU freed. Reported-by: Lee Jia Jie <jiajie.lee@starlabs.sg> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index 7935d5663944..c3a84c7bcaeb 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -5303,6 +5303,7 @@ static void free_event_rcu(struct rcu_head *head) if (event->ns) put_pid_ns(event->ns); perf_event_free_filter(event); + kfree(event...
53b3e60edb674b442b2b3bbdba484667b0f47a5d
Analyze and fix the following issue in the Linux kernel code: netfilter: flowtable: fix offloaded ct timeout never being extended
Problem Details: OpenWrt has recently migrated many platforms to kernel 6.18. On the MediaTek platform, which supports hardware network offloading, WiFi connections accelerated via the WED path were observed to drop after roughly 300 seconds. After several debugging sessions, assisted by the Claude LLM, the problem wa...
```diff diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c index 785d8c244a77..99c5b9d671a0 100644 --- a/net/netfilter/nf_flow_table_core.c +++ b/net/netfilter/nf_flow_table_core.c @@ -505,8 +505,13 @@ static u32 nf_flow_table_tcp_timeout(const struct nf_conn *ct) */ static void nf_...
f199c8a8bdd54296d3458777e70fe82a78bd9817
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: Kill MIDI 2.0 URBs before freeing endpoints
Problem Details: MIDI 2.0 input URBs are started during snd_usb_midi_v2_create(). A later setup failure can still jump to snd_usb_midi_v2_free(), which currently frees each endpoint and its coherent URB buffers without first stopping the submitted URBs. A completion can then dereference the embedded URB context and end...
```diff diff --git a/sound/usb/midi2.c b/sound/usb/midi2.c index 04aeb9052f13..3ec633291772 100644 --- a/sound/usb/midi2.c +++ b/sound/usb/midi2.c @@ -470,6 +470,11 @@ static int create_midi2_endpoint(struct snd_usb_midi2_interface *umidi, static void free_midi2_endpoint(struct snd_usb_midi2_endpoint *ep) { list_de...
191f49f1e38b1c10eb44b0f967c6175c884ef7db
Analyze and fix the following issue in the Linux kernel code: rust: Kbuild: set frame-pointer llvm module flag for CONFIG_FRAME_POINTER
Problem Details: Due to a rustc bug, the -Cforce-frame-pointers=y flag only emits the frame-pointer annotation for functions, but not for the module. This means that functions generated by the LLVM backend such as 'asan.module_ctor' do not receive the frame-pointer annotation. This is likely to lead to broken backtrac...
```diff diff --git a/Makefile b/Makefile index d33a7cadd237..82b2d8cd6804 100644 --- a/Makefile +++ b/Makefile @@ -966,6 +966,9 @@ KBUILD_CFLAGS += $(stackp-flags-y) ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y +# Work ar...
ac4d1caa82d487e7ed46d0597da1adc9c1a51c70
Analyze and fix the following issue in the Linux kernel code: rust: doctest: fix incorrect pattern in replacement
Problem Details: The `-> Result<(), impl core::fmt::Debug>` string is generated by rustdoc and by adding "::" into the string it no longer finds anything, making the line useless. Remove the "::" in the pattern. Omit it in the replacement too, for consistency with upstream rustdoc. Fixes: de7cd3e4d638 ("rust: use abs...
```diff diff --git a/scripts/rustdoc_test_builder.rs b/scripts/rustdoc_test_builder.rs index f7540bcf595a..df864437cef7 100644 --- a/scripts/rustdoc_test_builder.rs +++ b/scripts/rustdoc_test_builder.rs @@ -28,7 +28,7 @@ fn main() { // // ``` // fn main() { #[allow(non_snake_case)] fn _doctest_main_rust_...
96e7f9122aae0ed000ee321f324b812a447906d9
Analyze and fix the following issue in the Linux kernel code: eth: fbnic: take netif_addr_lock_bh() around rx mode address programming
Problem Details: When __fbnic_set_rx_mode() is called from contexts other than .ndo_set_rx_mode_async(), the uc and mc addr lists are accessed without the addr lock that __hw_addr_sync_dev() and __hw_addr_unsync_dev() require. Wrap these unprotected accesses with netif_addr_lock_bh(). fbnic_clear_rx_mode() has similar ...
```diff diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c b/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c index dd77ab6052c8..10bf99be3f24 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c @@ -264,8 +264,11 @@ static int fbnic_set_mac(struct net_...
bda3348872a2ef0d19f2df6aa8cb5025adce2f20
Analyze and fix the following issue in the Linux kernel code: tipc: fix slab-use-after-free Read in tipc_aead_decrypt_done
Problem Details: tipc_aead_decrypt() goes straight from tipc_bearer_hold(b) to crypto_aead_decrypt(req) without taking a reference on the netns, unlike the encrypt path. When crypto_aead_decrypt() is offloaded asynchronously (e.g. the SIMD aead wrapper queuing to cryptd), the cryptd worker runs tipc_aead_decrypt_done()...
```diff diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c index 6d3b6b89b1d1..16f1ed1f6b1b 100644 --- a/net/tipc/crypto.c +++ b/net/tipc/crypto.c @@ -941,12 +941,20 @@ static int tipc_aead_decrypt(struct net *net, struct tipc_aead *aead, goto exit; } + /* Get net to avoid freed tipc_crypto when delete namespace...