id stringlengths 40 40 | instruction stringlengths 68 308 | input stringlengths 17 33.4k | output stringlengths 100 30k |
|---|---|---|---|
1677bf76818beeafd4aa524ad1d031d4c760e919 | Analyze and fix the following issue in the Linux kernel code: scripts/gdb: fix lx-symbols command for arm64 LLVM | Problem Details:
lx-symbols assumes that module's .text sections is located at
`module->mem[MOD_TEXT].base` and passes it to add-symbol-file command.
However, .text section follows after .plt section in modules built by LLVM
toolchain for arm64 target. Symbol addresses are skewed in GDB.
Fix this issue by using the ... | ```diff
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index fdad3f32c747..c8047f4441e6 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -89,23 +89,27 @@ lx-symbols command."""
return name
return None
- def _section_arguments(self, ... |
349fde599db65d4827820ef6553e3f9ee75b8c7c | Analyze and fix the following issue in the Linux kernel code: arch: enable HAS_LTO_CLANG with KASAN and KCOV | Problem Details:
Both KASAN and KCOV had issues with LTO_CLANG if DEBUG_INFO is enabled.
With LTO inlinable function calls are required to have debug info if they
are inlined into a function that has debug info.
Starting with LLVM 17 this will be fixed ([1],[2]) and enabling LTO with
KASAN/KCOV and DEBUG_INFO doesn't... | ```diff
diff --git a/arch/Kconfig b/arch/Kconfig
index b2872e9d3760..94050a3f094e 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -732,7 +732,9 @@ config HAS_LTO_CLANG
depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
depends on ARCH_SUPPORTS_LTO_CLANG
depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
- dep... |
4264be505d9f3657de9626f551099e595b2ae7fe | Analyze and fix the following issue in the Linux kernel code: acct: replace all non-returning strlcpy with strscpy | Problem Details:
strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated [1]. In an effort
to remove strlcpy() completely [2], replace strlcpy() here with strscpy().
No ret... | ```diff
diff --git a/kernel/acct.c b/kernel/acct.c
index 010667ce6080..10f769e13f72 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -445,7 +445,7 @@ static void fill_ac(acct_t *ac)
memset(ac, 0, sizeof(acct_t));
ac->ac_version = ACCT_VERSION | ACCT_BYTEORDER;
- strlcpy(ac->ac_comm, current->comm, sizeof(ac->ac_... |
0ef5de7b1ee8d8ee5695fbc1df4a257e028f674a | Analyze and fix the following issue in the Linux kernel code: scripts: kernel-doc: fix macro handling in enums | Problem Details:
drivers/net/ethernet/intel/idpf/idpf.h uses offsetof to
initialize the enum enumerators:
enum idpf_cap_field {
IDPF_BASE_CAPS = -1,
IDPF_CSUM_CAPS = offsetof(struct virtchnl2_get_capabilities,
csum_caps),
IDPF_SEG_CAPS = offsetof(struct virtchnl2_get_capabilities,
seg_caps),
IDPF_RSS_CA... | ```diff
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index cfb1cb223508..6e199a745ccb 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1353,6 +1353,7 @@ sub dump_enum($$) {
my %_members;
$members =~ s/\s+$//;
+ $members =~ s/\([^;]*?[\)]//g;
foreach my $arg (split ',', $members) {
$a... |
be98edcb664be76cd3ba0bde1e760a31197176d8 | Analyze and fix the following issue in the Linux kernel code: scripts: kernel-doc: parse DEFINE_DMA_UNMAP_[ADDR|LEN] | Problem Details:
At present, if the macros DEFINE_DMA_UNMAP_ADDR() and
DEFINE_DMA_UNMAP_LEN() are used in the structures as shown
below, instead of parsing the parameter in the parentheses,
kernel-doc parses 'DEFINE_DMA_UNMAP_ADDR(' and
'DEFINE_DMA_UNMAP_LEN(' which results in the following
warnings:
drivers/net/ether... | ```diff
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index d0116c6939dc..cfb1cb223508 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1168,6 +1168,10 @@ sub dump_struct($$) {
$members =~ s/DECLARE_KFIFO_PTR\s*\($args,\s*$args\)/$2 \*$1/gos;
# replace DECLARE_FLEX_ARRAY
$members =~ s/(?:__)?DE... |
6be3601517d90b728095d70c14f3a04b9adcb166 | Analyze and fix the following issue in the Linux kernel code: powerpc/book3s64/radix: add debug message to give more details of vmemmap allocation | Problem Details:
Add some extra vmemmap pr_debug message that will indicate the type of
vmemmap allocations.
For ex: with DAX vmemmap optimization we can find the below details:
[ 187.166580] radix-mmu: PAGE_SIZE vmemmap mapping
[ 187.166587] radix-mmu: PAGE_SIZE vmemmap mapping
[ 187.166591] radix-mmu: Tail page r... | ```diff
diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
index 955cf6b68a3a..96679018e7fb 100644
--- a/arch/powerpc/mm/book3s64/radix_pgtable.c
+++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
@@ -1033,6 +1033,7 @@ static pte_t * __meminit radix__vmemmap_pte_populate(pmd_t ... |
601f006fddc66e369fdac7c572f981eafd159dac | Analyze and fix the following issue in the Linux kernel code: powerpc/book3s64/radix: remove mmu_vmemmap_psize | Problem Details:
This is not used by radix anymore.
[aneesh.kumar@linux.ibm.com: fix kernel build error]
Link: https://lkml.kernel.org/r/874jlowd0c.fsf@linux.ibm.com
Link: https://lkml.kernel.org/r/20230724190759.483013-13-aneesh.kumar@linux.ibm.com
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Ca... | ```diff
diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
index c264e6a3620e..955cf6b68a3a 100644
--- a/arch/powerpc/mm/book3s64/radix_pgtable.c
+++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
@@ -601,17 +601,6 @@ void __init radix__early_init_mmu(void)
#else
mmu_virtual... |
368a0590d954a659b16ab945328ada0cc10f93a0 | Analyze and fix the following issue in the Linux kernel code: powerpc/book3s64/vmemmap: switch radix to use a different vmemmap handling function | Problem Details:
This is in preparation to update radix to implement vmemmap optimization
for devdax. Below are the rules w.r.t radix vmemmap mapping
1. First try to map things using PMD (2M)
2. With altmap if altmap cross-boundary check returns true, fall back to
PAGE_SIZE
3. If we can't allocate PMD_SIZE backing... | ```diff
diff --git a/arch/powerpc/include/asm/book3s/64/radix.h b/arch/powerpc/include/asm/book3s/64/radix.h
index 2ef92f36340f..f1461289643a 100644
--- a/arch/powerpc/include/asm/book3s/64/radix.h
+++ b/arch/powerpc/include/asm/book3s/64/radix.h
@@ -331,6 +331,8 @@ extern int __meminit radix__vmemmap_create_mapping(un... |
27af67f35631ac4b61b5e4455b44c9aee8d2cc4b | Analyze and fix the following issue in the Linux kernel code: powerpc/book3s64/mm: enable transparent pud hugepage | Problem Details:
This is enabled only with radix translation and 1G hugepage size. This
will be used with devdax device memory with a namespace alignment of 1G.
Anon transparent hugepage is not supported even though we do have helpers
checking pud_trans_huge(). We should never find that return true. The
only expect... | ```diff
diff --git a/arch/powerpc/include/asm/book3s/64/hash.h b/arch/powerpc/include/asm/book3s/64/hash.h
index d4a19e6547ac..6e70ae511631 100644
--- a/arch/powerpc/include/asm/book3s/64/hash.h
+++ b/arch/powerpc/include/asm/book3s/64/hash.h
@@ -138,7 +138,16 @@ static inline int hash__pmd_same(pmd_t pmd_a, pmd_t pmd_... |
90717566f8f6b6761494ccfff43ea62af443fc9b | Analyze and fix the following issue in the Linux kernel code: mm: don't drop VMA locks in mm_drop_all_locks() | Problem Details:
Despite its name, mm_drop_all_locks() does not drop _all_ locks; the mmap
lock is held write-locked by the caller, and the caller is responsible for
dropping the mmap lock at a later point (which will also release the VMA
locks).
Calling vma_end_write_all() here is dangerous because the caller might
h... | ```diff
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 84988d4ff8fb..93eb291181f7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -691,6 +691,11 @@ static bool __is_vma_write_locked(struct vm_area_struct *vma, int *mm_lock_seq)
return (vma->vm_lock_seq == *mm_lock_seq);
}
+/*
+ * Begin writ... |
eafcb7a972e2039e0f8a8c0d4fd3e90e485c8b9c | Analyze and fix the following issue in the Linux kernel code: mm/mprotect: fix obsolete function name in change_pte_range() | Problem Details:
Since commit 79a1971c5f14 ("mm: move the copy_one_pte() pte_present check
into the caller"), the explanation of preserving soft-dirtiness is moved
into copy_nonpresent_pte(). Update corresponding comment.
Link: https://lkml.kernel.org/r/20230723033114.3224409-1-linmiaohe@huawei.com
Signed-off-by: Mia... | ```diff
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 5c3112d92466..3f36c88a238e 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -213,7 +213,7 @@ static long change_pte_range(struct mmu_gather *tlb,
} else if (is_writable_device_private_entry(entry)) {
/*
* We do not preserve soft-dirtiness. See
- ... |
6e16f5133501440699dcca3c5aba367cf6f9c227 | Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix thuge-gen test bugs | Problem Details:
thuge-gen was previously only munmapping part of the mmapped buffer, which
caused us to run out of 1G huge pages for a later part of the test. Fix
this by munmapping the whole buffer. Based on the code, it looks like a
typo rather than an intention to keep some of the buffer mapped.
thuge-gen was al... | ```diff
diff --git a/tools/testing/selftests/mm/thuge-gen.c b/tools/testing/selftests/mm/thuge-gen.c
index 380ab5f0a534..16ed4dfa7359 100644
--- a/tools/testing/selftests/mm/thuge-gen.c
+++ b/tools/testing/selftests/mm/thuge-gen.c
@@ -139,7 +139,7 @@ void test_mmap(unsigned long size, unsigned flags)
before, after, ... |
58e2847ad2e6322a25dedf8b4549ff924baf8395 | Analyze and fix the following issue in the Linux kernel code: selftests: line buffer test program's stdout | Problem Details:
Patch series "selftests/mm fixes for arm64", v3.
Given my on-going work on large anon folios and contpte mappings, I
decided it would be a good idea to start running mm selftests to help
guard against regressions. However, it soon became clear that I
couldn't get the suite to run cleanly on arm64 wit... | ```diff
diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h
index 0eef91daf289..a3778aff4fa9 100644
--- a/tools/include/nolibc/stdio.h
+++ b/tools/include/nolibc/stdio.h
@@ -21,6 +21,11 @@
#define EOF (-1)
#endif
+/* Buffering mode used by setvbuf. */
+#define _IOFBF 0 /* Fully buffered. */
+#... |
ea09800bf17561a0d20498923d766468c0d7a4a7 | Analyze and fix the following issue in the Linux kernel code: mm: fix obsolete function name above debug_pagealloc_enabled_static() | Problem Details:
Since commit 04013513cc84 ("mm, page_alloc: do not rely on the order of
page_poison and init_on_alloc/free parameters"), init_debug_pagealloc() is
converted to init_mem_debugging_and_hardening(). Later it's renamed to
mem_debugging_and_hardening_init() via commit f2fc4b44ec2b ("mm: move
init_mem_debug... | ```diff
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 0ae5654f665b..84988d4ff8fb 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -3465,8 +3465,8 @@ static inline bool debug_pagealloc_enabled(void)
}
/*
- * For use in fast paths after init_debug_pagealloc() has run, or when a
- * false negat... |
6bbd42e2df8f90b022fa0b82986d58ecb30b9dcc | Analyze and fix the following issue in the Linux kernel code: mmu_notifiers: call invalidate_range() when invalidating TLBs | Problem Details:
The invalidate_range() is going to become an architecture specific mmu
notifier used to keep the TLB of secondary MMUs such as an IOMMU in sync
with the CPU page tables. Currently it is called from separate code paths
to the main CPU TLB invalidations. This can lead to a secondary TLB not
getting inv... | ```diff
diff --git a/arch/arm64/include/asm/tlbflush.h b/arch/arm64/include/asm/tlbflush.h
index 3456866c6a1d..a99349d10c0e 100644
--- a/arch/arm64/include/asm/tlbflush.h
+++ b/arch/arm64/include/asm/tlbflush.h
@@ -13,6 +13,7 @@
#include <linux/bitfield.h>
#include <linux/mm_types.h>
#include <linux/sched.h>
+#inclu... |
57b037dbbadc0d8de44bf06a62ad2d9265ef31d3 | Analyze and fix the following issue in the Linux kernel code: mmu_notifiers: fixup comment in mmu_interval_read_begin() | Problem Details:
The comment in mmu_interval_read_begin() refers to a function that doesn't
exist and uses the wrong call-back name. The op for mmu interval
notifiers is mmu_interval_notifier_ops->invalidate() so fix the comment up
to reflect that.
Link: https://lkml.kernel.org/r/e7a09081b3ac82a03c189409f1262fc2df910... | ```diff
diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
index 50c0dde1354f..b7ad1559c72f 100644
--- a/mm/mmu_notifier.c
+++ b/mm/mmu_notifier.c
@@ -199,7 +199,7 @@ mmu_interval_read_begin(struct mmu_interval_notifier *interval_sub)
* invalidate_start/end and is colliding.
*
* The locking looks broadly like ... |
4ae6944d15727c50ff1c0bb3fe38b9b412520d85 | Analyze and fix the following issue in the Linux kernel code: maple_tree: mtree_insert: fix typo in kernel-doc description of GFP flags | Problem Details:
Replace FGP_FLAGS with GFP_FLAGS
Link: https://lkml.kernel.org/r/20230715084038.987955-1-rppt@kernel.org
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ```diff
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 616ec7f3be81..b6b3973897f0 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -6314,7 +6314,7 @@ EXPORT_SYMBOL(mtree_insert_range);
* @mt: The maple tree
* @index : The index to store the value
* @entry: The entry to store
- * @gfp: The FGP_FLAGS... |
4445e58264aea8ec6bb1287add79606f0e3f3988 | Analyze and fix the following issue in the Linux kernel code: maple_tree: mtree_insert*: fix typo in kernel-doc description | Problem Details:
Replace "Insert and entry at a give index" with "Insert an entry at a
given index"
Link: https://lkml.kernel.org/r/20230715143920.994812-1-rppt@kernel.org
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linu... | ```diff
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index cef47ce8eddd..616ec7f3be81 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -6274,7 +6274,7 @@ int mtree_store(struct maple_tree *mt, unsigned long index, void *entry,
EXPORT_SYMBOL(mtree_store);
/**
- * mtree_insert_range() - Insert an entry at ... |
65c8d30e679bdffeeaa0b84b7094a3c719aa6585 | Analyze and fix the following issue in the Linux kernel code: mm/tlbbatch: introduce arch_tlbbatch_should_defer() | Problem Details:
Patch series "arm64: support batched/deferred tlb shootdown during page
reclamation/migration", v11.
Though ARM64 has the hardware to do tlb shootdown, the hardware
broadcasting is not free. A simplest micro benchmark shows even on
snapdragon 888 with only 8 cores, the overhead for ptep_clear_flush i... | ```diff
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index 80450e1d5385..cf2a1de5d388 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -253,6 +253,18 @@ static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long a)
flush_tlb_mm_ra... |
b94692e84dccf12dd30839c4e97b9ba028036a8f | Analyze and fix the following issue in the Linux kernel code: sh: add <asm-generic/io.h> including | Problem Details:
In <asm-generic/io.h>, it provides a generic implementation of all
I/O accessors.
For some port|mm io functions, SuperH has its own implementation in
arch/sh/kernel/iomap.c and arch/sh/include/asm/io_noioport.h. These will
conflict with those in <asm-generic/io.h> and cause compiling error.
Hence ad... | ```diff
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index d8f3537ef57f..d8a0daf33ab5 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -119,6 +119,30 @@ void __raw_readsl(const void __iomem *addr, void *data, int longlen);
__BUILD_MEMORY_STRING(__raw_, q, u64)
+#define io... |
efb78fa86e95832b78ca0ba60f3706788a818938 | Analyze and fix the following issue in the Linux kernel code: lib/test_meminit: allocate pages up to order MAX_ORDER | Problem Details:
test_pages() tests the page allocator by calling alloc_pages() with
different orders up to order 10.
However, different architectures and platforms support different maximum
contiguous allocation sizes. The default maximum allocation order
(MAX_ORDER) is 10, but architectures can use CONFIG_ARCH_FORC... | ```diff
diff --git a/lib/test_meminit.c b/lib/test_meminit.c
index 60e1984c060f..0ae35223d773 100644
--- a/lib/test_meminit.c
+++ b/lib/test_meminit.c
@@ -93,7 +93,7 @@ static int __init test_pages(int *total_failures)
int failures = 0, num_tests = 0;
int i;
- for (i = 0; i < 10; i++)
+ for (i = 0; i <= MAX_ORDER... |
f4d005af5b5499ddc71bbe704f2a6afa06dd3788 | Analyze and fix the following issue in the Linux kernel code: mm/memcg: fix obsolete comment above MEM_CGROUP_MAX_RECLAIM_LOOPS | Problem Details:
Since commit 5660048ccac8 ("mm: move memcg hierarchy reclaim to generic
reclaim code"), mem_cgroup_hierarchical_reclaim() is already renamed to
mem_cgroup_soft_reclaim(). Update the corresponding comment.
Link: https://lkml.kernel.org/r/20230713121432.273381-1-linmiaohe@huawei.com
Signed-off-by: Miao... | ```diff
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 3eaeb69ef9f5..93e3cc581b51 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -197,7 +197,7 @@ static struct move_charge_struct {
};
/*
- * Maximum loops in mem_cgroup_hierarchical_reclaim(), used for soft
+ * Maximum loops in mem_cgroup_soft_reclaim()... |
6852c46c783d20a4c0153d14d2990040e5e6e47e | Analyze and fix the following issue in the Linux kernel code: mm/mmap: move vma operations to mm_struct out of the critical section of file mapping lock | Problem Details:
UnixBench/Execl represents a class of workload where bash scripts are
spawned frequently to do some short jobs. When running multiple parallel
tasks, hot osq_lock is observed from do_mmap and exit_mmap. Both of them
come from load_elf_binary through the call chain
"execl->do_execveat_common->bprm_exe... | ```diff
diff --git a/mm/mmap.c b/mm/mmap.c
index 3937479d0e07..e1586b2f938e 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -412,14 +412,11 @@ static int vma_link(struct mm_struct *mm, struct vm_area_struct *vma)
if (vma_iter_prealloc(&vmi))
return -ENOMEM;
+ vma_iter_store(&vmi, vma);
+
if (vma->vm_file) {
mappi... |
d50791c2bee9ed97b1dd81db9bbb11caddcdfb0d | Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: delete khugepaged_collapse_pte_mapped_thps() | Problem Details:
Now that retract_page_tables() can retract page tables reliably, without
depending on trylocks, delete all the apparatus for khugepaged to try
again later: khugepaged_collapse_pte_mapped_thps() etc; and free up the
per-mm memory which was set aside for that in the khugepaged_mm_slot.
But one part of t... | ```diff
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 53d1788332cb..9a6e0d507759 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -93,8 +93,6 @@ static DEFINE_READ_MOSTLY_HASHTABLE(mm_slots_hash, MM_SLOTS_HASH_BITS);
static struct kmem_cache *mm_slot_cache __read_mostly;
-#define MAX_PTE_MAPPED_THP 8
-... |
3d140215a6aec37f112aec1606c6a76f7e4443d3 | Analyze and fix the following issue in the Linux kernel code: powerpc: assert_pte_locked() use pte_offset_map_nolock() | Problem Details:
Instead of pte_lockptr(), use the recently added pte_offset_map_nolock()
in assert_pte_locked(). BUG if pte_offset_map_nolock() fails.
This mod might cause new crashes: which either expose my ignorance, or
indicate issues to be fixed, or limit the usage of assert_pte_locked().
[hughd@google.com: ass... | ```diff
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index cb2dcdb18f8e..a3dcdb2d5b4b 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -311,6 +311,8 @@ void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
p4d_t *p4d;
pud_t *pud;
pmd_t *pmd;
+ pte_t *pte;
... |
e93fda5a1ab7a0c6143ae8a6f231c9f5f3c417b1 | Analyze and fix the following issue in the Linux kernel code: maple_tree: fix mas_validate_child_slot() to check last missed slot | Problem Details:
Don't break the loop before checking the last slot. Also here check if
non-leaf nodes are missing children.
Link: https://lkml.kernel.org/r/20230711035444.526-5-zhangpeng.00@bytedance.com
Signed-off-by: Peng Zhang <zhangpeng.00@bytedance.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Tes... | ```diff
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 9ce78e5e6084..af8fb75ad688 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -7093,11 +7093,12 @@ static void mas_validate_child_slot(struct ma_state *mas)
for (i = 0; i < mt_slots[type]; i++) {
child = mas_slot(mas, slots, i);
- if (!pivots[i... |
d31155b8f29ce380f7816e54dee161db6d752909 | Analyze and fix the following issue in the Linux kernel code: mm: memory-failure: fix race window when trying to get hugetlb folio | Problem Details:
page_folio() is fetched before calling get_hwpoison_hugetlb_folio()
without hugetlb_lock being held. So hugetlb page could be demoted before
get_hwpoison_hugetlb_folio() holding hugetlb_lock but after page_folio()
is fetched. So get_hwpoison_hugetlb_folio() will hold unexpected extra
refcnt of hugetl... | ```diff
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 133737580a7e..70f44180ef80 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1383,8 +1383,15 @@ static int __get_hwpoison_page(struct page *page, unsigned long flags)
bool hugetlb = false;
ret = get_hwpoison_hugetlb_folio(folio, &hu... |
a363d1224b5add67a7cafab9fdb9f19d569fbe98 | Analyze and fix the following issue in the Linux kernel code: mm: memory-failure: fetch compound head after extra page refcnt is held | Problem Details:
Page might become thp, huge page or being splited after compound head is
fetched but before page refcnt is bumped. So hpage might be a tail page
leading to VM_BUG_ON_PAGE(PageTail(page)) in PageTransHuge().
Link: https://lkml.kernel.org/r/20230711055016.2286677-8-linmiaohe@huawei.com
Fixes: 415c64c14... | ```diff
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 36529f3c6554..133737580a7e 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -2175,8 +2175,6 @@ try_again:
goto unlock_mutex;
}
- hpage = compound_head(p);
-
/*
* We need/can do nothing about count=0 pages.
* 1) it's a free ... |
5885c6a62533cbda19e9eceab619bde317de0c0d | Analyze and fix the following issue in the Linux kernel code: mm: memory-failure: minor cleanup for comments and codestyle | Problem Details:
Fix some wrong function names and grammar error in comments. Also remove
unneeded space after for_each_process. No functional change intended.
Link: https://lkml.kernel.org/r/20230711055016.2286677-7-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Naoya Horiguchi <naoya... | ```diff
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 44a0ce3849f3..36529f3c6554 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -608,7 +608,7 @@ static void collect_procs_anon(struct page *page, struct list_head *to_kill,
pgoff = page_to_pgoff(page);
read_lock(&tasklist_lock);
- for_... |
92a025a790f82c278cc39b0997e9b3b6f3b69ee0 | Analyze and fix the following issue in the Linux kernel code: mm: memory-failure: ensure moving HWPoison flag to the raw error pages | Problem Details:
If hugetlb_vmemmap_optimized is enabled, folio_clear_hugetlb_hwpoison()
called from try_memory_failure_hugetlb() won't transfer HWPoison flag to
subpages while folio's HWPoison flag is cleared. So when trying to free
this hugetlb page into buddy, folio_clear_hugetlb_hwpoison() is not called
to move HW... | ```diff
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 9ed2bd258269..71b4bb691c47 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1908,6 +1908,8 @@ void folio_clear_hugetlb_hwpoison(struct folio *folio)
{
if (folio_test_hugetlb_raw_hwp_unreliable(folio))
return;
+ if (folio_test_huget... |
dbe70dbb41ab45a9ea2fa537c9e6c9817477dfff | Analyze and fix the following issue in the Linux kernel code: mm: memory-failure: remove unneeded PageHuge() check | Problem Details:
Patch series "A few fixup and cleanup patches for memory-failure", v2.
This series contains a few fixup patches to fix inaccurate mf_stats, fix
race window when trying to get hugetlb folio and so on. Also there is
minor cleanup for comments and codestyle. More details can be found in
the respective ... | ```diff
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 76da955bf10f..9ed2bd258269 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1187,9 +1187,6 @@ static int me_huge_page(struct page_state *ps, struct page *p)
struct address_space *mapping;
bool extra_pins = false;
- if (!PageHuge(hp... |
d03668803bf03bd1353a902edfbc139a6a6c7bc1 | Analyze and fix the following issue in the Linux kernel code: HWPOISON: offline support: fix spelling in Documentation/ABI/ | Problem Details:
Correct spelling problems as identified by codespell.
Link: https://lkml.kernel.org/r/20230710052223.18254-1-rdunlap@infradead.org
Fixes: facb6011f399 ("HWPOISON: Add soft page offline support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Andi Kleen <ak... | ```diff
diff --git a/Documentation/ABI/testing/sysfs-memory-page-offline b/Documentation/ABI/testing/sysfs-memory-page-offline
index e14703f12fdf..00f4e35f916f 100644
--- a/Documentation/ABI/testing/sysfs-memory-page-offline
+++ b/Documentation/ABI/testing/sysfs-memory-page-offline
@@ -10,7 +10,7 @@ Description:
dro... |
597425df4fecd272ca48f73feca7833433c16e12 | Analyze and fix the following issue in the Linux kernel code: mm: userfaultfd: add new UFFDIO_POISON ioctl: fix | Problem Details:
Smatch has observed that pte_offset_map_lock() is now allowed to fail, and
then ptl should not be unlocked. Use -EAGAIN here like elsewhere.
Link: https://lkml.kernel.org/r/bc7bba61-d34f-ad3a-ccf1-c191585ef851@google.com
Signed-off-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Axel Rasmussen <axel... | ```diff
diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c
index 68157359dc34..dd167184575e 100644
--- a/mm/userfaultfd.c
+++ b/mm/userfaultfd.c
@@ -300,7 +300,10 @@ static int mfill_atomic_pte_poison(pmd_t *dst_pmd,
spinlock_t *ptl;
_dst_pte = make_pte_marker(PTE_MARKER_POISONED);
+ ret = -EAGAIN;
dst_pte = pte_... |
2ef5d7245d9cb86c96c2a881b000834aa929a915 | Analyze and fix the following issue in the Linux kernel code: mm: userfaultfd: check for start + len overflow in validate_range | Problem Details:
Most userfaultfd ioctls take a `start + len` range as an argument. We
have the validate_range helper to check that such ranges are valid.
However, some (but not all!) ioctls *also* check that `start + len`
doesn't wrap around (overflow).
Just check for this in validate_range. This saves some repeti... | ```diff
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index ae711f1d7a83..c2ed7dcf494e 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -1289,13 +1289,11 @@ static __always_inline void wake_userfault(struct userfaultfd_ctx *ctx,
__wake_userfault(ctx, range);
}
-static __always_inline int validate_range(... |
f92cedfa39ef208c9685d2fdd8215bb58178571b | Analyze and fix the following issue in the Linux kernel code: mm-make-pte_marker_swapin_error-more-general-fix | Problem Details:
fix CONFIG_MMU=n build
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ```diff
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index a86c84600787..8148b30a9df1 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -523,6 +523,7 @@ static inline bool mm_tlb_flush_nested(struct mm_struct *mm)
return atomic_read(&mm->tlb_flush_pending) > 1;
}
+#ifd... |
af19487f00f34ff8643921d7909dbb3fedc7e329 | Analyze and fix the following issue in the Linux kernel code: mm: make PTE_MARKER_SWAPIN_ERROR more general | Problem Details:
Patch series "add UFFDIO_POISON to simulate memory poisoning with UFFD",
v4.
This series adds a new userfaultfd feature, UFFDIO_POISON. See commit 4
for a detailed description of the feature.
This patch (of 8):
Future patches will reuse PTE_MARKER_SWAPIN_ERROR to implement
UFFDIO_POISON, so make so... | ```diff
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index 21d6c72bcc71..a86c84600787 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -523,6 +523,25 @@ static inline bool mm_tlb_flush_nested(struct mm_struct *mm)
return atomic_read(&mm->tlb_flush_pending) > 1;
}
+/*
... |
3ce2c24cb68f228590a053d6058a5901cd31af61 | Analyze and fix the following issue in the Linux kernel code: mm: hugetlb_vmemmap: fix a race between vmemmap pmd split | Problem Details:
The local variable @page in __split_vmemmap_huge_pmd() to obtain a pmd
page without holding page_table_lock may possiblely get the page table
page instead of a huge pmd page.
The effect may be in set_pte_at() since we may pass an invalid page
struct, if set_pte_at() wants to access the page struct (e.... | ```diff
diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
index c2007ef5e9b0..4b9734777f69 100644
--- a/mm/hugetlb_vmemmap.c
+++ b/mm/hugetlb_vmemmap.c
@@ -36,14 +36,22 @@ struct vmemmap_remap_walk {
struct list_head *vmemmap_pages;
};
-static int __split_vmemmap_huge_pmd(pmd_t *pmd, unsigned long start)
+s... |
809ef83ccb61fedc951eccf876a327e940bc412a | Analyze and fix the following issue in the Linux kernel code: mm: fix some kernel-doc comments | Problem Details:
Add description of @mm_wr_locked and @mm.
to silence the warnings:
mm/memory.c:1716: warning: Function parameter or member 'mm_wr_locked' not described in 'unmap_vmas'
mm/memory.c:5110: warning: Function parameter or member 'mm' not described in 'mm_account_fault'
Link: https://lkml.kernel.org/r/2023... | ```diff
diff --git a/mm/memory.c b/mm/memory.c
index 5f863b1a0edc..7fb87a9c025a 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1697,6 +1697,7 @@ static void unmap_single_vma(struct mmu_gather *tlb,
* @vma: the starting vma
* @start_addr: virtual address at which to start unmapping
* @end_addr: virtual address at ... |
b4fa966f03b7401ceacd4ffd7227197afb2b8376 | Analyze and fix the following issue in the Linux kernel code: mm, netfs, fscache: stop read optimisation when folio removed from pagecache | Problem Details:
Fscache has an optimisation by which reads from the cache are skipped
until we know that (a) there's data there to be read and (b) that data
isn't entirely covered by pages resident in the netfs pagecache. This is
done with two flags manipulated by fscache_note_page_release():
if (...
test_bit(... | ```diff
diff --git a/fs/9p/cache.c b/fs/9p/cache.c
index cebba4eaa0b5..12c0ae29f185 100644
--- a/fs/9p/cache.c
+++ b/fs/9p/cache.c
@@ -68,6 +68,8 @@ void v9fs_cache_inode_get_cookie(struct inode *inode)
&path, sizeof(path),
&version, sizeof(version),
i_size_read(&v9inode->netfs.inode... |
0201ebf274a306a6ebb95e5dc2d6a0a27c737cac | Analyze and fix the following issue in the Linux kernel code: mm: merge folio_has_private()/filemap_release_folio() call pairs | Problem Details:
Patch series "mm, netfs, fscache: Stop read optimisation when folio
removed from pagecache", v7.
This fixes an optimisation in fscache whereby we don't read from the cache
for a particular file until we know that there's data there that we don't
have in the pagecache. The problem is that I'm no longe... | ```diff
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index f4b4861a74ee..18a9e7c47975 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -340,10 +340,8 @@ again:
ext4_double_up_write_data_sem(orig_inode, donor_inode);
goto data_copy;
}
- if ((folio_has_private(folio[0]) &&
- ... |
35fb4764c8b2cdd91820761eb03c18106d46b8ae | Analyze and fix the following issue in the Linux kernel code: mm: cma: print cma name as well in cma_alloc debug | Problem Details:
CMA allocation can happen either from global cma or from dedicated cma
region.
Thus it is helpful to print cma name as well during initial
debugging to confirm cma regions were getting initialized or not.
Link: https://lkml.kernel.org/r/1688668414-12350-1-git-send-email-quic_pintu@quicinc.com
Signed-... | ```diff
diff --git a/mm/cma.c b/mm/cma.c
index a4cfe995e11e..4880f72102fa 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -436,8 +436,8 @@ struct page *cma_alloc(struct cma *cma, unsigned long count,
if (!cma || !cma->count || !cma->bitmap)
goto out;
- pr_debug("%s(cma %p, count %lu, align %d)\n", __func__, (void *)cma,... |
badbbcd76545c58eff64bb1548f7f834a30dc52a | Analyze and fix the following issue in the Linux kernel code: selftests/memfd: sysctl: fix MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED | Problem Details:
Add selftest for sysctl vm.memfd_noexec is 2
(MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED)
memfd_create(.., MFD_EXEC) should fail in this case.
Link: https://lkml.kernel.org/r/20230705063315.3680666-3-jeffxu@google.com
Reported-by: Dominique Martinet <asmadeus@codewreck.org>
Closes: https://lore.kernel.org/li... | ```diff
diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c
index dba0e8ba002f..dbdd9ec5e397 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -1147,6 +1147,11 @@ static void test_sysctl_child(void)
sysctl_asser... |
72de259130229412ca49871e70ffaf17dc9fba98 | Analyze and fix the following issue in the Linux kernel code: mm/memfd: sysctl: fix MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED | Problem Details:
Patch series "mm/memfd: fix sysctl MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED", v2.
When sysctl vm.memfd_noexec is 2 (MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED),
memfd_create(.., MFD_EXEC) should fail.
This complies with how MEMFD_NOEXEC_SCOPE_NOEXEC_ENFORCED is defined -
"memfd_create() without MFD_NOEXEC_SEAL wil... | ```diff
diff --git a/mm/memfd.c b/mm/memfd.c
index e763e76f1106..0bdbd2335af7 100644
--- a/mm/memfd.c
+++ b/mm/memfd.c
@@ -268,6 +268,36 @@ long memfd_fcntl(struct file *file, unsigned int cmd, unsigned int arg)
#define MFD_ALL_FLAGS (MFD_CLOEXEC | MFD_ALLOW_SEALING | MFD_HUGETLB | MFD_NOEXEC_SEAL | MFD_EXEC)
+sta... |
86327e8eb94c52eca4f93cfece2e29d1bf52acbf | Analyze and fix the following issue in the Linux kernel code: memcg: drop kmem.limit_in_bytes | Problem Details:
kmem.limit_in_bytes (v1 way to limit kernel memory usage) has been
deprecated since 58056f77502f ("memcg, kmem: further deprecate
kmem.limit_in_bytes") merged in 5.16. We haven't heard about any serious
users since then but it seems that the mere presence of the file is
causing more harm thatn good. ... | ```diff
diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation/admin-guide/cgroup-v1/memory.rst
index fabaad3fd9c2..8d3afeede10e 100644
--- a/Documentation/admin-guide/cgroup-v1/memory.rst
+++ b/Documentation/admin-guide/cgroup-v1/memory.rst
@@ -92,8 +92,6 @@ Brief summary of control files.
memor... |
82d9b8c85b7e4bd85c679ac2da26b57224c4999d | Analyze and fix the following issue in the Linux kernel code: mm: page_alloc: avoid false page outside zone error info | Problem Details:
If pfn is outside zone boundaries in the first round, ret will be set to
1. But if pfn is changed to inside the zone boundaries in zone span
seqretry path, ret is still set to 1 leading to false page outside zone
error info.
This is from code inspection. The race window should be really small thus
h... | ```diff
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b51bbc485a28..1eb3864e1dbc 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -459,7 +459,7 @@ void set_pageblock_migratetype(struct page *page, int migratetype)
#ifdef CONFIG_DEBUG_VM
static int page_outside_zone_boundaries(struct zone *zone, struct pag... |
a2ebb51575828209b3e9d6f3c6576f7a7c70d0f6 | Analyze and fix the following issue in the Linux kernel code: mm/page_alloc: use write_seqlock_irqsave() instead write_seqlock() + local_irq_save(). | Problem Details:
__build_all_zonelists() acquires zonelist_update_seq by first disabling
interrupts via local_irq_save() and then acquiring the seqlock with
write_seqlock(). This is troublesome and leads to problems on PREEMPT_RT.
The problem is that the inner spinlock_t becomes a sleeping lock on
PREEMPT_RT and must ... | ```diff
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index fe04c4e85c42..b51bbc485a28 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5139,19 +5139,17 @@ static void __build_all_zonelists(void *data)
unsigned long flags;
/*
- * Explicitly disable this CPU's interrupts before taking seqlock
- * to preve... |
416ef04fe00c5f2f6fb8e13d8dbe1b5a0a274f83 | Analyze and fix the following issue in the Linux kernel code: mm/page_alloc: fix min_free_kbytes calculation regarding ZONE_MOVABLE | Problem Details:
The current calculation of min_free_kbytes only uses ZONE_DMA and
ZONE_NORMAL pages,but the ZONE_MOVABLE zone->_watermark[WMARK_MIN] will
also divide part of min_free_kbytes.This will cause the min watermark of
ZONE_NORMAL to be too small in the presence of ZONE_MOVEABLE.
__GFP_HIGH and PF_MEMALLOC al... | ```diff
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7d3460c7a480..fe04c4e85c42 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5694,9 +5694,9 @@ static void __setup_per_zone_wmarks(void)
struct zone *zone;
unsigned long flags;
- /* Calculate total number of !ZONE_HIGHMEM pages */
+ /* Calculate to... |
f04d16ee3afc049cdfa99500d95dee8b0eb77cfa | Analyze and fix the following issue in the Linux kernel code: mm/filemap.c: fix update prev_pos after one read request done | Problem Details:
ra->prev_pos tracks the last visited byte in the previous read request.
It is used to check whether it is sequential read in ondemand_readahead
and thus affects the readahead window.
After commit 06c0444290ce ("mm/filemap.c: generic_file_buffered_read() now
uses find_get_pages_contig"), update logic ... | ```diff
diff --git a/mm/filemap.c b/mm/filemap.c
index c5e2c70ea046..93e495d2d477 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2632,6 +2632,7 @@ ssize_t filemap_read(struct kiocb *iocb, struct iov_iter *iter,
int i, error = 0;
bool writably_mapped;
loff_t isize, end_offset;
+ loff_t last_pos = ra->prev_pos;
... |
c70699e555537b611f4cb426c26f8ab4a264a8a0 | Analyze and fix the following issue in the Linux kernel code: swap: stop add to avail list if swap is full | Problem Details:
Our test finds a WARN_ON in add_to_avail_list. During add_to_avail_list,
avail_lists is already in swap_avail_heads, while leads to this WARN_ON.
Here is the simplified calltrace:
------------[ cut here ]------------
Call trace:
add_to_avail_list+0xb8/0xc0
swap_range_free+0x110/0x138
swapcache_fr... | ```diff
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 2a4693642071..cad0209ac67f 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2328,7 +2328,10 @@ static void _enable_swap_info(struct swap_info_struct *p)
* swap_info_struct.
*/
plist_add(&p->list, &swap_active_head);
- add_to_avail_list(p);
+
+ /* add to... |
67490031e83a008c5ce8f562e7fa3b6b83adc861 | Analyze and fix the following issue in the Linux kernel code: swap: cleanup duplicated WARN_ON in add_to_avail_list | Problem Details:
Patch series "fix WARN_ON in add_to_avail_list".
Empty check for plist_node is checked in add_to_avail_list and plist_add.
Drop the duplicate one in add_to_avail_list.
Link: https://lkml.kernel.org/r/20230627120833.2230766-1-mawupeng1@huawei.com
Link: https://lkml.kernel.org/r/20230627120833.223076... | ```diff
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 8e6dde68b389..2a4693642071 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -714,10 +714,8 @@ static void add_to_avail_list(struct swap_info_struct *p)
int nid;
spin_lock(&swap_avail_lock);
- for_each_node(nid) {
- WARN_ON(!plist_node_empty(&p->avail_list... |
fad9c80e6371ee04a3fa5728efe20b88d8e4cccd | Analyze and fix the following issue in the Linux kernel code: maple_tree: fix a few documentation issues | Problem Details:
The documentation of mt_next() claims that it starts the search at the
provided index. That's incorrect as it starts the search after the
provided index.
The documentation of mt_find() is slightly confusing. "Handles locking"
is not really helpful as it does not explain how the "locking" works.
Als... | ```diff
diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h
index 295548cca8b3..6e5bd2c9875d 100644
--- a/include/linux/maple_tree.h
+++ b/include/linux/maple_tree.h
@@ -662,10 +662,11 @@ void *mt_next(struct maple_tree *mt, unsigned long index, unsigned long max);
* mt_for_each - Iterate over each e... |
20c897eadf13ee4305af62dbdfe7819307ddf0bc | Analyze and fix the following issue in the Linux kernel code: mm: madvise: fix uneven accounting of psi | Problem Details:
A folio turns into a Workingset during:
1) shrink_active_list() placing the folio from active to inactive list.
2) When a workingset transition is happening during the folio refault.
And when Workingset is set on a folio, PSI for memory can be accounted
during a) That folio is being reclaimed and b) R... | ```diff
diff --git a/mm/madvise.c b/mm/madvise.c
index 886f06066622..05f97038eac3 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -413,6 +413,8 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd,
folio_clear_referenced(folio);
folio_test_clear_young(folio);
+ if (folio_test_active(folio))
+ folio_set... |
d0c1f8dc5cf5133c20e1b3cc12bd291c7e13ff7a | Analyze and fix the following issue in the Linux kernel code: docs: kernel-parameters: Refer to the correct bitmap function | Problem Details:
The parser of the CPU lists is bitmap_parselist() that supports
special notations with the plain numbers. bitmap_parse() never
supported those and will fail in case one will try it.
Fixes: b18def121f07 ("bitmap_parse: Support 'all' semantics")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.in... | ```diff
diff --git a/Documentation/admin-guide/kernel-parameters.rst b/Documentation/admin-guide/kernel-parameters.rst
index 073f73880edf..102937bc8443 100644
--- a/Documentation/admin-guide/kernel-parameters.rst
+++ b/Documentation/admin-guide/kernel-parameters.rst
@@ -80,7 +80,7 @@ The special case-tolerant group nam... |
dca1c7d4ad8b5fc486eb2d408cdc010de541031e | Analyze and fix the following issue in the Linux kernel code: docs: sparse: fix invalid link addresses | Problem Details:
The http and git links are invalid, replace them with valid links.
Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20230804112320.35592-1-minhuadotchen@gmail.com | ```diff
diff --git a/Documentation/translations/zh_TW/sparse.txt b/Documentation/translations/zh_TW/sparse.txt
index 56fb17fd1359..35d3d1d748e6 100644
--- a/Documentation/translations/zh_TW/sparse.txt
+++ b/Documentation/translations/zh_TW/sparse.txt
@@ -66,11 +66,11 @@ __bitwise"類型。
你可以從 Sparse 的主頁獲取最新的發布版本:
- ht... |
ec62a746b65363f6078fb1eefc7faffe1a4cdc38 | Analyze and fix the following issue in the Linux kernel code: docs: move mips under arch | Problem Details:
and fix all in-tree references.
Architecture-specific documentation is being moved into Documentation/arch/
as a way of cleaning up the top-level documentation directory and making
the docs hierarchy more closely match the source hierarchy.
Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
Revie... | ```diff
diff --git a/Documentation/arch/index.rst b/Documentation/arch/index.rst
index 4b6b1beebad6..dc59634c5fbb 100644
--- a/Documentation/arch/index.rst
+++ b/Documentation/arch/index.rst
@@ -15,7 +15,7 @@ implementation.
ia64/index
loongarch/index
m68k/index
- ../mips/index
+ mips/index
nios2/in... |
51712e49b434950b6317188f88696556c277b10d | Analyze and fix the following issue in the Linux kernel code: docs: move loongarch under arch | Problem Details:
and fix all in-tree references.
Architecture-specific documentation is being moved into Documentation/arch/
as a way of cleaning up the top-level documentation directory and making
the docs hierarchy more closely match the source hierarchy.
Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
Acked... | ```diff
diff --git a/Documentation/arch/index.rst b/Documentation/arch/index.rst
index 8458b88e9b79..4b6b1beebad6 100644
--- a/Documentation/arch/index.rst
+++ b/Documentation/arch/index.rst
@@ -13,7 +13,7 @@ implementation.
arm/index
arm64/index
ia64/index
- ../loongarch/index
+ loongarch/index
m68... |
17b6fc88eb31a10726b702cf07ea998e9828d478 | Analyze and fix the following issue in the Linux kernel code: docs: mm: Fix number of base pages for 1GB HugeTLB | Problem Details:
1GB HugeTLB page consists of 262144 base pages.
Signed-off-by: Usama Arif <usama.arif@bytedance.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Acked-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: ... | ```diff
diff --git a/Documentation/mm/vmemmap_dedup.rst b/Documentation/mm/vmemmap_dedup.rst
index a4b12ff906c4..689a6907c70b 100644
--- a/Documentation/mm/vmemmap_dedup.rst
+++ b/Documentation/mm/vmemmap_dedup.rst
@@ -1,3 +1,4 @@
+
.. SPDX-License-Identifier: GPL-2.0
=========================================
@@ -1... |
5f513c8b9740ea05a136219739a5358780c3cb5f | Analyze and fix the following issue in the Linux kernel code: RDMA/irdma: Add missing kernel-doc in irdma_setup_umode_qp() | Problem Details:
Fix the following warning reported by kbuild:
drivers/infiniband/hw/irdma/verbs.c:584: warning: Function parameter
or member 'udata' not described in 'irdma_setup_umode_qp'
Fixes: 3a8498720450 ("RDMA/irdma: Allow accurate reporting on QP max send/recv WR")
Link: https://lore.kernel.org/r/... | ```diff
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 660be7f13060..6cffe21558fe 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -573,6 +573,7 @@ static void irdma_setup_virt_qp(struct irdma_device *iwdev,
/**
* irdma_setu... |
f0362a253606e2031f8d61c74195d4d6556e12a4 | Analyze and fix the following issue in the Linux kernel code: mm,ima,kexec,of: use memblock_free_late from ima_free_kexec_buffer | Problem Details:
The code calling ima_free_kexec_buffer runs long after the memblock
allocator has already been torn down, potentially resulting in a use
after free in memblock_isolate_range.
With KASAN or KFENCE, this use after free will result in a BUG
from the idle task, and a subsequent kernel panic.
Switch ima_f... | ```diff
diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c
index f26d2ba8a371..68278340cecf 100644
--- a/drivers/of/kexec.c
+++ b/drivers/of/kexec.c
@@ -184,7 +184,8 @@ int __init ima_free_kexec_buffer(void)
if (ret)
return ret;
- return memblock_phys_free(addr, size);
+ memblock_free_late(addr, size);
+ retur... |
5964a223f5e47a593c6ada9b9c54b61f04ac0a3b | Analyze and fix the following issue in the Linux kernel code: libbpf: Support triple-underscore flavors for kfunc relocation | Problem Details:
The function signature of kfuncs can change at any time due to their
intentional lack of stability guarantees. As kfuncs become more widely
used, BPF program writers will need facilities to support calling
different versions of a kfunc from a single BPF object. Consider this
simplified example based on... | ```diff
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index b14a4376a86e..2178b28878e2 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -550,6 +550,7 @@ struct extern_desc {
int btf_id;
int sec_btf_id;
const char *name;
+ char *essent_name;
bool is_set;
bool is_weak;
union ... |
94f23ac36f8b3c2140b00d78131c8df41cd9ac5d | Analyze and fix the following issue in the Linux kernel code: kselftest/arm64: Fix hwcaps selftest build | Problem Details:
The hwcaps selftest currently relies on the assembler being able to
assemble the crc32w instruction but this is not in the base v8.0 so is not
accepted by the standard GCC configurations used by many distributions.
Switch to manually encoding to fix the build.
Fixes: 09d2e95a04ad ("kselftest/arm64: ad... | ```diff
diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c
index fe844b825a1e..0593192c0753 100644
--- a/tools/testing/selftests/arm64/abi/hwcap.c
+++ b/tools/testing/selftests/arm64/abi/hwcap.c
@@ -48,7 +48,8 @@ static void atomics_sigill(void)
static void crc32_sigil... |
d11a69873d9a7435fe6a48531e165ab80a8b1221 | Analyze and fix the following issue in the Linux kernel code: hw_breakpoint: fix single-stepping when using bpf_overflow_handler | Problem Details:
Arm platforms use is_default_overflow_handler() to determine if the
hw_breakpoint code should single-step over the breakpoint trigger or
let the custom handler deal with it.
Since bpf_overflow_handler() currently isn't recognized as a default
handler, attaching a BPF program to a PERF_TYPE_BREAKPOINT ... | ```diff
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index 054e9199f30d..dc0fb7a81371 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -626,7 +626,7 @@ int hw_breakpoint_arch_parse(struct perf_event *bp,
hw->address &= ~alignment_mask;
hw->ctrl.... |
eb501c2d96cfce6b42528e8321ea085ec605e790 | Analyze and fix the following issue in the Linux kernel code: iommufd/selftest: Don't leak the platform device memory when unloading the module | Problem Details:
It should call platform_device_unregister() instead of
platform_device_del() to unregister and free the device.
Fixes: 23a1b46f15d5 ("iommufd/selftest: Make the mock iommu driver into a real driver")
Link: https://lore.kernel.org/r/20230816081318.1232865-1-yangyingliang@huawei.com
Signed-off-by: Yang ... | ```diff
diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c
index 90e7c5400282..56506d5753f1 100644
--- a/drivers/iommu/iommufd/selftest.c
+++ b/drivers/iommu/iommufd/selftest.c
@@ -1089,7 +1089,7 @@ err_sysfs:
err_bus:
bus_unregister(&iommufd_mock_bus_type.bus);
err_platform:
- platfor... |
c0a232f1e19e378c5c4e5973a996392942c80090 | Analyze and fix the following issue in the Linux kernel code: coresight: trbe: Fix TRBE potential sleep in atomic context | Problem Details:
smp_call_function_single() will allocate an IPI interrupt vector to
the target processor and send a function call request to the interrupt
vector. After the target processor receives the IPI interrupt, it will
execute arm_trbe_remove_coresight_cpu() call request in the interrupt
handler.
According to ... | ```diff
diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
index 8e4eb37e66e8..e20c1c6acc73 100644
--- a/drivers/hwtracing/coresight/coresight-trbe.c
+++ b/drivers/hwtracing/coresight/coresight-trbe.c
@@ -1225,6 +1225,16 @@ static void arm_trbe_enable_cpu(void *info... |
dfd122fe8591d513b5e51313601217b67ae98d13 | Analyze and fix the following issue in the Linux kernel code: backlight: lp855x: Drop ret variable in brightness change function | Problem Details:
Fixes the following warning:
drivers/video/backlight/lp855x_bl.c:252:7: warning: variable 'ret' is used
uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
Fixes: 5145531be5fb ("backlight: lp855x: Catch errors when changing b... | ```diff
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
index 61a7f45bfad8..da1f124db69c 100644
--- a/drivers/video/backlight/lp855x_bl.c
+++ b/drivers/video/backlight/lp855x_bl.c
@@ -241,19 +241,17 @@ static int lp855x_bl_update_status(struct backlight_device *bl)
{
struct lp8... |
06d220f13b1f05488f780c23065e765acab5ce56 | Analyze and fix the following issue in the Linux kernel code: pds_core: Fix function header descriptions | Problem Details:
The pds-vfio-pci series made a small interface change to
pds_client_register() and pds_client_unregister(), but forgot to update
the function header descriptions. Fix that.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308180411.OSqJPtMz-lkp@intel.com/... | ```diff
diff --git a/drivers/net/ethernet/amd/pds_core/auxbus.c b/drivers/net/ethernet/amd/pds_core/auxbus.c
index 63d28c0a7e08..4ebc8ad87b41 100644
--- a/drivers/net/ethernet/amd/pds_core/auxbus.c
+++ b/drivers/net/ethernet/amd/pds_core/auxbus.c
@@ -8,7 +8,7 @@
/**
* pds_client_register - Link the client to the f... |
b6594a17ecce03ca70a3f36783924635eea5499d | Analyze and fix the following issue in the Linux kernel code: bpf/tests: Enhance output on error and fix typos | Problem Details:
If a testcase returns a wrong (unexpected) value, print the expected and
returned value in hex notation in addition to the decimal notation.
This is very useful in tests which bit-shift hex values left or right and
helped me a lot while developing the JIT compiler for the hppa architecture.
Additiona... | ```diff
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 913a7a079239..ecde4216201e 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -596,8 +596,8 @@ static int __bpf_fill_alu_shift(struct bpf_test *self, u8 op,
{
static const s64 regs[] = {
0x0123456789abcdefLL, /* dword > 0, word < 0 */
- 0xfedcba98765432... |
a417ab334dccb603f6296cbf04c9f8059bc252eb | Analyze and fix the following issue in the Linux kernel code: mtd: maps: fix -Wvoid-pointer-to-enum-cast warning | Problem Details:
When building with clang 18 I see the following warning:
| drivers/mtd/maps/physmap-versatile.c:209:25: warning: cast to smaller
| integer type 'enum versatile_flashprot' from 'const void *' [-Wvoid-pointer-to-enum-cast]
| 209 | versatile_flashprot = (enum ve... | ```diff
diff --git a/drivers/mtd/maps/physmap-versatile.c b/drivers/mtd/maps/physmap-versatile.c
index 8e15d514c82d..2e779111bf79 100644
--- a/drivers/mtd/maps/physmap-versatile.c
+++ b/drivers/mtd/maps/physmap-versatile.c
@@ -206,7 +206,7 @@ int of_flash_probe_versatile(struct platform_device *pdev,
if (!sysnp)
... |
b9e002a34420e5ba25d4283be870c48e0c9e005f | Analyze and fix the following issue in the Linux kernel code: mtd: rawnand: fix -Wvoid-pointer-to-enum-cast warning | Problem Details:
When building with clang 18 I see the following warning:
| drivers/mtd/nand/raw/vf610_nfc.c:853:17: warning: cast to smaller integer
| type 'enum vf610_nfc_variant' from 'const void *' [-Wvoid-pointer-to-enum-cast]
| 853 | nfc->variant = (enum vf610_nfc_variant)of_id... | ```diff
diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c
index dcdf33dbaef2..039a44c054a4 100644
--- a/drivers/mtd/nand/raw/vf610_nfc.c
+++ b/drivers/mtd/nand/raw/vf610_nfc.c
@@ -850,7 +850,7 @@ static int vf610_nfc_probe(struct platform_device *pdev)
goto err_disable_clk;
}
- nfc... |
a5a88125d00612586e941ae13e7fcf36ba8f18a7 | Analyze and fix the following issue in the Linux kernel code: mtd: rawnand: fsmc: handle clk prepare error in fsmc_nand_resume() | Problem Details:
In fsmc_nand_resume(), the return value of clk_prepare_enable() should be
checked since it might fail.
Fixes: e25da1c07dfb ("mtd: fsmc_nand: Add clk_{un}prepare() support")
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.o... | ```diff
diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
index 7b4742420dfc..2e33ae77502a 100644
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ b/drivers/mtd/nand/raw/fsmc_nand.c
@@ -1200,9 +1200,14 @@ static int fsmc_nand_suspend(struct device *dev)
static int fsmc_nand_resume(struct devic... |
ab15aabac028afd4889745239a1860a76598e79f | Analyze and fix the following issue in the Linux kernel code: mtd: rawnand: qcom: Use EOPNOTSUPP instead of ENOTSUPP | Problem Details:
Checkpatch complains over the usage of ENOTSUPP for new patches as below:
WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
So let's fix the error code which is already present in qcom_check_op().
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Miq... | ```diff
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 2ade27e50c43..412dc9a2e751 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -3040,7 +3040,7 @@ static int qcom_check_op(struct nand_chip *chip,
instr->ctx.cmd.opcode != NAND_... |
b4bb4800313de0d8faa5615d4943615ff56c1cc2 | Analyze and fix the following issue in the Linux kernel code: mtd: rawnand: qcom: Fix the opcode check in qcom_check_op() | Problem Details:
qcom_check_op() function checks for the invalid opcode for the instruction
types. Currently, it just returns -ENOTSUPP for all opcodes of
NAND_OP_CMD_INSTR type due to the use of "||" operator instead of "&&".
Fix it!
This also fixes the following smatch warning:
drivers/mtd/nand/raw/qcom_nandc.c:303... | ```diff
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 81084044c636..2ade27e50c43 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -3033,12 +3033,12 @@ static int qcom_check_op(struct nand_chip *chip,
switch (instr->type) {
case ... |
dd3c8f4ab2035bdba41c840a7daaf1cc735f36bb | Analyze and fix the following issue in the Linux kernel code: mtd: rawnand: qcom: Handle unsupported opcode in qcom_op_cmd_mapping() | Problem Details:
Handle the scenario where the caller has passed an unsupported opcode to
qcom_op_cmd_mapping(). In that case, log the error and return the
-EOPNOTSUPP errono. Also, let's propagate this error code all the way up.
This also fixes the following smatch warning:
drivers/mtd/nand/raw/qcom_nandc.c:2941 qco... | ```diff
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 515ce45a738b..81084044c636 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -2585,20 +2585,23 @@ static int qcom_op_cmd_mapping(struct qcom_nand_controller *nandc, u8 opcode,
q_op... |
6c77997bc63982ab718662fee0bff6756d3116bc | Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add lwt_xmit tests for BPF_REROUTE | Problem Details:
There is no lwt test case for BPF_REROUTE yet. Add test cases for both
normal and abnormal situations. The abnormal situation is set up with an
fq qdisc on the reroute target device. Without proper fixes, overflow
this qdisc queue limit (to trigger a drop) would panic the kernel.
Signed-off-by: Yan Zh... | ```diff
diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
index fa083f1e5b34..1c7584e8dd9e 100644
--- a/tools/testing/selftests/bpf/config
+++ b/tools/testing/selftests/bpf/config
@@ -60,6 +60,7 @@ CONFIG_NET_IPGRE=y
CONFIG_NET_IPGRE_DEMUX=y
CONFIG_NET_IPIP=y
CONFIG_NET_MPLS_GSO=y
... |
43a7c3ef8a15d19ee59214fa1d1c6bab55f9d894 | Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add lwt_xmit tests for BPF_REDIRECT | Problem Details:
There is no lwt_xmit test case for BPF_REDIRECT yet. Add test cases for
both normal and abnormal situations. For abnormal test cases, devices
are set down or have its carrier set down. Without proper fixes,
BPF_REDIRECT to either ingress or egress of such device would panic the
kernel.
Signed-off-by: ... | ```diff
diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
index 3b350bc31343..fa083f1e5b34 100644
--- a/tools/testing/selftests/bpf/config
+++ b/tools/testing/selftests/bpf/config
@@ -16,6 +16,7 @@ CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEB... |
a171fbec88a2c730b108c7147ac5e7b2f5a02b47 | Analyze and fix the following issue in the Linux kernel code: lwt: Check LWTUNNEL_XMIT_CONTINUE strictly | Problem Details:
LWTUNNEL_XMIT_CONTINUE is implicitly assumed in ip(6)_finish_output2,
such that any positive return value from a xmit hook could cause
unexpected continue behavior, despite that related skb may have been
freed. This could be error-prone for future xmit hook ops. One of the
possible errors is to return ... | ```diff
diff --git a/include/net/lwtunnel.h b/include/net/lwtunnel.h
index 6f15e6fa154e..53bd2d02a4f0 100644
--- a/include/net/lwtunnel.h
+++ b/include/net/lwtunnel.h
@@ -16,9 +16,12 @@
#define LWTUNNEL_STATE_INPUT_REDIRECT BIT(1)
#define LWTUNNEL_STATE_XMIT_REDIRECT BIT(2)
+/* LWTUNNEL_XMIT_CONTINUE should be dist... |
29b22badb7a84b783e3a4fffca16f7768fb31205 | Analyze and fix the following issue in the Linux kernel code: lwt: Fix return values of BPF xmit ops | Problem Details:
BPF encap ops can return different types of positive values, such like
NET_RX_DROP, NET_XMIT_CN, NETDEV_TX_BUSY, and so on, from function
skb_do_redirect and bpf_lwt_xmit_reroute. At the xmit hook, such return
values would be treated implicitly as LWTUNNEL_XMIT_CONTINUE in
ip(6)_finish_output2. When th... | ```diff
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index 8b6b5e72b217..4a0797f0a154 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -60,9 +60,8 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt,
ret = BPF_OK;
} else {
skb_reset_mac_header(skb);
- ret = skb_do_red... |
45191087c3e2866e4fbcd775e443ee0380211ed1 | Analyze and fix the following issue in the Linux kernel code: dtivers: ntb: fix parameter check in perf_setup_dbgfs() | Problem Details:
Make IS_ERR() judge the debugfs_create_dir() function return
in perf_setup_dbgfs().
Signed-off-by: Minjie Du <duminjie@vivo.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us> | ```diff
diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index 65e1e5cf1b29..553f1f46bc66 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -1355,7 +1355,7 @@ static void perf_setup_dbgfs(struct perf_ctx *perf)
struct pci_dev *pdev = perf->ntb->pdev;
perf->dbgfs_d... |
34daf445f82bd3a4df852bb5f1dffd792ac830a0 | Analyze and fix the following issue in the Linux kernel code: powerpc/perf: Convert fsl_emb notifier to state machine callbacks | Problem Details:
CC arch/powerpc/perf/core-fsl-emb.o
arch/powerpc/perf/core-fsl-emb.c:675:6: error: no previous prototype for 'hw_perf_event_setup' [-Werror=missing-prototypes]
675 | void hw_perf_event_setup(int cpu)
| ^~~~~~~~~~~~~~~~~~~
Looks like fsl_emb was completely missed by commit 3f6da390539... | ```diff
diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-emb.c
index ee721f420a7b..1a53ab08447c 100644
--- a/arch/powerpc/perf/core-fsl-emb.c
+++ b/arch/powerpc/perf/core-fsl-emb.c
@@ -645,7 +645,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
struct cpu_hw_events *cpuhw = this_c... |
77583f77ed9b1452ac62caebf09b2206da10bbf9 | Analyze and fix the following issue in the Linux kernel code: PCI: rpaphp: Error out on busy status from get-sensor-state | Problem Details:
When certain PHB HW failure causes pHyp to recover PHB, it marks the PE
state as temporarily unavailable until recovery is complete. This also
triggers an EEH handler in Linux which needs to notify drivers, and perform
recovery. But before notifying the driver about the PCI error it uses
get_adapter_st... | ```diff
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index 630f77057c23..bcfd26ec6d30 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -19,12 +19,92 @@
#include "../pci.h" /* for pci_add_new_bus */
#include "rpaphp.h"
+/*
+ * RTAS call get-... |
979fe44af819d76fc02a5a97ad1cb74f7d83578e | Analyze and fix the following issue in the Linux kernel code: s390/ipl: fix virtual vs physical address confusion | Problem Details:
The value of ipl_cert_list_addr boot variable contains
a physical address, which is used directly. That works
because virtual and physical address spaces are currently
the same, but otherwise it is wrong.
While at it, fix also a comment for the platform keyring.
Signed-off-by: Alexander Gordeev <agor... | ```diff
diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machine_kexec_file.c
index 2df94d32140c..8d207b82d9fe 100644
--- a/arch/s390/kernel/machine_kexec_file.c
+++ b/arch/s390/kernel/machine_kexec_file.c
@@ -188,7 +188,7 @@ static int kexec_file_add_ipl_report(struct kimage *image,
data->memsz ... |
919a4a941863c539e982d34903e93d9777316f7d | Analyze and fix the following issue in the Linux kernel code: ASoC: amd: acp: Add kcontrols and widgets per-codec in common code | Problem Details:
Commit 7ac3404c2e21 ("ASoC: amd: acp: Map missing jack kcontrols") adds
card kcontrols and DAPM widgets corresponding to jacks for Headphone and
Headset Mic. But these were already being added in acp-legacy-mach.c and
acp-sof-mach.c, so this causes a probe error:
sof_mach rt5682s-hs-rt1019: control ... | ```diff
diff --git a/sound/soc/amd/acp/acp-legacy-mach.c b/sound/soc/amd/acp/acp-legacy-mach.c
index 676ad50638d0..6d57d17ddfd7 100644
--- a/sound/soc/amd/acp/acp-legacy-mach.c
+++ b/sound/soc/amd/acp/acp-legacy-mach.c
@@ -75,23 +75,6 @@ static struct acp_card_drvdata rt5682s_rt1019_rmb_data = {
.tdm_mode = false,
}... |
c962098ca4af146f2625ed64399926a098752c9c | Analyze and fix the following issue in the Linux kernel code: btrfs: fix incorrect splitting in btrfs_drop_extent_map_range | Problem Details:
In production we were seeing a variety of WARN_ON()'s in the extent_map
code, specifically in btrfs_drop_extent_map_range() when we have to call
add_extent_mapping() for our second split.
Consider the following extent map layout
PINNED
[0 16K) [32K, 48K)
and then we call btrfs_drop_extent_map_ran... | ```diff
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 0cdb3e86f29b..a6d8368ed0ed 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -760,8 +760,6 @@ void btrfs_drop_extent_map_range(struct btrfs_inode *inode, u64 start, u64 end,
if (skip_pinned && test_bit(EXTENT_FLAG_PINNED, &em-... |
8fcc1c40b747069644db6102c1d84c942c9d4d86 | Analyze and fix the following issue in the Linux kernel code: pinctrl: renesas: rza2: Add lock around pinctrl_generic{{add,remove}_group,{add,remove}_function} | Problem Details:
The pinctrl group and function creation/remove calls expect
caller to take care of locking. Add lock around these functions.
Fixes: b59d0e782706 ("pinctrl: Add RZ/A2 pin and gpio controller")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>... | ```diff
diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c b/drivers/pinctrl/renesas/pinctrl-rza2.c
index 40b1326a1077..5591ddf16fdf 100644
--- a/drivers/pinctrl/renesas/pinctrl-rza2.c
+++ b/drivers/pinctrl/renesas/pinctrl-rza2.c
@@ -14,6 +14,7 @@
#include <linux/gpio/driver.h>
#include <linux/io.h>
#include <linux... |
f982b9d57e7f834138fc908804fe66f646f2b108 | Analyze and fix the following issue in the Linux kernel code: pinctrl: renesas: rzv2m: Fix NULL pointer dereference in rzv2m_dt_subnode_to_map() | Problem Details:
Fix the below random NULL pointer crash during boot by serializing
pinctrl group and function creation/remove calls in
rzv2m_dt_subnode_to_map() with mutex lock.
Crash logs:
pc : __pi_strcmp+0x20/0x140
lr : pinmux_func_name_to_selector+0x68/0xa4
Call trace:
__pi_strcmp+0x20/0x140
p... | ```diff
diff --git a/drivers/pinctrl/renesas/pinctrl-rzv2m.c b/drivers/pinctrl/renesas/pinctrl-rzv2m.c
index 35b23c1a5684..9146101ea9e2 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzv2m.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzv2m.c
@@ -14,6 +14,7 @@
#include <linux/gpio/driver.h>
#include <linux/io.h>
#include <l... |
661efa2284bbc2338da0424e219603f034072c74 | Analyze and fix the following issue in the Linux kernel code: pinctrl: renesas: rzg2l: Fix NULL pointer dereference in rzg2l_dt_subnode_to_map() | Problem Details:
Fix the below random NULL pointer crash during boot by serializing
pinctrl group and function creation/remove calls in
rzg2l_dt_subnode_to_map() with mutex lock.
Crash log:
pc : __pi_strcmp+0x20/0x140
lr : pinmux_func_name_to_selector+0x68/0xa4
Call trace:
__pi_strcmp+0x20/0x140
pi... | ```diff
diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index b53d26167da5..6e8a76556e23 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -11,6 +11,7 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <lin... |
6405b72e8d17bd1875a56ae52d23ec3cd51b9d66 | Analyze and fix the following issue in the Linux kernel code: x86/srso: Correct the mitigation status when SMT is disabled | Problem Details:
Specify how is SRSO mitigated when SMT is disabled. Also, correct the
SMT check for that.
Fixes: e9fbc47b818b ("x86/srso: Disable the mitigation on unaffected configurations")
Suggested-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Josh Poimboeu... | ```diff
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 9026e3fe9f6c..f081d26616ac 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -2428,8 +2428,7 @@ static void __init srso_select_mitigation(void)
* Zen1/2 with SMT off aren't vulnerable after the right
* I... |
d3679199f6847061683069d65737a55a8a5c60ef | Analyze and fix the following issue in the Linux kernel code: dt-bindings: leds: Fix reference to definition of default-state | Problem Details:
At least since the YAML conversion, the default-state property is
described in leds/common.yaml, so there's no need to point to another
file for its definition.
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/2023081416... | ```diff
diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
index 1c425eb5bec9..5fb7007f3618 100644
--- a/Documentation/devicetree/bindings/leds/common.yaml
+++ b/Documentation/devicetree/bindings/leds/common.yaml
@@ -83,8 +83,7 @@ properties:
- en... |
080aa61e370b9c5cafe71cacadbfe0e72db4d6df | Analyze and fix the following issue in the Linux kernel code: crypto: fix uninit-value in af_alg_free_resources | Problem Details:
Syzbot was able to trigger use of uninitialized memory in
af_alg_free_resources.
Bug is caused by missing initialization of rsgl->sgl.need_unpin before
adding to rsgl_list. Then in case of extract_iter_to_sg() failure, rsgl
is left with uninitialized need_unpin which is read during clean up
BUG: KMSA... | ```diff
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 06b15b9f661c..10efb56d8b48 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -1241,6 +1241,8 @@ int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags,
return -ENOMEM;
}
+ rsgl->sgl.need_unpin =
+ iov_iter_extract_will_pin(&msg->m... |
9a5d660fdb25d20748d7f9e9559c86073c3bb368 | Analyze and fix the following issue in the Linux kernel code: media: ivsc: Add ACPI dependency | Problem Details:
The IVSC driver only works in ACPI systems so make it depend on ACPI.
Compiling it elsewhere has little if any value.
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Fixes: 29006e196a56 ("media: pci: intel: ivsc: Add CSI submodule")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewe... | ```diff
diff --git a/drivers/media/pci/intel/ivsc/Kconfig b/drivers/media/pci/intel/ivsc/Kconfig
index 9535ac10f4f7..1ef1c4e3750d 100644
--- a/drivers/media/pci/intel/ivsc/Kconfig
+++ b/drivers/media/pci/intel/ivsc/Kconfig
@@ -3,7 +3,7 @@
config INTEL_VSC
tristate "Intel Visual Sensing Controller"
- depends on INT... |
b949ee6801f4a47ae0e02845242c99af351c4d26 | Analyze and fix the following issue in the Linux kernel code: powerpc/fadump: invoke ibm,os-term with rtas_call_unlocked() | Problem Details:
Invoke ibm,os-term call with rtas_call_unlocked(), without using the
RTAS spinlock, to avoid deadlock in the unlikely event of a machine
crash while making an RTAS call.
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Signed-off-by: Michael El... | ```diff
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index c087eeee320f..a8192e5b1a5f 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -1587,6 +1587,7 @@ static bool ibm_extended_os_term;
void rtas_os_term(char *str)
{
s32 token = rtas_function_token(RTAS_FN_IBM_OS... |
1a9e02673e2550f5612099e64e8761f0c8fc0f50 | Analyze and fix the following issue in the Linux kernel code: coresight: Fix memory leak in acpi_buffer->pointer | Problem Details:
There are memory leaks reported by kmemleak:
...
unreferenced object 0xffff00213c141000 (size 1024):
comm "systemd-udevd", pid 2123, jiffies 4294909467 (age 6062.160s)
hex dump (first 32 bytes):
04 00 00 00 02 00 00 00 18 10 14 3c 21 00 ff ff ...........<!...
00 00 00 00 00 00 00 00 03 00 ... | ```diff
diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
index 7d7b641c0a71..9d550f5697fa 100644
--- a/drivers/hwtracing/coresight/coresight-platform.c
+++ b/drivers/hwtracing/coresight/coresight-platform.c
@@ -492,19 +492,18 @@ static inline bool acpi_val... |
66201cacc33d740057bd64af6371ad846cff376f | Analyze and fix the following issue in the Linux kernel code: ASoC: component: Add generic PCM copy ops | Problem Details:
For following the ALSA PCM core change, a new PCM copy ops is added
toe ASoC component framework: snd_soc_component_driver receives the
copy ops, and snd_soc_pcm_component_copy() helper is provided.
This also fixes a long-standing potential bug where the ASoC driver
covers only copy_user PCM callback ... | ```diff
diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index 87f248a06271..8040f001f2fb 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -141,6 +141,10 @@ struct snd_soc_component_driver {
struct snd_pcm_substream *substream, int channel,
unsigned l... |
7e5bac610d2fd4d270adfd2d70ce766df1711bf8 | Analyze and fix the following issue in the Linux kernel code: clocksource/drivers/sun5i: Convert to platform device driver | Problem Details:
Convert the sun5i hstimer driver to a platform device driver.
This makes it work again on A20 and other systems where the
clock is provided by a platform device driver.
Fixes: 7ec03b588d22 ("clk: sunxi-ng: Convert early providers to platform drivers")
Signed-off-by: Mans Rullgard <mans@mansr.com>
Acke... | ```diff
diff --git a/drivers/clocksource/timer-sun5i.c b/drivers/clocksource/timer-sun5i.c
index 3ca427e54daf..69fee3540d37 100644
--- a/drivers/clocksource/timer-sun5i.c
+++ b/drivers/clocksource/timer-sun5i.c
@@ -16,9 +16,7 @@
#include <linux/irqreturn.h>
#include <linux/reset.h>
#include <linux/slab.h>
-#include ... |
e7d65e40ab5a5940785c5922f317602d0268caaf | Analyze and fix the following issue in the Linux kernel code: clocksource/drivers/arm_arch_timer: Disable timer before programming CVAL | Problem Details:
Due to the fact that the use of `writeq_relaxed()` to program CVAL is
not guaranteed to be atomic, it is necessary to disable the timer before
programming CVAL.
However, if the MMIO timer is already enabled and has not yet expired,
there is a possibility of unexpected behavior occurring: when the CPU
... | ```diff
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index e09d4427f604..f6c5f8916e59 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -774,6 +774,13 @@ static __always_inline void set_next_event_mem(const int access, unsigned lo... |
9d0164c6500e3b78b329c5eca7909eba61e972d3 | Analyze and fix the following issue in the Linux kernel code: mtd: spi-nor: Add support for sst26vf032b flash | Problem Details:
Describe this new part. The datasheet is public.
Link: https://ww1.microchip.com/downloads/aemDocuments/documents/MPD/ProductDocuments/DataSheets/SST26VF032B-SST26VF032BA-2.5V-3.0V-32-Mbit-Serial-Quad-IO-%28SQI%29-Flash-Memory-20005218K.pdf
Here are the sfdp tables plus base testing to show it works.... | ```diff
diff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c
index 09fdc7023e09..197d2c1101ed 100644
--- a/drivers/mtd/spi-nor/sst.c
+++ b/drivers/mtd/spi-nor/sst.c
@@ -113,6 +113,10 @@ static const struct flash_info sst_nor_parts[] = {
SPI_NOR_QUAD_READ) },
{ "sst26vf016b", INFO(0xbf2641, 0, ... |
f01d8155a92e33cdaa85d20bfbe6c441907b3c1f | Analyze and fix the following issue in the Linux kernel code: mtd: spi-nor: Check bus width while setting QE bit | Problem Details:
spi_nor_write_16bit_sr_and_check() should also check if bus width is
4 before setting QE bit.
Fixes: 39d1e3340c73 ("mtd: spi-nor: Fix clearing of QE bit on lock()/unlock()")
Suggested-by: Michael Walle <michael@walle.cc>
Suggested-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Hsin-Yi Wan... | ```diff
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 614960c7d22c..1b0c6770c14e 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -870,21 +870,22 @@ static int spi_nor_write_16bit_sr_and_check(struct spi_nor *nor, u8 sr1)
ret = spi_nor_read_cr(nor, &sr_cr[1]);
... |
760b6b7925bf09491aafa4727eef74fc6bf738b0 | Analyze and fix the following issue in the Linux kernel code: leds: turris-omnia: Drop unnecessary mutex locking | Problem Details:
Do not lock driver mutex in the global LED panel brightness sysfs
accessors brightness_show() and brightness_store().
The mutex locking is unnecessary here. The I2C transfers are guarded by
I2C core locking mechanism, and the LED commands itself do not interfere
with other commands.
Fixes: 089381b27a... | ```diff
diff --git a/drivers/leds/leds-turris-omnia.c b/drivers/leds/leds-turris-omnia.c
index ffcaf228e44a..b8a95a917cfa 100644
--- a/drivers/leds/leds-turris-omnia.c
+++ b/drivers/leds/leds-turris-omnia.c
@@ -156,12 +156,9 @@ static ssize_t brightness_show(struct device *dev, struct device_attribute *a,
ch... |
1c27c0ca220b42fb8b727d68b58693b77cbd095d | Analyze and fix the following issue in the Linux kernel code: crypto: jh7110 - Include crypto/hash.h in header file | Problem Details:
The header file jh7110-cryp uses ahash_request without including
crypto/hash.h. Fix that by adding the inclusion.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | ```diff
diff --git a/drivers/crypto/starfive/jh7110-cryp.h b/drivers/crypto/starfive/jh7110-cryp.h
index b6d809e8fe45..4462d1db9544 100644
--- a/drivers/crypto/starfive/jh7110-cryp.h
+++ b/drivers/crypto/starfive/jh7110-cryp.h
@@ -2,15 +2,15 @@
#ifndef __STARFIVE_STR_H__
#define __STARFIVE_STR_H__
-#include <linux/... |
8e03dd62e5be811efbf0cbeba47e79e793519105 | Analyze and fix the following issue in the Linux kernel code: hwrng: iproc-rng200 - Implement suspend and resume calls | Problem Details:
Chips such as BCM7278 support system wide suspend/resume which will
cause the HWRNG block to lose its state and reset to its power on reset
register values. We need to cleanup and re-initialize the HWRNG for it
to be functional coming out of a system suspend cycle.
Fixes: c3577f6100ca ("hwrng: iproc-r... | ```diff
diff --git a/drivers/char/hw_random/iproc-rng200.c b/drivers/char/hw_random/iproc-rng200.c
index 34df3f0d3e45..440fe28bddc0 100644
--- a/drivers/char/hw_random/iproc-rng200.c
+++ b/drivers/char/hw_random/iproc-rng200.c
@@ -181,6 +181,8 @@ static int iproc_rng200_probe(struct platform_device *pdev)
return PTR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.