id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
c7cdf94e9cd7a03549e61b0f85949959191b8a10
Analyze and fix the following issue in the Linux kernel code: mm: fix typo in struct pglist_data code comment
Problem Details: change "stat" to "start". Link: https://lkml.kernel.org/r/20221207074011.GA151242@cloud Fixes: c959924b0dc5 ("memory tiering: adjust hot threshold automatically") Signed-off-by: Wang Yong <yongw.kernel@gmail.com> Reviewed-by: "Huang, Ying" <ying.huang@intel.com> Signed-off-by: Andrew Morton <akpm@linu...
```diff diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 5f74891556f3..128f3cde800c 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1200,7 +1200,7 @@ typedef struct pglist_data { /* start time in ms of current promote threshold adjustment period */ unsigned int nbp_th_start; ...
5478afc55a2104caaef5b78c7c1f9acb9ec1f92a
Analyze and fix the following issue in the Linux kernel code: kmsan: fix memcpy tests
Problem Details: Recent Clang changes may cause it to delete calls of memcpy(), if the source is an uninitialized volatile local. This happens because passing a pointer to a volatile local into memcpy() discards the volatile qualifier, giving the compiler a free hand to optimize the memcpy() call away. Use OPTIMIZER_...
```diff diff --git a/mm/kmsan/kmsan_test.c b/mm/kmsan/kmsan_test.c index 9a29ea2dbfb9..eb44ef3c5f29 100644 --- a/mm/kmsan/kmsan_test.c +++ b/mm/kmsan/kmsan_test.c @@ -419,6 +419,7 @@ static void test_memcpy_aligned_to_aligned(struct kunit *test) kunit_info( test, "memcpy()ing aligned uninit src to aligned dst (...
de2e5171433126d340573cb7d0d4fcac084ab2a0
Analyze and fix the following issue in the Linux kernel code: mm: add cond_resched() in swapin_walk_pmd_entry()
Problem Details: When handling MADV_WILLNEED in madvise(), a soflockup may occurr in swapin_walk_pmd_entry() if swapping in lots of memory on a slow device. Add a cond_resched() to avoid the possible softlockup. Link: https://lkml.kernel.org/r/20221205140327.72304-1-wangkefeng.wang@huawei.com Fixes: 1998cc048901 ("mm...
```diff diff --git a/mm/madvise.c b/mm/madvise.c index 2573ea3ed684..b7d9b1a1c135 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -223,6 +223,7 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start, put_page(page); } swap_read_unplug(splug); + cond_resched(); return 0; } ```
8614d6c5eda005ad72b37afeaae2879d7c101b18
Analyze and fix the following issue in the Linux kernel code: mm: do not show fs mm pc for VM_LOCKONFAULT pages
Problem Details: When VM_LOCKONFAULT was added, /proc/PID/smaps wasn't hooked up to it, so looking at /proc/PID/smaps, it shows '??' instead of something intelligable. This can be reached by userspace by simply calling `mlock2(..., MLOCK_ONFAULT);`. Fix this by adding "lf" to denote VM_LOCKONFAULT. Link: https://lkm...
```diff diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 89338950afd3..e35a0398db63 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -674,6 +674,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) [ilog2(VM_RAND_READ)] = "rr", [ilog2(VM_DONTCOPY)] = "dc", [...
9d789c3b4170574baa4242dd8cae5988cf97d48d
Analyze and fix the following issue in the Linux kernel code: selftests/vm: ksm_functional_tests: fixes for 32bit
Problem Details: The test currently fails on 32bit. Fixing the "-1ull" vs. "-1ul" seems to make the test pass and the compiler happy. Note: This test is not in mm-stable yet. This fix should be squashed into "selftests/vm: add KSM unmerge tests". Link: https://lkml.kernel.org/r/20221205193716.276024-5-david@r...
```diff diff --git a/tools/testing/selftests/vm/ksm_functional_tests.c b/tools/testing/selftests/vm/ksm_functional_tests.c index 96644be68962..b11b7e5115dc 100644 --- a/tools/testing/selftests/vm/ksm_functional_tests.c +++ b/tools/testing/selftests/vm/ksm_functional_tests.c @@ -42,13 +42,13 @@ static bool range_maps_du...
380969fe5aacdea661d3f9ab32e84327e8624ae2
Analyze and fix the following issue in the Linux kernel code: selftests/vm: cow: fix compile warning on 32bit
Problem Details: The compiler complains about the conversion of a pointer to an int of different width. Link: https://lkml.kernel.org/r/20221205193716.276024-4-david@redhat.com Fixes: 6f1405efc61b ("selftests/vm: anon_cow: add R/O longterm tests via gup_test") Signed-off-by: David Hildenbrand <david@redhat.com> Cc: Sh...
```diff diff --git a/tools/testing/selftests/vm/cow.c b/tools/testing/selftests/vm/cow.c index 73e05b52c49e..26f6ea3079e2 100644 --- a/tools/testing/selftests/vm/cow.c +++ b/tools/testing/selftests/vm/cow.c @@ -650,7 +650,7 @@ static void do_test_ro_pin(char *mem, size_t size, enum ro_pin_test test, } /* Take a R...
d88825f22b8f1cad8acb429b6bf0a54c85d7b93f
Analyze and fix the following issue in the Linux kernel code: selftests/vm: madv_populate: fix missing MADV_POPULATE_(READ|WRITE) definitions
Problem Details: The tests fail to compile in some environments (e.g., Debian 11.5 on x86). Let's simply conditionally define MADV_POPULATE_(READ|WRITE) if not already defined, similar to how the khugepaged.c test handles it. Link: https://lkml.kernel.org/r/20221205193716.276024-3-david@redhat.com Fixes: 39b2e5cae43d ...
```diff diff --git a/tools/testing/selftests/vm/madv_populate.c b/tools/testing/selftests/vm/madv_populate.c index 60547245e479..262eae6b58f2 100644 --- a/tools/testing/selftests/vm/madv_populate.c +++ b/tools/testing/selftests/vm/madv_populate.c @@ -20,6 +20,13 @@ #include "../kselftest.h" #include "vm_util.h" +#i...
a0ac9b3598fac36907bd1baec28c99656d2ed0b6
Analyze and fix the following issue in the Linux kernel code: mm/gup_test: fix PIN_LONGTERM_TEST_READ with highmem
Problem Details: Patch series "selftests/vm: fix some tests on 32bit". I finally had the time to run some of the selftests written by me (especially "cow") on x86 PAE. I found some unexpected "surprises" :) With these changes, and with [1] on top of mm-unstable, the "cow" tests and the "ksm_functional_tests" compile...
```diff diff --git a/mm/gup_test.c b/mm/gup_test.c index 0d76d9b4bb5a..33f431e0da60 100644 --- a/mm/gup_test.c +++ b/mm/gup_test.c @@ -4,6 +4,7 @@ #include <linux/uaccess.h> #include <linux/ktime.h> #include <linux/debugfs.h> +#include <linux/highmem.h> #include "gup_test.h" static void put_back_pages(unsigned i...
6287b7dae80944bfa37784a8f9d6861a4facaa6e
Analyze and fix the following issue in the Linux kernel code: mm,thp,rmap: fix races between updates of subpages_mapcount
Problem Details: Commit 4b51634cd16a, introducing the COMPOUND_MAPPED bit, paid attention to the impossibility of subpages_mapcount ever appearing negative; but did not attend to those races in which it can momentarily appear larger than thought possible. These arise from how page_remove_rmap() first decrements page->...
```diff diff --git a/mm/rmap.c b/mm/rmap.c index 459dc1c44d8a..b616870a09be 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1232,7 +1232,7 @@ void page_add_anon_rmap(struct page *page, if (first && PageCompound(page)) { mapped = subpages_mapcount_ptr(compound_head(page)); nr = atomic_inc_return_relaxed(mapped); -...
c449deb2b99ff2458214ed4a3526277bc9e40757
Analyze and fix the following issue in the Linux kernel code: mm: memcg: fix swapcached stat accounting
Problem Details: I'd been worried by high "swapcached" counts in memcg OOM reports, thought we had a problem freeing swapcache, but it was just the accounting that was wrong. Two issues: 1. When __remove_mapping() removes swapcache, __delete_from_swap_cache() relies on memcg_data for the right counts to be upd...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ff65bc23be13..ab457f0394ab 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5767,6 +5767,12 @@ static int mem_cgroup_move_account(struct page *page, } } +#ifdef CONFIG_SWAP + if (folio_test_swapcache(folio)) { + __mod_lruvec_state(from_vec, NR_S...
adb8213014b25c7f1d75d5b219becaadcd695efb
Analyze and fix the following issue in the Linux kernel code: mm: memcg: fix stale protection of reclaim target memcg
Problem Details: Patch series "mm: memcg: fix protection of reclaim target memcg", v3. This series fixes a bug in calculating the protection of the reclaim target memcg where we end up using stale effective protection values from the last reclaim operation, instead of completely ignoring the protection of the reclaim ...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e1644a24009c..d3c8203cab6c 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -615,28 +615,32 @@ static inline void mem_cgroup_protection(struct mem_cgroup *root, void mem_cgroup_calculate_protection(struct mem_...
675eaca1f441acd4f0d403d71036b100cd49036a
Analyze and fix the following issue in the Linux kernel code: mm/mmap: properly unaccount memory on mas_preallocate() failure
Problem Details: security_vm_enough_memory_mm() accounts memory via a call to vm_acct_memory(). Therefore any subsequent failures should unaccount for this memory prior to returning the error. Link: https://lkml.kernel.org/r/20221202045339.2999017-1-apopple@nvidia.com Fixes: 28c5609fb236 ("mm/mmap: preallocate maple ...
```diff diff --git a/mm/mmap.c b/mm/mmap.c index 1741273ac34c..7d24fc478ffa 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2953,7 +2953,7 @@ static int do_brk_flags(struct ma_state *mas, struct vm_area_struct *vma, addr >> PAGE_SHIFT, NULL_VM_UFFD_CTX, NULL)) { mas_set_range(mas, vma->vm_start, addr + len - 1); ...
169004265860327182ecf92297b25b6271e81e96
Analyze and fix the following issue in the Linux kernel code: fsdax: introduce page->share for fsdax in reflink mode
Problem Details: Patch series "fsdax,xfs: fix warning messages", v2. Many testcases failed in dax+reflink mode with warning message in dmesg. Such as generic/051,075,127. The warning message is like this: [ 775.509337] ------------[ cut here ]------------ [ 775.509636] WARNING: CPU: 1 PID: 16815 at fs/dax.c:386 dax...
```diff diff --git a/fs/dax.c b/fs/dax.c index 1c6867810cbd..84fadea08705 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -334,35 +334,41 @@ static unsigned long dax_end_pfn(void *entry) for (pfn = dax_to_pfn(entry); \ pfn < dax_end_pfn(entry); pfn++) -static inline bool dax_mapping_is_cow(struct address_space *mapping...
0b7623bdf89b9f6d320784e929acb78291aaf5f6
Analyze and fix the following issue in the Linux kernel code: selftests/damon: test removed scheme sysfs dir access bug
Problem Details: A DAMON sysfs user could start DAMON with a scheme, remove the sysfs directory for the scheme, and then ask stats or schemes tried regions update. The related logic were not aware of the already removed directory situation, so it was able to results in invalid memory accesses. The fix has made with c...
```diff diff --git a/tools/testing/selftests/damon/Makefile b/tools/testing/selftests/damon/Makefile index 838a8e49f77b..b71247ba7196 100644 --- a/tools/testing/selftests/damon/Makefile +++ b/tools/testing/selftests/damon/Makefile @@ -8,7 +8,7 @@ TEST_PROGS = debugfs_attrs.sh debugfs_schemes.sh debugfs_target_ids.sh T...
c8c7016f50c85688d71feea2dba1bd955d5f5358
Analyze and fix the following issue in the Linux kernel code: kasan: fail non-kasan KUnit tests on KASAN reports
Problem Details: After the recent changes done to KUnit-enabled KASAN tests, non-KASAN KUnit tests stopped being failed when KASAN report is detected. Recover that property by failing the currently running non-KASAN KUnit test when KASAN detects and prints a report for a bad memory access. Note that if the bad access...
```diff diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index a84491bc4867..ea8cf1310b1e 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -541,6 +541,18 @@ static inline bool kasan_arch_is_ready(void) { return true; } #error kasan_arch_is_ready only works in KASAN generic outline mode! #endif +#if IS_ENABLE...
85716a80c16dd6b6d1aaed87cd4b91c9b1d9b9b2
Analyze and fix the following issue in the Linux kernel code: kmsan: allow using __msan_instrument_asm_store() inside runtime
Problem Details: In certain cases (e.g. when handling a softirq) __msan_instrument_asm_store(&var, sizeof(var)) may be called with from within KMSAN runtime, but later the value of @var is used with !kmsan_in_runtime(), leading to false positives. Because kmsan_internal_unpoison_memory() doesn't take locks, it should...
```diff diff --git a/mm/kmsan/instrumentation.c b/mm/kmsan/instrumentation.c index 271f135f97a1..770fe02904f3 100644 --- a/mm/kmsan/instrumentation.c +++ b/mm/kmsan/instrumentation.c @@ -81,12 +81,16 @@ DECLARE_METADATA_PTR_GETTER(8); * Handle a memory store performed by inline assembly. KMSAN conservatively * atte...
1e8e4a7cc2fa3017b1daf02612e095d51924ce1e
Analyze and fix the following issue in the Linux kernel code: lockdep: allow instrumenting lockdep.c with KMSAN
Problem Details: Lockdep and KMSAN used to play badly together, causing deadlocks when KMSAN instrumentation of lockdep.c called lockdep functions recursively. Looks like this is no more the case, and a kernel can run (yet slower) with both KMSAN and lockdep enabled. This patch should fix false positives on wq_head->...
```diff diff --git a/kernel/locking/Makefile b/kernel/locking/Makefile index ea925731fa40..0db4093d17b8 100644 --- a/kernel/locking/Makefile +++ b/kernel/locking/Makefile @@ -7,7 +7,6 @@ obj-y += mutex.o semaphore.o rwsem.o percpu-rwsem.o # Avoid recursion lockdep -> sanitizer -> ... -> lockdep. KCSAN_SANITIZE_lock...
3cd629e5775397103e0428f62ce64747741dbfe5
Analyze and fix the following issue in the Linux kernel code: mm/fadvise: use LLONG_MAX instead of -1 for eof
Problem Details: generic_fadvise() sets endbyte = -1 to specify end of file (i.e. if length == 0 is passed from userspace). Most other callers to filemap_fdatawrite_range() use LLONG_MAX for this purpose, particularly if they also call fdatawait_range() (which requires end >= start). For example, sync_file_range(), ...
```diff diff --git a/mm/fadvise.c b/mm/fadvise.c index c76ee665355a..bf04fec87f35 100644 --- a/mm/fadvise.c +++ b/mm/fadvise.c @@ -72,7 +72,7 @@ int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice) */ endbyte = (u64)offset + (u64)len; if (!len || endbyte < len) - endbyte = -1; + endbyt...
feeb9b26952367bc1171592ee476f95aa81ee588
Analyze and fix the following issue in the Linux kernel code: filemap: skip write and wait if end offset precedes start
Problem Details: Patch series "filemap: skip write and wait if end offset precedes start", v2. A fix for the odd write and wait behavior described in the patch 1 commit log. Technically patch 1 could simply remove the check rather than lift it into the callers, but this seemed a bit more user friendly to me. Patch 2...
```diff diff --git a/mm/filemap.c b/mm/filemap.c index 65eee6ec1066..242cd8bd8330 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -506,9 +506,6 @@ static void __filemap_fdatawait_range(struct address_space *mapping, struct pagevec pvec; int nr_pages; - if (end_byte < start_byte) - return; - pagevec_init(&pvec)...
6b3379e8dcbea09b7e27bf0eea2f53fd15a164ac
Analyze and fix the following issue in the Linux kernel code: zswap: fix writeback lock ordering for zsmalloc
Problem Details: Patch series "Implement writeback for zsmalloc", v7. Unlike other zswap allocators such as zbud or z3fold, zsmalloc currently lacks the writeback mechanism. This means that when the zswap pool is full, it will simply reject further allocations, and the pages will be written directly to swap. This se...
```diff diff --git a/mm/zswap.c b/mm/zswap.c index 3019f0bde194..f6c89049cf70 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -968,6 +968,7 @@ static int zswap_writeback_entry(struct zpool *pool, unsigned long handle) swpentry = zhdr->swpentry; /* here */ tree = zswap_trees[swp_type(swpentry)]; offset = swp_offset(sw...
fd3b1bc3c86ee11ba77421b00c70280605b521c6
Analyze and fix the following issue in the Linux kernel code: mm/madvise: fix madvise_pageout for private file mappings
Problem Details: When MADV_PAGEOUT is called on a private file mapping VMA region, we bail out early if the process is neither owner nor write capable of the file. However, this VMA may have both private/shared clean pages and private dirty pages. The opportunity of paging out the private dirty pages (Anon pages) is ...
```diff diff --git a/mm/madvise.c b/mm/madvise.c index 83b0c91a126b..2573ea3ed684 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -318,6 +318,21 @@ static long madvise_willneed(struct vm_area_struct *vma, return 0; } +static inline bool can_do_file_pageout(struct vm_area_struct *vma) +{ + if (!vma->vm_file) + ret...
f7355e99d9f71fcde093193fd4b569a648ba5ce3
Analyze and fix the following issue in the Linux kernel code: mm/gup: remove FOLL_MIGRATION
Problem Details: Fortunately, the last user (KSM) is gone, so let's just remove this rather special code from generic GUP handling -- especially because KSM never required the PMD handling as KSM only deals with individual base pages. [akpm@linux-foundation.org: fix merge snafu]Link: https://lkml.kernel.org/r/20221021...
```diff diff --git a/include/linux/mm.h b/include/linux/mm.h index 8df5cae69c80..767c8c522e70 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3057,7 +3057,6 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, * and return without waiting upon it */ #define FOLL_NOFAULT 0x8...
6cce3314b928b2db7d5f48171e18314226551c3f
Analyze and fix the following issue in the Linux kernel code: mm/ksm: fix KSM COW breaking with userfaultfd-wp via FAULT_FLAG_UNSHARE
Problem Details: Let's stop breaking COW via a fake write fault and let's use FAULT_FLAG_UNSHARE instead. This avoids any wrong side effects of the fake write fault, such as mapping the PTE writable and marking the pte dirty/softdirty. Consequently, we will no longer trigger a fake write fault and break COW without a...
```diff diff --git a/mm/ksm.c b/mm/ksm.c index 4efdc424a3fc..0805221e1d4c 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -420,17 +420,15 @@ static inline bool ksm_test_exit(struct mm_struct *mm) } /* - * We use break_ksm to break COW on a ksm page: it's a stripped down + * We use break_ksm to break COW on a ksm page by tr...
93fb70aa5904c2577fab8100fa990ecfa4f5b4c7
Analyze and fix the following issue in the Linux kernel code: selftests/vm: add KSM unmerge tests
Problem Details: Patch series "mm/ksm: break_ksm() cleanups and fixes", v2. This series cleans up and fixes break_ksm(). In summary, we no longer use fake write faults to break COW but instead FAULT_FLAG_UNSHARE. Further, we move away from using follow_page() --- that we can hopefully remove completely at one point ...
```diff diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index a4d764efd6e3..89c14e41bd43 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -55,6 +55,7 @@ TEST_GEN_FILES += userfaultfd TEST_GEN_PROGS += soft-dirty TEST_GEN_PROGS += spli...
13959373e9c9021cc80730c7bd1242e07b10b328
Analyze and fix the following issue in the Linux kernel code: powerpc/qspinlock: Fix 32-bit build
Problem Details: Some 32-bit configurations don't pull in the spin_begin/end/relax definitions. Fix is to restore a lost include. Reported-by: kernel test robot <lkp@intel.com> Fixes: 84990b169557 ("powerpc/qspinlock: add mcs queueing for contended waiters") Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-of...
```diff diff --git a/arch/powerpc/lib/qspinlock.c b/arch/powerpc/lib/qspinlock.c index 1cf5d3e75250..e4bd145255d0 100644 --- a/arch/powerpc/lib/qspinlock.c +++ b/arch/powerpc/lib/qspinlock.c @@ -3,6 +3,7 @@ #include <linux/compiler.h> #include <linux/export.h> #include <linux/percpu.h> +#include <linux/processor.h> ...
ee9d7a0e754568180a2f8ebc4aad226278a9116f
Analyze and fix the following issue in the Linux kernel code: of: overlay: fix null pointer dereferencing in find_dup_cset_node_entry() and find_dup_cset_prop()
Problem Details: When kmalloc() fail to allocate memory in kasprintf(), fn_1 or fn_2 will be NULL, and strcmp() will cause null pointer dereference. Fixes: 2fe0e8769df9 ("of: overlay: check prevents multiple fragments touching same property") Signed-off-by: ruanjinjie <ruanjinjie@huawei.com> Link: https://lore.kernel....
```diff diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index bd8ff4df723d..ed4e6c144a68 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -545,7 +545,7 @@ static int find_dup_cset_node_entry(struct overlay_changeset *ovcs, fn_1 = kasprintf(GFP_KERNEL, "%pOF", ce_1->np); fn_2 = kasprintf(...
c2d12e85336f6d4172fb2bab5935027c446d7343
Analyze and fix the following issue in the Linux kernel code: rtc: pcf85063: fix pcf85063_clkout_control
Problem Details: pcf85063_clkout_control reads the wrong register but then update the correct one. Reported-by: Janne Terho <janne.terho@ouman.fi> Fixes: 8c229ab6048b ("rtc: pcf85063: Add pcf85063 clkout control to common clock framework") Link: https://lore.kernel.org/r/20221211223553.59955-1-alexandre.belloni@bootli...
```diff diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c index 99f9cc57c7b3..754e03984f98 100644 --- a/drivers/rtc/rtc-pcf85063.c +++ b/drivers/rtc/rtc-pcf85063.c @@ -424,7 +424,7 @@ static int pcf85063_clkout_control(struct clk_hw *hw, bool enable) unsigned int buf; int ret; - ret = regmap_re...
103c14db61a24cc0cd344dc5d93d264a36687c35
Analyze and fix the following issue in the Linux kernel code: rtc: rx6110: fix warning with !OF
Problem Details: rx6110_spi_of_match is not used when !OF, leading to a warning: >> drivers/rtc/rtc-rx6110.c:384:34: warning: 'rx6110_spi_of_match' defined but not used [-Wunused-const-variable=] 384 | static const struct of_device_id rx6110_spi_of_match[] = { | ^~~~~~~~~...
```diff diff --git a/drivers/rtc/rtc-rx6110.c b/drivers/rtc/rtc-rx6110.c index cc634558b928..76a49838014b 100644 --- a/drivers/rtc/rtc-rx6110.c +++ b/drivers/rtc/rtc-rx6110.c @@ -376,7 +376,7 @@ static const struct spi_device_id rx6110_spi_id[] = { }; MODULE_DEVICE_TABLE(spi, rx6110_spi_id); -static const struct of...
21b8a1dd56a163825e5749b303858fb902ebf198
Analyze and fix the following issue in the Linux kernel code: rtc: msc313: Fix function prototype mismatch in msc313_rtc_probe()
Problem Details: With clang's kernel control flow integrity (kCFI, CONFIG_CFI_CLANG), indirect call targets are validated against the expected function pointer prototype to make sure the call target is valid to help mitigate ROP attacks. If they are not identical, there is a failure at run time, which manifests as eith...
```diff diff --git a/drivers/rtc/rtc-msc313.c b/drivers/rtc/rtc-msc313.c index f3fde013c4b8..8d7737e0e2e0 100644 --- a/drivers/rtc/rtc-msc313.c +++ b/drivers/rtc/rtc-msc313.c @@ -212,22 +212,12 @@ static int msc313_rtc_probe(struct platform_device *pdev) return ret; } - clk = devm_clk_get(dev, NULL); + clk = dev...
01f6c61bae3d658058ee6322af77acea26a5ee3a
Analyze and fix the following issue in the Linux kernel code: ksmbd: Fix resource leak in smb2_lock()
Problem Details: "flock" is leaked if an error happens before smb2_lock_init(), as the lock is not added to the lock_list to be cleaned up. Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
```diff diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index 79261493a212..88d2c23369fe 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -6857,6 +6857,7 @@ int smb2_lock(struct ksmbd_work *work) if (lock_start > U64_MAX - lock_length) { pr_err("Invalid lock range requested\n"); rsp->hdr.Stat...
bc044414fa0326a4e5c3c509c00b1fcaf621b5f4
Analyze and fix the following issue in the Linux kernel code: ksmbd: Fix resource leak in ksmbd_session_rpc_open()
Problem Details: When ksmbd_rpc_open() fails then it must call ksmbd_rpc_id_free() to undo the result of ksmbd_ipc_id_alloc(). Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve Frenc...
```diff diff --git a/fs/ksmbd/mgmt/user_session.c b/fs/ksmbd/mgmt/user_session.c index 3fa2139a0b30..92b1603b5abe 100644 --- a/fs/ksmbd/mgmt/user_session.c +++ b/fs/ksmbd/mgmt/user_session.c @@ -108,15 +108,17 @@ int ksmbd_session_rpc_open(struct ksmbd_session *sess, char *rpc_name) entry->method = method; entry->i...
dbc94a0fb81771a38733c0e8f2ea8c4fa6934dc1
Analyze and fix the following issue in the Linux kernel code: IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces
Problem Details: There are 2 ways to create IPoIB PKEY child interfaces: 1) Writing a PKEY to /sys/class/net/<ib parent interface>/create_child. 2) Using netlink with iproute. While with sysfs the child interface has the same number of tx and rx queues as the parent, with netlink there will always be 1 tx and 1 rx que...
```diff diff --git a/drivers/infiniband/ulp/ipoib/ipoib_netlink.c b/drivers/infiniband/ulp/ipoib/ipoib_netlink.c index ea16ba5d8da6..9ad8d9856275 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_netlink.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_netlink.c @@ -41,6 +41,11 @@ static const struct nla_policy ipoib_policy[IF...
80b6093b55e31c2c40ff082fb32523d4e852954f
Analyze and fix the following issue in the Linux kernel code: kbuild: add -Wundef to KBUILD_CPPFLAGS for W=1 builds
Problem Details: The use of an undefined macro in an #if directive is warned, but only in *.c files. No warning from other files such as *.S, *.lds.S. Since -Wundef is a preprocessor-related warning, it should be added to KBUILD_CPPFLAGS instead of KBUILD_CFLAGS. My previous attempt [1] uncovered several issues. I co...
```diff diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index 6bbba36c5969..40cd13eca82e 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -38,6 +38,7 @@ KBUILD_CFLAGS += -Wno-sign-compare KBUILD_CFLAGS += -Wno-type-limits KBUILD_CFLAGS += -Wno-shift-negative-value +KB...
e42f9c2e6aad583986e91979bf2fce47aaced1c2
Analyze and fix the following issue in the Linux kernel code: RDMA: Add missed netdev_put() for the netdevice_tracker
Problem Details: The netdev core will detect if any untracked puts are done on tracked pointers and throw refcount warnings: refcount_t: decrement hit 0; leaking memory. WARNING: CPU: 1 PID: 33 at lib/refcount.c:31 refcount_warn_saturate+0x1d7/0x1f0 lib/refcount.c:31 Modules linked in: CPU: 1 PID: 33 Comm: kwo...
```diff diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 9211d2794aac..894c06846224 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -2201,7 +2201,7 @@ static void free_netdevs(struct ib_device *ib_dev) * comparisons after the put */...
1dbd8d9a82e3f26b9d063292d47ece673f48fce2
Analyze and fix the following issue in the Linux kernel code: ipvs: use u64_stats_t for the per-cpu counters
Problem Details: Use the provided u64_stats_t type to avoid load/store tearing. Fixes: 316580b69d0a ("u64_stats: provide u64_stats_t type") Signed-off-by: Julian Anastasov <ja@ssi.bg> Cc: yunhong-cgl jiang <xintian1976@gmail.com> Cc: "dust.li" <dust.li@linux.alibaba.com> Reviewed-by: Jiri Wiesner <jwiesner@suse.de> Te...
```diff diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index e5582c01a4a3..a4d44138c2a8 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h @@ -351,11 +351,11 @@ struct ip_vs_seq { /* counters per cpu */ struct ip_vs_counters { - __u64 conns; /* connections scheduled */ - __u64 inpkts; /* incomin...
90cd5c88830140c9fade92a8027e0fb2c6e4cc49
Analyze and fix the following issue in the Linux kernel code: rtc: pic32: Move devm_rtc_allocate_device earlier in pic32_rtc_probe()
Problem Details: The pic32_rtc_enable(pdata, 0) and clk_disable_unprepare(pdata->clk) should be called in the error handling of devm_rtc_allocate_device(), so we should move devm_rtc_allocate_device earlier in pic32_rtc_probe() to fix it. Fixes: 6515e23b9fde ("rtc: pic32: convert to devm_rtc_allocate_device") Signed-o...
```diff diff --git a/drivers/rtc/rtc-pic32.c b/drivers/rtc/rtc-pic32.c index 7fb9145c43bd..fa351ac20158 100644 --- a/drivers/rtc/rtc-pic32.c +++ b/drivers/rtc/rtc-pic32.c @@ -324,16 +324,16 @@ static int pic32_rtc_probe(struct platform_device *pdev) spin_lock_init(&pdata->alarm_lock); + pdata->rtc = devm_rtc_allo...
5fb733d7bd6949e90028efdce8bd528c6ab7cf1e
Analyze and fix the following issue in the Linux kernel code: rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
Problem Details: The clk_disable_unprepare() should be called in the error handling of clk_get_rate(), fix it. Fixes: b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Link: https://lore.kernel.org/r/20221123014805.1993052-1-cuigaosheng1@huawei.com Signed-o...
```diff diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c index bdb20f63254e..0f8e4231098e 100644 --- a/drivers/rtc/rtc-st-lpc.c +++ b/drivers/rtc/rtc-st-lpc.c @@ -238,6 +238,7 @@ static int st_rtc_probe(struct platform_device *pdev) rtc->clkrate = clk_get_rate(rtc->clk); if (!rtc->clkrate) { + cl...
2026f2062df860e5d282ffd4962ea5d5ed53dc51
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add pruning test case for bpf_spin_lock
Problem Details: Test that when reg->id is not same for the same register of type PTR_TO_MAP_VALUE between current and old explored state, we currently return false from regsafe and continue exploring. Without the fix in prior commit, the test case fails. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Sign...
```diff diff --git a/tools/testing/selftests/bpf/verifier/spin_lock.c b/tools/testing/selftests/bpf/verifier/spin_lock.c index 781621facae4..0a8dcfc37fc6 100644 --- a/tools/testing/selftests/bpf/verifier/spin_lock.c +++ b/tools/testing/selftests/bpf/verifier/spin_lock.c @@ -331,3 +331,42 @@ .errstr = "inside bpf_spin...
4ea2bb158bec2fe171e7e07c033dcf208d86e274
Analyze and fix the following issue in the Linux kernel code: bpf: use check_ids() for active_lock comparison
Problem Details: An update for verifier.c:states_equal()/regsafe() to use check_ids() for active spin lock comparisons. This fixes the issue reported by Kumar Kartikeya Dwivedi in [1] using technique suggested by Edward Cree. W/o this commit the verifier might be tricked to accept the following program working with a ...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 00c8e0a28203..a5255a0dcbb6 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -13119,7 +13119,8 @@ static bool regsafe(struct bpf_verifier_env *env, struct bpf_reg_state *rold, */ return memcmp(rold, rcur, offsetof(struct bpf...
cb578c1c9cf60275f258b5af7929c2a54a188f66
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: test cases for regsafe() bug skipping check_id()
Problem Details: Under certain conditions it was possible for verifier.c:regsafe() to skip check_id() call. This commit adds negative test cases previously errorneously accepted as safe. Signed-off-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20221209135733.28851-3-eddyz87@gmail.com Signed-...
```diff diff --git a/tools/testing/selftests/bpf/verifier/direct_packet_access.c b/tools/testing/selftests/bpf/verifier/direct_packet_access.c index 11acd1855acf..dce2e28aeb43 100644 --- a/tools/testing/selftests/bpf/verifier/direct_packet_access.c +++ b/tools/testing/selftests/bpf/verifier/direct_packet_access.c @@ -6...
e0c49bd2b4d3cd1751491eb2d940bce968ac65e9
Analyze and fix the following issue in the Linux kernel code: fs: sysv: Fix sysv_nblocks() returns wrong value
Problem Details: sysv_nblocks() returns 'blocks' rather than 'res', which only counting the number of triple-indirect blocks and causing sysv_getattr() gets a wrong result. [AV: this is actually a sysv counterpart of minixfs fix - 0fcd426de9d0 "[PATCH] minix block usage counting fix" in historical tree; mea culpa, sho...
```diff diff --git a/fs/sysv/itree.c b/fs/sysv/itree.c index d4ec9bb97de9..3b8567564e7e 100644 --- a/fs/sysv/itree.c +++ b/fs/sysv/itree.c @@ -438,7 +438,7 @@ static unsigned sysv_nblocks(struct super_block *s, loff_t size) res += blocks; direct = 1; } - return blocks; + return res; } int sysv_getattr(struc...
0e162c6f1c8f7f502b3978f5a37ed6fa2e4d21f9
Analyze and fix the following issue in the Linux kernel code: Documentation/osnoise: Escape underscore of NO_ prefix
Problem Details: kernel test robot reported unknown target name warning: Documentation/trace/osnoise-tracer.rst:112: WARNING: Unknown target name: "no". The warning causes NO_ prefix to be rendered as link text instead, which points to non-existent link target. Escape the prefix underscore to fix the warning. Link:...
```diff diff --git a/Documentation/trace/osnoise-tracer.rst b/Documentation/trace/osnoise-tracer.rst index 3c675ed82b27..fdd562d7c22d 100644 --- a/Documentation/trace/osnoise-tracer.rst +++ b/Documentation/trace/osnoise-tracer.rst @@ -111,7 +111,7 @@ The tracer has a set of options inside the osnoise directory, they ar...
bfd5a5e82d22da43afa0e2bb9fb72339aa79c6cc
Analyze and fix the following issue in the Linux kernel code: tracing: Fix some checker warnings
Problem Details: Fix some checker warnings in the trace code by adding __printf attributes to a number of trace functions and their declarations. Changes: ======== ver #2) - Dropped the fix for the unconditional tracing_max_lat_fops decl[1]. Link: https://lore.kernel.org/r/20221205180617.9b9d3971cbe06ee536603523@ker...
```diff diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h index bb2053246d6a..4342e996bcdb 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -234,7 +234,8 @@ void tracing_record_taskinfo_sched_switch(struct task_struct *prev, void tracing_record_cmdline(struct task_...
98629dadcd020cba690ce0c49a564a1166444646
Analyze and fix the following issue in the Linux kernel code: tracing: remove unnecessary trace_trigger ifdef
Problem Details: The trace_trigger command line option introduced by commit a01fdc897fa5 ("tracing: Add trace_trigger kernel command line option") doesn't need to depend on the CONFIG_HIST_TRIGGERS kernel config option. This code doesn't depend on the histogram code, and the run-time selection of triggers is usable wi...
```diff diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 3bfaf560ecc4..33e0b4f8ebe6 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2796,7 +2796,6 @@ trace_create_new_event(struct trace_event_call *call, return file; } -#ifdef CONFIG_HIST_TRIGGERS #define...
88ca6a71dcab4a4ba6e6e2ff66415a5c4f86e874
Analyze and fix the following issue in the Linux kernel code: ring-buffer: Handle resize in early boot up
Problem Details: With the new command line option that allows trace event triggers to be added at boot, the "snapshot" trigger will allocate the snapshot buffer very early, when interrupts can not be enabled. Allocating the ring buffer is not the problem, but it also resizes it, which is, as the resize code does synchr...
```diff diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 843818ee4814..c366a0a9ddba 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -2062,8 +2062,10 @@ rb_insert_pages(struct ring_buffer_per_cpu *cpu_buffer) { struct list_head *pages = &cpu_buffer->new_pages; i...
608c6ed3337850c767ab0dd6c583477922233e29
Analyze and fix the following issue in the Linux kernel code: tracing/hist: Fix issue of losting command info in error_log
Problem Details: When input some constructed invalid 'trigger' command, command info in 'error_log' are lost [1]. The root cause is that there is a path that event_hist_trigger_parse() is recursely called once and 'last_cmd' which save origin command is cleared, then later calling of hist_err() will no longer record o...
```diff diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 8264b28d5a57..fcaf226b7744 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -6576,7 +6576,7 @@ enable: if (se) se->ref++; out: - if (ret == 0) + if (ret == 0 && glob[0]) hist_e...
ff4837f7fe59ff018eca4705a70eca5e0b486b97
Analyze and fix the following issue in the Linux kernel code: tracing: Fix issue of missing one synthetic field
Problem Details: The maximum number of synthetic fields supported is defined as SYNTH_FIELDS_MAX which value currently is 64, but it actually fails when try to generate a synthetic event with 64 fields by executing like: # echo "my_synth_event int v1; int v2; int v3; int v4; int v5; int v6;\ int v7; int v8; int v...
```diff diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c index c3b582d19b62..67592eed0be8 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -1282,12 +1282,12 @@ static int __create_synth_event(const char *name, const char *raw_fields) goto e...
82470f7d9044842618c847a7166de2b7458157a7
Analyze and fix the following issue in the Linux kernel code: tracing/hist: Fix out-of-bound write on 'action_data.var_ref_idx'
Problem Details: When generate a synthetic event with many params and then create a trace action for it [1], kernel panic happened [2]. It is because that in trace_action_create() 'data->n_params' is up to SYNTH_FIELDS_MAX (current value is 64), and array 'data->var_ref_idx' keeps indices into array 'hist_data->var_re...
```diff diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index b4ad86c22b43..8264b28d5a57 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -621,7 +621,7 @@ struct action_data { * event param, and is passed to the synthetic event * invocation. ...
2cc6a528882d0e0ccbc1bca5f95b8c963cedac54
Analyze and fix the following issue in the Linux kernel code: tracing/hist: Fix wrong return value in parse_action_params()
Problem Details: When number of synth fields is more than SYNTH_FIELDS_MAX, parse_action_params() should return -EINVAL. Link: https://lore.kernel.org/linux-trace-kernel/20221207034635.2253990-1-zhengyejian1@huawei.com Cc: <mhiramat@kernel.org> Cc: <zanussi@kernel.org> Cc: stable@vger.kernel.org Fixes: c282a386a397 (...
```diff diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index a0cd118af527..b4ad86c22b43 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -3609,6 +3609,7 @@ static int parse_action_params(struct trace_array *tr, char *params, while (params) { ...
2bfa89fab5ff06703c034c4702e6ea4418194ffe
Analyze and fix the following issue in the Linux kernel code: x86/PCI: Fix log message typo
Problem Details: Add missing word in the log message: - ... so future kernels can this automatically + ... so future kernels can do this automatically Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com> Link: https://lore.kernel.org/r/20221208190341.1560157-5-helgaas@kernel.org Signed-off-by: Bjorn Helgaa...
```diff diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 2f82480fd430..83dfea9e9894 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -245,7 +245,7 @@ void __init pci_acpi_crs_quirks(void) printk(KERN_INFO "PCI: %s E820 reservations for host bridge windows\n", pci_use_e820 ? "Using" :...
07eab0901ede8b7540c52160663bd300cc238164
Analyze and fix the following issue in the Linux kernel code: efi/x86: Remove EfiMemoryMappedIO from E820 map
Problem Details: Firmware can use EfiMemoryMappedIO to request that MMIO regions be mapped by the OS so they can be accessed by EFI runtime services, but should have no other significance to the OS (UEFI r2.10, sec 7.2). However, most bootloaders and EFI stubs convert EfiMemoryMappedIO regions to E820_TYPE_RESERVED en...
```diff diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index ebc98a68c400..75bf0e56bb53 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -303,6 +303,50 @@ static void __init efi_clean_memmap(void) } } +/* + * Firmware can use EfiMemoryMappedIO to request that MM...
4dd9daa9124aad3c3d4ceca4f1d417cc62d59156
Analyze and fix the following issue in the Linux kernel code: SUNRPC: Fix crasher in unwrap_integ_data()
Problem Details: If a zero length is passed to kmalloc() it returns 0x10, which is not a valid address. gss_verify_mic() subsequently crashes when it attempts to dereference that pointer. Instead of allocating this memory on every call based on an untrusted size value, use a piece of dynamically-allocated scratch memo...
```diff diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 9a5db285d4ae..148bb0a7fa5b 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -49,11 +49,36 @@ #include <linux/sunrpc/svcauth.h> #include <linux/sunrpc/svcauth_gss.h> #include <linu...
da522b5fe1a5f8b7c20a0023e87b52a150e53bf5
Analyze and fix the following issue in the Linux kernel code: SUNRPC: Don't leak netobj memory when gss_read_proxy_verf() fails
Problem Details: Fixes: 030d794bf498 ("SUNRPC: Use gssproxy upcall for server RPCGSS authentication.") Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: <stable@vger.kernel.org> Reviewed-by: Jeff Layton <jlayton@kernel.org>
```diff diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index bcd74dddbe2d..9a5db285d4ae 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -1162,18 +1162,23 @@ static int gss_read_proxy_verf(struct svc_rqst *rqstp, return res; inlen = svc...
79a1d88a36f77374c77fd41a4386d8c2736b8704
Analyze and fix the following issue in the Linux kernel code: NFSD: pass range end to vfs_fsync_range() instead of count
Problem Details: _nfsd_copy_file_range() calls vfs_fsync_range() with an offset and count (bytes written), but the former wants the start and end bytes of the range to sync. Fix it up. Fixes: eac0b17a77fb ("NFSD add vfs_fsync after async copy is done") Signed-off-by: Brian Foster <bfoster@redhat.com> Tested-by: Dai Ng...
```diff diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index a6173677b766..73ed32ad23a2 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1642,6 +1642,7 @@ static ssize_t _nfsd_copy_file_range(struct nfsd4_copy *copy, u64 src_pos = copy->cp_src_pos; u64 dst_pos = copy->cp_dst_pos; int status; + l...
9f27783b4dd235ef3c8dbf69fc6322777450323c
Analyze and fix the following issue in the Linux kernel code: lockd: fix file selection in nlmsvc_cancel_blocked
Problem Details: We currently do a lock_to_openmode call based on the arguments from the NLM_UNLOCK call, but that will always set the fl_type of the lock to F_UNLCK, and the O_RDONLY descriptor is always chosen. Fix it to use the file_lock from the block instead. Signed-off-by: Jeff Layton <jlayton@kernel.org> Signe...
```diff diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index 9eae99e08e69..4e30f3c50970 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -699,9 +699,10 @@ nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *l block = nlmsvc_lookup_block(file, lock); mutex_unlock(&file->f_...
01d53a88c08951f88f2a42f1f1e6568928e0590e
Analyze and fix the following issue in the Linux kernel code: nfsd: return error if nfs4_setacl fails
Problem Details: With the addition of POSIX ACLs to struct nfsd_attrs, we no longer return an error if setting the ACL fails. Ensure we return the na_aclerr error on SETATTR if there is one. Fixes: c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs") Cc: Neil Brown <neilb@suse.de> Reported-by: Yongcheng Yang <yo...
```diff diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 6f7e0c5e62d2..a6173677b766 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1135,6 +1135,8 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 0, (time64_t)0); if (!status) status = nfserrno(attrs.na_label...
18ebd35b61b4693a0ddc270b6d4f18def232e770
Analyze and fix the following issue in the Linux kernel code: lockd: set other missing fields when unlocking files
Problem Details: vfs_lock_file() expects the struct file_lock to be fully initialised by the caller. Re-exported NFSv3 has been seen to Oops if the fl_file field is NULL. Fixes: aec158242b87 ("lockd: set fl_owner when unlocking files") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Jeff ...
```diff diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index e1c4617de771..3515f17eaf3f 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c @@ -176,7 +176,7 @@ nlm_delete_file(struct nlm_file *file) } } -static int nlm_unlock_files(struct nlm_file *file, fl_owner_t owner) +static int nlm_unlock_files(st...
22ae4c114f77b55a4c5036e8f70409a0799a08f8
Analyze and fix the following issue in the Linux kernel code: nfsd: fix up the filecache laundrette scheduling
Problem Details: We don't really care whether there are hashed entries when it comes to scheduling the laundrette. They might all be non-gc entries, after all. We only want to schedule it if there are entries on the LRU. Switch to using list_lru_count, and move the check into nfsd_file_gc_worker. The other callsite in...
```diff diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 1418bc889aa0..da7c9cb12403 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -211,12 +211,9 @@ static const struct rhashtable_params nfsd_file_rhash_params = { static void nfsd_file_schedule_laundrette(void) { - if ((atomic_read(&nfsd_f...
0bf582fc51684dc4380b0b9248112cf9f837a585
Analyze and fix the following issue in the Linux kernel code: can: kvaser_usb: kvaser_usb_set_{,data}bittiming(): remove empty lines in variable declaration
Problem Details: Fix coding style by removing empty lines in variable declaration. Fixes: 39d3df6b0ea8 ("can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming") Cc: Jimmy Assarsson <extja@kvaser.com> Cc: Anssi Hannula <anssi.hannula@bitwise.fi> Link: https://lore.ke...
```diff diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c index b17c4d8c6cf9..d4c5356d5884 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c @@ -536,7 +536,6 @@ static int kvaser_usb_set_bit...
cce2d7d2abcc8d083fbb24e795089542f1e742c8
Analyze and fix the following issue in the Linux kernel code: can: kvaser_usb: kvaser_usb_set_bittiming(): fix redundant initialization warning for err
Problem Details: The variable err is initialized, but the initialized value is Overwritten before it is read. Fix the warning by not initializing the variable err at all. Fixes: 39d3df6b0ea8 ("can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming") Cc: Jimmy Assarss...
```diff diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c index 3a2bfaad1406..b17c4d8c6cf9 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c @@ -541,7 +541,7 @@ static int kvaser_usb_set_bit...
e9d48abbce93e2138e37a695ba5931f3d3c9fdd9
Analyze and fix the following issue in the Linux kernel code: kselftests: hid: fix missing headers_install step
Problem Details: The Makefile was assuming that headers_install was already done in the top source directory, and was searching for installed uapi headers there. Unfortunately this is not the case and we need to manually call that step. To do so, reorder the declaration of the variables, and reuses top_srcdir provided...
```diff diff --git a/tools/testing/selftests/hid/Makefile b/tools/testing/selftests/hid/Makefile index 693f1cb6e47a..f6fc5cfff770 100644 --- a/tools/testing/selftests/hid/Makefile +++ b/tools/testing/selftests/hid/Makefile @@ -7,17 +7,9 @@ include ../../../scripts/Makefile.include CXX ?= $(CROSS_COMPILE)g++ -CURDI...
4e0b1b0731bd355a4dee279a270bdd5b29e68b85
Analyze and fix the following issue in the Linux kernel code: HID: bpf: enforce HID_BPF dependencies
Problem Details: As mentioned in the link below, having JIT and BPF is not enough to have fentry/fexit/fmod_ret APIs. This resolves the error that happens on a system without tracing enabled when hid-bpf tries to load itself. Link: https://lore.kernel.org/r/CABRcYmKyRchQhabi1Vd9RcMQFCcb=EtWyEbFDFRTc-L-U8WhgA@mail.gmai...
```diff diff --git a/drivers/hid/bpf/Kconfig b/drivers/hid/bpf/Kconfig index 298634fc3335..03f52145b83b 100644 --- a/drivers/hid/bpf/Kconfig +++ b/drivers/hid/bpf/Kconfig @@ -4,7 +4,8 @@ menu "HID-BPF support" config HID_BPF bool "HID-BPF support" default HID_SUPPORT - depends on BPF && BPF_SYSCALL + depends on BP...
4994e387d7332f03cd4eab55f7896ddf04cab1c0
Analyze and fix the following issue in the Linux kernel code: x86/mm/kmmio: Switch to arch_spin_lock()
Problem Details: The mmiotrace tracer is "special". The purpose is to help reverse engineer binary drivers by removing the memory allocated by the driver and when the driver goes to access it, a fault occurs, the mmiotracer will record what the driver was doing and then do the work on its behalf by single stepping thro...
```diff diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index d3efbc5b3449..edb486450158 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c @@ -62,7 +62,13 @@ struct kmmio_context { int active; }; -static DEFINE_SPINLOCK(kmmio_lock); +/* + * The kmmio_lock is taken in int3 context, which is treated ...
e25e43a4e5d8cb2323553d8b6a7ba08d2ebab21f
Analyze and fix the following issue in the Linux kernel code: tracing: Fix complicated dependency of CONFIG_TRACER_MAX_TRACE
Problem Details: Both CONFIG_OSNOISE_TRACER and CONFIG_HWLAT_TRACER partially enables the CONFIG_TRACER_MAX_TRACE code, but that is complicated and has introduced a bug; It declares tracing_max_lat_fops data structure outside of #ifdefs, but since it is defined only when CONFIG_TRACER_MAX_TRACE=y or CONFIG_HWLAT_TRACER...
```diff diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index e9e95c790b8e..93d724996283 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -375,6 +375,7 @@ config SCHED_TRACER config HWLAT_TRACER bool "Tracer to detect hardware latencies (like SMIs)" select GENERIC_TRACER + select TRACER_MAX...
575b76cb885532aae13a9d979fd476bb2b156cb9
Analyze and fix the following issue in the Linux kernel code: tracing/probes: Handle system names with hyphens
Problem Details: When creating probe names, a check is done to make sure it matches basic C standard variable naming standards. Basically, starts with alphabetic or underline, and then the rest of the characters have alpha-numeric or underline in them. But system names do not have any true naming conventions, as they ...
```diff diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 48643f07bc01..8f37ff032b4f 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -1954,17 +1954,30 @@ static __always_inline void trace_iterator_reset(struct trace_iterator *iter) } /* Check the name is good for event/group/fields */ -...
8c2b99790196d34a58a2b00a4c9862d2de3af3e2
Analyze and fix the following issue in the Linux kernel code: tracing: docs: Update histogram doc for .percent/.graph and 'nohitcount'
Problem Details: Update histogram document for .percent/.graph suffixes and 'nohitcount' option. Link: https://lore.kernel.org/linux-trace-kernel/166610815604.56030.4124933216911828519.stgit@devnote2 Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Reviewed-by: Tom Zanussi <zanussi@kernel.org> Tested-by...
```diff diff --git a/Documentation/trace/histogram.rst b/Documentation/trace/histogram.rst index 87bd772836c0..f95459aa984f 100644 --- a/Documentation/trace/histogram.rst +++ b/Documentation/trace/histogram.rst @@ -25,7 +25,7 @@ Documentation written by Tom Zanussi hist:keys=<field1[,field2,...]>[:values=<fi...
ccf47f5cc4cebdba7444cf1c04fc1b02d4b3cd15
Analyze and fix the following issue in the Linux kernel code: tracing: Add nohitcount option for suppressing display of raw hitcount
Problem Details: Add 'nohitcount' ('NOHC' for short) option for suppressing display of the raw hitcount column in the histogram. Note that you must specify at least one value except raw 'hitcount' when you specify this nohitcount option. # cd /sys/kernel/debug/tracing/ # echo hist:keys=pid:vals=runtime.percent,run...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 55aec4616d8b..948f321b9df1 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5678,6 +5678,7 @@ static const char readme_msg[] = "\t [:size=#entries]\n" "\t [:pause][:continue][:clear]\n" "\t [:na...
a2c54256dec7510477e2b4f4db187e638f7cac37
Analyze and fix the following issue in the Linux kernel code: tracing: Add .graph suffix option to histogram value
Problem Details: Add the .graph suffix which shows the bar graph of the histogram value. For example, the below example shows that the bar graph of the histogram of the runtime for each tasks. ------ # cd /sys/kernel/debug/tracing/ # echo hist:keys=pid:vals=runtime.graph:sort=pid > \ events/sched/sched_stat_ru...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 08e9568849b1..55aec4616d8b 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5725,7 +5725,8 @@ static const char readme_msg[] = "\t .log2 display log2 value rather than raw number\n" "\t .buckets=size ...
abaa5258ce5e5887a9de049f50a85dc023391a1c
Analyze and fix the following issue in the Linux kernel code: tracing: Add .percent suffix option to histogram values
Problem Details: Add .percent suffix option to show the histogram values in percentage. This feature is useful when we need yo undersntand the overall trend for the histograms of large values. E.g. this shows the runtime percentage for each tasks. ------ # cd /sys/kernel/debug/tracing/ # echo hist:keys=pid:vals=hi...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 93a75a97118f..08e9568849b1 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5724,7 +5724,8 @@ static const char readme_msg[] = "\t .syscall display a syscall id as a syscall name\n" "\t .log2 displa...
5f2e094ed2592abb3d1f49e263957188e121c2ac
Analyze and fix the following issue in the Linux kernel code: tracing: Allow multiple hitcount values in histograms
Problem Details: The hitcount is treated specially in the histograms - since it's always expected to be there regardless of whether the user specified anything or not, it's always added as the first histogram value. Currently the code doesn't allow it to be added more than once as a value, which is inconsistent with a...
```diff diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 1c82478e8dff..31d58ddcc1d9 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1356,6 +1356,8 @@ static const char *hist_field_name(struct hist_field *field, field_name = field->name; ...
ce098da1497c6dee9589fce2c61d1910f4fcf0e7
Analyze and fix the following issue in the Linux kernel code: skbuff: Introduce slab_build_skb()
Problem Details: syzkaller reported: BUG: KASAN: slab-out-of-bounds in __build_skb_around+0x235/0x340 net/core/skbuff.c:294 Write of size 32 at addr ffff88802aa172c0 by task syz-executor413/5295 For bpf_prog_test_run_skb(), which uses a kmalloc()ed buffer passed to build_skb(). When build_skb() is passed a frag_...
```diff diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c index dbe310144780..9f473854b0f4 100644 --- a/drivers/net/ethernet/broadcom/bnx2.c +++ b/drivers/net/ethernet/broadcom/bnx2.c @@ -3045,7 +3045,7 @@ error: dma_unmap_single(&bp->pdev->dev, dma_addr, bp->rx_buf_use_size, ...
28d39503e4e06c2caf09a89865c81cfd9e4eae7c
Analyze and fix the following issue in the Linux kernel code: net: bcmgenet: Remove the unused function
Problem Details: The function dmadesc_get_addr() is defined in the bcmgenet.c file, but not called elsewhere, so remove this unused function. drivers/net/ethernet/broadcom/genet/bcmgenet.c:120:26: warning: unused function 'dmadesc_get_addr'. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3401 Reported-by: Abaci...
```diff diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index a8ce8d0cf9c4..21973046b12b 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -117,24 +117,6 @@ static inline void dmadesc_set(struc...
9daaca4a44d6f0741060e67c54a0175c035edb1f
Analyze and fix the following issue in the Linux kernel code: RISC-V: Ensure Zicbom has a valid block size
Problem Details: When a DT puts zicbom in the isa string, but does not provide a block size, ALT_CMO_OP() will attempt to do cache operations on address zero since the start address will be ANDed with zero. We can't simply BUG() in riscv_init_cbom_blocksize() when we fail to find a block size because the failure will h...
```diff diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 220be7222129..93e45560af30 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -9,6 +9,7 @@ #include <linux/bitmap.h> #include <linux/ctype.h> #include <linux/libfdt.h> +#include <linux/log2.h> ...
4a7ba45b1a435e7097ca0f79a847d0949d0eb088
Analyze and fix the following issue in the Linux kernel code: memcg: fix possible use-after-free in memcg_write_event_control()
Problem Details: memcg_write_event_control() accesses the dentry->d_name of the specified control fd to route the write call. As a cgroup interface file can't be renamed, it's safe to access d_name as long as the specified file is a regular cgroup file. Also, as these cgroup interface files can't be removed before th...
```diff diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 528bd44b59e2..2b7d077de7ef 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -68,6 +68,7 @@ struct css_task_iter { struct list_head iters_node; /* css_set->task_iters */ }; +extern struct file_system_type cgroup_fs_type; ...
fcd0ccd836ffad73d98a66f6fea7b16f735ea920
Analyze and fix the following issue in the Linux kernel code: mm/gup: fix gup_pud_range() for dax
Problem Details: For dax pud, pud_huge() returns true on x86. So the function works as long as hugetlb is configured. However, dax doesn't depend on hugetlb. Commit 414fd080d125 ("mm/gup: fix gup_pmd_range() for dax") fixed devmap-backed huge PMDs, but missed devmap-backed huge PUDs. Fix this as well. This fixes the b...
```diff diff --git a/mm/gup.c b/mm/gup.c index fe195d47de74..3b7bc2c1fd44 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2852,7 +2852,7 @@ static int gup_pud_range(p4d_t *p4dp, p4d_t p4d, unsigned long addr, unsigned lo next = pud_addr_end(addr, end); if (unlikely(!pud_present(pud))) return 0; - if (unlikely(pud_h...
6c28ca6485ddd7c5da171e479e3ebfbe661efc4d
Analyze and fix the following issue in the Linux kernel code: mmap: fix do_brk_flags() modifying obviously incorrect VMAs
Problem Details: Add more sanity checks to the VMA that do_brk_flags() will expand. Ensure the VMA matches basic merge requirements within the function before calling can_vma_merge_after(). Drop the duplicate checks from vm_brk_flags() since they will be enforced later. The old code would expand file VMAs on brk(), ...
```diff diff --git a/mm/mmap.c b/mm/mmap.c index 0024e615d069..1d9aac3aa899 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2948,9 +2948,9 @@ static int do_brk_flags(struct ma_state *mas, struct vm_area_struct *vma, * Expand the existing vma if possible; Note that singular lists do not * occur after forking, so the ex...
630dc25e43dacfb5af94cd41532e77c47ec1caff
Analyze and fix the following issue in the Linux kernel code: mm/swap: fix SWP_PFN_BITS with CONFIG_PHYS_ADDR_T_64BIT on 32bit
Problem Details: We use "unsigned long" to store a PFN in the kernel and phys_addr_t to store a physical address. On a 64bit system, both are 64bit wide. However, on a 32bit system, the latter might be 64bit wide. This is, for example, the case on x86 with PAE: phys_addr_t and PTEs are 64bit wide, while "unsigned lo...
```diff diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 86b95ccb81bb..b07b277d6a16 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -33,11 +33,13 @@ * can use the extra bits to store other information besides PFN. */ #ifdef MAX_PHYSMEM_BITS -#define SWP_PFN_BITS (MAX_PHY...
44bcabd70cf1425b4243e02251c02b01638a8287
Analyze and fix the following issue in the Linux kernel code: tmpfs: fix data loss from failed fallocate
Problem Details: Fix tmpfs data loss when the fallocate system call is interrupted by a signal, or fails for some other reason. The partial folio handling in shmem_undo_range() forgot to consider this unfalloc case, and was liable to erase or truncate out data which had already been committed earlier. It turns out th...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index c1d8b8a1aa3b..82911fefc2d5 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -948,6 +948,15 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, index++; } + /* + * When undoing a failed fallocate, we want none of the partial folio + * ze...
de16d6e4a9fb13d07c88d0e57754348662f53b23
Analyze and fix the following issue in the Linux kernel code: kselftests: cgroup: update kmem test precision tolerance
Problem Details: 1813e51eece0 ("memcg: increase MEMCG_CHARGE_BATCH to 64") has changed the batch size while this test case has been left behind. This has led to a test failure reported by test bot: not ok 2 selftests: cgroup: test_kmem # exit=1 Update the tolerance for the pcp charges to reflect the MEMCG_CHARGE_BATCH...
```diff diff --git a/tools/testing/selftests/cgroup/test_kmem.c b/tools/testing/selftests/cgroup/test_kmem.c index 22b31ebb3513..258ddc565deb 100644 --- a/tools/testing/selftests/cgroup/test_kmem.c +++ b/tools/testing/selftests/cgroup/test_kmem.c @@ -19,12 +19,12 @@ /* - * Memory cgroup charging is performed using...
f5ad5083404bb56c9de777dccb68c6672ef6487e
Analyze and fix the following issue in the Linux kernel code: mm: do not BUG_ON missing brk mapping, because userspace can unmap it
Problem Details: The following program will trigger the BUG_ON that this patch removes, because the user can munmap() mm->brk: #include <sys/syscall.h> #include <sys/mman.h> #include <assert.h> #include <unistd.h> static void *brk_now(void) { return (void *)syscall(SYS_brk, 0); } static void brk_...
```diff diff --git a/mm/mmap.c b/mm/mmap.c index 74a84eb33b90..0024e615d069 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -226,8 +226,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) /* Search one past newbrk */ mas_set(&mas, newbrk); brkvma = mas_find(&mas, oldbrk); - BUG_ON(brkvma == NULL); - if (brkvma->vm_start...
7d52eace1bf5c55704bb0ca5dc8f2489927683ff
Analyze and fix the following issue in the Linux kernel code: riscv: alternatives: Don't name unused macro parameters
Problem Details: Without CONFIG_RISCV_ALTERNATIVE only the first parameter of the ALTERNATIVE macros is needed. Use ... for the rest to cut down on clutter. While there, fix a couple space vs. tab issues. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesa...
```diff diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h index c7036166af2c..7cc2b587c5c4 100644 --- a/arch/riscv/include/asm/alternative-macros.h +++ b/arch/riscv/include/asm/alternative-macros.h @@ -130,28 +130,22 @@ \old_c .endm -#define _ALTERNATIVE_CFG(old...
4bf73588165ba7d32131a043775557a54b6e1db5
Analyze and fix the following issue in the Linux kernel code: kbuild: Port silent mode detection to future gnu make.
Problem Details: Port silent mode detection to the future (post make-4.4) versions of gnu make. Makefile contains the following piece of make code to detect if option -s is specified on the command line. ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) This code is executed by make at parse time and assumes t...
```diff diff --git a/Makefile b/Makefile index 6f846b1f2618..fbd9ff4a61e7 100644 --- a/Makefile +++ b/Makefile @@ -93,10 +93,17 @@ endif # If the user is running make -s (silent mode), suppress echoing of # commands +# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS. -ifneq ($(findstr...
9edb4fd3d70a9dffd8ac6af6d060e97672b4a22f
Analyze and fix the following issue in the Linux kernel code: init/version.c: remove #include <generated/utsrelease.h>
Problem Details: Commit 2df8220cc511 ("kbuild: build init/built-in.a just once") moved the usage of the define UTS_RELEASE to the file version-timestamp.c. version-timestamp.c in turn is included from version.c but already includes utsrelease.h itself properly. The unneeded include of utsrelease.h from version.c can ...
```diff diff --git a/init/version.c b/init/version.c index 01d4ab05f0ba..f117921811b4 100644 --- a/init/version.c +++ b/init/version.c @@ -15,7 +15,6 @@ #include <linux/printk.h> #include <linux/uts.h> #include <linux/utsname.h> -#include <generated/utsrelease.h> #include <linux/proc_ns.h> static int __init earl...
689c5421bfe0eac65526bd97a466b9590a6aad3c
Analyze and fix the following issue in the Linux kernel code: RDMA/rxe: Fix incorrect responder length checking
Problem Details: The code in rxe_resp.c at check_length() is incorrect as it compares pkt->opcode an 8 bit value against various mask bits which are all higher than 256 so nothing is ever reported. This patch rewrites this to compare against pkt->mask which is correct. However this now exposes another error. For UD se...
```diff diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index 0c8bec281937..abbaa41017e8 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c @@ -392,36 +392,46 @@ static enum resp_states check_resource(struct rxe_qp *qp, return RESPST_C...
6d60f89691fc979e55b88508f4cfa8f6b4c56eac
Analyze and fix the following issue in the Linux kernel code: tools/rv: Add in-kernel monitor interface
Problem Details: Add the ability to control and trace in-kernel monitors. This is a generic interface, it will check for existing monitors and enable standard setup, like enabling reactors. For example: # rv list wip wakeup in preemptive per-cpu testing monitor. [OFF] wwnr ...
```diff diff --git a/tools/verification/rv/include/in_kernel.h b/tools/verification/rv/include/in_kernel.h new file mode 100644 index 000000000000..3090638c8d71 --- /dev/null +++ b/tools/verification/rv/include/in_kernel.h @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: GPL-2.0 +int ikm_list_monitors(void); +int ikm_run_m...
4c6874374859d89aa6a75019bb0a913369e472c9
Analyze and fix the following issue in the Linux kernel code: rtla: Fix exit status when returning from calls to usage()
Problem Details: rtla_usage(), osnoise_usage() and timerlat_usage() all exit with an error status. However when these are called from help, they should exit with a non-error status. Fix this by passing the exit status to the functions. Note, although we remove the subsequent call to exit after calling usage, we leav...
```diff diff --git a/tools/tracing/rtla/src/osnoise.c b/tools/tracing/rtla/src/osnoise.c index b8ec6c15bccb..4dee343909b1 100644 --- a/tools/tracing/rtla/src/osnoise.c +++ b/tools/tracing/rtla/src/osnoise.c @@ -903,7 +903,7 @@ out_err: return NULL; } -static void osnoise_usage(void) +static void osnoise_usage(int ...
4c587a982603d7e7e751b4925809a1512099a690
Analyze and fix the following issue in the Linux kernel code: MIPS: OCTEON: warn only once if deprecated link status is being used
Problem Details: Avoid flooding kernel log with warnings. Fixes: 2c0756d306c2 ("MIPS: OCTEON: warn if deprecated link status is being used") Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
```diff diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c index d09d0769f549..0fd9ac76eb74 100644 --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c @@ -211,7 +211,7 @@ union cvm...
ee9ef11bd2a59c2fefaa0959e5efcdf040d7c654
Analyze and fix the following issue in the Linux kernel code: MIPS: BCM63xx: Add check for NULL for clk in clk_enable
Problem Details: Check clk for NULL before calling clk_enable_unlocked where clk is dereferenced. There is such check in other implementations of clk_enable. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.") Si...
```diff diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c index 6e6756e8fa0a..86a6e2590866 100644 --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c @@ -361,6 +361,8 @@ static struct clk clk_periph = { */ int clk_enable(struct clk *clk) { + if (!clk) + return 0; mutex_lock(&clocks_mutex); ...
03871060e458e1d8bdc37a245c22ba842000c87b
Analyze and fix the following issue in the Linux kernel code: dt-bindings: lcdif: Fix constraints for imx8mp
Problem Details: i.MX8MP uses 3 clocks, so soften the restrictions for clocks & clock-names. This SoC requires a power-domain for this peripheral to use. Add it as a required property. Fixes: f5419cb0743f ("dt-bindings: lcdif: Add compatible for i.MX8MP") Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com...
```diff diff --git a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml index 876015a44a1e..f449cfc76789 100644 --- a/Documentation/devicetree/bindings/display/fsl,lcdif.yaml +++ b/Documentation/devicetree/bindings/display/fsl,lcdif.yaml @@ -52,6 +52,9 @@...
81d0bcf9900932633d270d5bc4a54ff599c6ebdb
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: make display pinning more flexible (v2)
Problem Details: Only apply the static threshold for Stoney and Carrizo. This hardware has certain requirements that don't allow mixing of GTT and VRAM. Newer asics do not have these requirements so we should be able to be more flexible with where buffers end up. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 919bbea2e3ac..2df55cc7e07f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -1506,7 +1506,8 @@ u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo ...
2165359b7ed4e0b93fc23f49ede38d76e91fffe1
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Fix spelling mistake: "dram_clk_chanage" -> "dram_clk_change"
Problem Details: There is a spelling mistake in the struct field dram_clk_chanage. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c index 0f746bb4e500..d51f1ce02874 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c @@ -55,7 +55,7 @@ void hubbub1_wm_rea...
d4d4c6fbae3837623708594a7499f40673fb0692
Analyze and fix the following issue in the Linux kernel code: drm/i915/perf: Do not parse context image for HSW
Problem Details: An earlier commit introduced a mechanism to parse the context image to find the OA context control offset. This resulted in an NPD on haswell when gem_context was passed into i915_perf_open_ioctl params. Haswell does not support logical ring contexts, so ensure that the context image is parsed only for...
```diff diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 00e09bb18b13..125b6ca25a75 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -1383,6 +1383,9 @@ static u32 oa_context_image_offset(struct intel_context *ce, u32 reg) u32 offset, len = (...
449a0ef584d42ed24b7432c899863eaabe2583b5
Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix documentation for intel_uncore_forcewake_put__locked
Problem Details: intel_uncore_forcewake_put__locked() is used to release a reference. Fixes: a6111f7b6604 ("drm/i915: Reduce locking in execlist command submission") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid...
```diff diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index 8006a6c61466..614013745fca 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -824,9 +824,9 @@ void intel_uncore_forcewake_flush(struct intel_uncore *uncore, } /** - * inte...
2c1da39008fee00596ed33baeacaffa0dc62df25
Analyze and fix the following issue in the Linux kernel code: drm/i915/gt: Correct kerneldoc for intel_gt_mcr_wait_for_reg()
Problem Details: The kerneldoc function name was not updated when this function was converted to a non-fw form. Fixes: 41f425adbce9 ("drm/i915/gt: Manage uncore->lock while waiting on MCR register") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Balasu...
```diff diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c index d9a8ff9e5e57..ea86c1ab5dc5 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c +++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c @@ -702,7 +702,7 @@ void intel_gt_mcr_get_ss_steering(struct intel_gt *gt, unsigned int d...
3282a549cf9b300e2d1b007925ed007ab24e4131
Analyze and fix the following issue in the Linux kernel code: RDMA/rxe: Fix oops with zero length reads
Problem Details: The commit 686d348476ee ("RDMA/rxe: Remove unnecessary mr testing") causes a kernel crash. If responder get a zero-byte RDMA Read request, qp->resp.mr is not set in check_rkey() (see IBA C9-88). The mr is NULL in this case, and a NULL pointer dereference occurs as shown below. BUG: kernel NULL pointe...
```diff diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index 12eb85e8d415..0c8bec281937 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c @@ -460,7 +460,7 @@ static enum resp_states check_rkey(struct rxe_qp *qp, return RESPST_EXECUT...
d6c55c0a20e5059abdde81713ddf6324a946eb3c
Analyze and fix the following issue in the Linux kernel code: iommufd: Change the order of MSI setup
Problem Details: Eric points out this is wrong for the rare case of someone using allow_unsafe_interrupts on ARM. We always have to setup the MSI window in the domain if the iommu driver asks for it. Move the iommu_get_msi_cookie() setup to the top of the function and always do it, regardless of the security mode. Add...
```diff diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c index dd2a415b603e..d81f93a321af 100644 --- a/drivers/iommu/iommufd/device.c +++ b/drivers/iommu/iommufd/device.c @@ -139,19 +139,11 @@ static int iommufd_device_setup_msi(struct iommufd_device *idev, int rc; /* - * IOMMU_CAP_IN...
a26fa392068d1dcdf781397b7a7dd908dd68f030
Analyze and fix the following issue in the Linux kernel code: iommufd: Improve a few unclear bits of code
Problem Details: Correct a few items noticed late in review: - We should assert that the math in batch_clear_carry() doesn't underflow - user->locked should be -1 not 0 sicne we just did mmput - npages should not have been recalculated, it already has that value No functional change. Fixes: 8d160cd4d506 ("iommu...
```diff diff --git a/drivers/iommu/iommufd/pages.c b/drivers/iommu/iommufd/pages.c index fccdba782cb6..c77177229648 100644 --- a/drivers/iommu/iommufd/pages.c +++ b/drivers/iommu/iommufd/pages.c @@ -289,6 +289,10 @@ static void batch_clear_carry(struct pfn_batch *batch, unsigned int keep_pfns) if (!keep_pfns) retu...
c9b8a83a8f2dca9f82288a621595a6a5970cdc5e
Analyze and fix the following issue in the Linux kernel code: iommufd: Fix comment typos
Problem Details: Repair some typos in comments that were noticed late in the review cycle. Fixes: f394576eb11d ("iommufd: PFN handling for iopt_pages") Link: https://lore.kernel.org/r/1-v1-0362a1a1c034+98-iommufd_fixes1_jgg@nvidia.com Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Eric Auger <eric.auger@r...
```diff diff --git a/drivers/iommu/iommufd/io_pagetable.h b/drivers/iommu/iommufd/io_pagetable.h index 83e7c175f2a2..0ec3509b7e33 100644 --- a/drivers/iommu/iommufd/io_pagetable.h +++ b/drivers/iommu/iommufd/io_pagetable.h @@ -33,7 +33,7 @@ struct iommu_domain; * * The io_pagetable::iova_rwsem protects node * The...
5e57aaa8b6ec038940c2258b803c53f08a65d1f0
Analyze and fix the following issue in the Linux kernel code: clk: nomadik: correct struct name kernel-doc warning
Problem Details: Use the correct struct name for the kernel-doc notation to prevent a kernel-doc warning: clk-nomadik.c:148: warning: expecting prototype for struct clk_pll1. Prototype was for struct clk_pll instead Fixes: ef6eb322ce57 ("clk: nomadik: implement the Nomadik clocks properly") Signed-off-by: Randy Dunla...
```diff diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c index 71fbe687fa7b..06245681dac7 100644 --- a/drivers/clk/clk-nomadik.c +++ b/drivers/clk/clk-nomadik.c @@ -138,7 +138,7 @@ out_put: } /** - * struct clk_pll1 - Nomadik PLL1 clock + * struct clk_pll - Nomadik PLL clock * @hw: corresponding...
577cc1434e4cc1342c3df6d6a3c85136ab335c81
Analyze and fix the following issue in the Linux kernel code: lsm: Fix description of fs_context_parse_param
Problem Details: The fs_context_parse_param hook already has a description, which seems the right one according to the code. Fixes: 8eb687bc8069 ("lsm: Add/fix return values in lsm_hooks.h and fix formatting") Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
```diff diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index bad3b6baad86..20e70132584c 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -100,9 +100,6 @@ * the filesystem. * @fc indicates the filesystem context. * @param The parameter. - * Return 0 to indicate that the...