id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
8f35ae17ef565a605de5f409e04bcd49a55d7646
Analyze and fix the following issue in the Linux kernel code: sctp: do not check hb_timer.expires when resetting hb_timer
Problem Details: It tries to avoid the frequently hb_timer refresh in commit ba6f5e33bdbb ("sctp: avoid refreshing heartbeat timer too often"), and it only allows mod_timer when the new expires is after hb_timer.expires. It means even a much shorter interval for hb timer gets applied, it will have to wait until the cur...
```diff diff --git a/net/sctp/transport.c b/net/sctp/transport.c index ca1eba95c293..2f66a2006517 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -196,9 +196,7 @@ void sctp_transport_reset_hb_timer(struct sctp_transport *transport) /* When a data chunk is sent, reset the heartbeat interval. */ ex...
eaf317e7d2bbb04486c9842aea9be1e94bd416ed
Analyze and fix the following issue in the Linux kernel code: tools: ynl-gen: prevent do / dump reordering
Problem Details: An earlier fix tried to address generated code jumping around one code-gen run to another. Turns out dict()s are already ordered since Python 3.7, the problem is that we iterate over operation modes using a set(). Sets are unordered in Python. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
```diff diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/ynl-gen-c.py index 1aa872e582ab..e5002d420961 100755 --- a/tools/net/ynl/ynl-gen-c.py +++ b/tools/net/ynl/ynl-gen-c.py @@ -933,7 +933,7 @@ class Family: if attr_set_name != op['attribute-set']: raise Exception('For a global po...
fc546faa559538fb312c77e055243ece18ab3288
Analyze and fix the following issue in the Linux kernel code: powerpc/kexec_file: Count hot-pluggable memory in FDT estimate
Problem Details: On Systems where online memory is lesser compared to max memory, the kexec_file_load system call may fail to load the kdump kernel with the below errors: "Failed to update fdt with linux,drconf-usable-memory property" "Error setting up usable-memory property for kdump kernel" This happens bec...
```diff diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c index 19d084682bc2..52085751f5f4 100644 --- a/arch/powerpc/kexec/file_load_64.c +++ b/arch/powerpc/kexec/file_load_64.c @@ -990,7 +990,7 @@ unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image) * number of usable memor...
32e69f232db4ca11f26e5961daeff93906ce232f
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Use emulator callbacks instead of duplicating "host flags"
Problem Details: Instead of re-defining the "host flags" bits, just expose dedicated helpers for each of the two remaining flags that are consumed by the emulator. The emulator never consumes both "is guest" and "is SMM" in close proximity, so there is no motivation to avoid additional indirect branches. Also while a...
```diff diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index e653b0b7ff77..3b0436b1f93c 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -2074,11 +2074,11 @@ enum { TASK_SWITCH_GATE = 3, }; -#define HF_GUEST_MASK (1 << 5) /* VCPU is in guest-mod...
0be465c61d4623e49672a2e7942d9d101184b8f8
Analyze and fix the following issue in the Linux kernel code: dt-bindings: interrupt-controller: brcm,bcm7120-l2-intc: Fix 'brcm,int-fwd-mask' differing type
Problem Details: 'brcm,int-fwd-mask' is also defined in brcm,bcm7038-l1-intc.yaml as a 'uint32-array', so unify the type definition. Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20230125221423.3058221-1-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org>
```diff diff --git a/Documentation/devicetree/bindings/interrupt-controller/brcm,bcm7120-l2-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/brcm,bcm7120-l2-intc.yaml index 46b2eb3c43ee..c680de1cbd56 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/brcm,bcm7120-l2-intc.yaml +++ b/Do...
ac86f547ca1002aec2ef66b9e64d03f45bbbfbb9
Analyze and fix the following issue in the Linux kernel code: mm: memcg: fix NULL pointer in mem_cgroup_track_foreign_dirty_slowpath()
Problem Details: As commit 18365225f044 ("hwpoison, memcg: forcibly uncharge LRU pages"), hwpoison will forcibly uncharg a LRU hwpoisoned page, the folio_memcg could be NULl, then, mem_cgroup_track_foreign_dirty_slowpath() could occurs a NULL pointer dereference, let's do not record the foreign writebacks for folio mem...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index d3c8203cab6c..85dc9b88ea37 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1666,10 +1666,13 @@ void mem_cgroup_track_foreign_dirty_slowpath(struct folio *folio, static inline void mem_cgroup_track_foreign_di...
1e90e35b620587e82cf52f3b7ccd8270d824d840
Analyze and fix the following issue in the Linux kernel code: Kconfig.debug: fix the help description in SCHED_DEBUG
Problem Details: The correct file path for SCHED_DEBUG is /sys/kernel/debug/sched. Link: https://lkml.kernel.org/r/202301291013573466558@zte.com.cn Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Geert Uytterhoeven <geert+renesas@glider.be> Cc: Josh Poimboeuf <jpoimb...
```diff diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 80c69d026890..139758854ce6 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1208,7 +1208,7 @@ config SCHED_DEBUG depends on DEBUG_KERNEL && PROC_FS default y help - If you say Y here, the /proc/sched_debug file will be provided + If yo...
993f57e0277b78182eb9e4955d118cc8b086c83d
Analyze and fix the following issue in the Linux kernel code: mm: use stack_depot_early_init for kmemleak
Problem Details: Mirsad report the below error which is caused by stack_depot_init() failure in kvcalloc. Solve this by having stackdepot use stack_depot_early_init(). On 1/4/23 17:08, Mirsad Goran Todorovac wrote: I hate to bring bad news again, but there seems to be a problem with the output of /sys/kernel/debug/km...
```diff diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 881c3f84e88a..80c69d026890 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -754,6 +754,7 @@ config DEBUG_KMEMLEAK select KALLSYMS select CRC32 select STACKDEPOT + select STACKDEPOT_ALWAYS_INIT if !DEBUG_KMEMLEAK_DEFAULT_OFF help Say ...
f65c4bbbd682b0877b669828b4e033b8d5d0a2dc
Analyze and fix the following issue in the Linux kernel code: Squashfs: fix handling and sanity checking of xattr_ids count
Problem Details: A Sysbot [1] corrupted filesystem exposes two flaws in the handling and sanity checking of the xattr_ids count in the filesystem. Both of these flaws cause computation overflow due to incorrect typing. In the corrupted filesystem the xattr_ids value is 4294967071, which stored in a signed variable be...
```diff diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h index b3fdc8212c5f..95f8e8901768 100644 --- a/fs/squashfs/squashfs_fs.h +++ b/fs/squashfs/squashfs_fs.h @@ -183,7 +183,7 @@ static inline int squashfs_block_size(__le32 raw) #define SQUASHFS_ID_BLOCK_BYTES(A) (SQUASHFS_ID_BLOCKS(A) *\ siz...
c1c551bebf928889e7a8fef7415b44f9a64975f4
Analyze and fix the following issue in the Linux kernel code: sh: define RUNTIME_DISCARD_EXIT
Problem Details: sh vmlinux fails to link with GNU ld < 2.40 (likely < 2.36) since commit 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv"). This is similar to fixes for powerpc and s390: commit 4b9880dbf3bd ("powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT"). commit a494398bde27 ("s390: define RUNTIME_DI...
```diff diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S index 3161b9ccd2a5..b6276a3521d7 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S @@ -4,6 +4,7 @@ * Written by Niibe Yutaka and Paul Mundt */ OUTPUT_ARCH(sh) +#define RUNTIME_DISCARD_EXIT #include <asm/thr...
88d7b12068b95731c280af8ce88e8ee9561f96de
Analyze and fix the following issue in the Linux kernel code: highmem: round down the address passed to kunmap_flush_on_unmap()
Problem Details: We already round down the address in kunmap_local_indexed() which is the other implementation of __kunmap_local(). The only implementation of kunmap_flush_on_unmap() is PA-RISC which is expecting a page-aligned address. This may be causing PA-RISC to be flushing the wrong addresses currently. Link: ...
```diff diff --git a/include/linux/highmem-internal.h b/include/linux/highmem-internal.h index 034b1106d022..e098f38422af 100644 --- a/include/linux/highmem-internal.h +++ b/include/linux/highmem-internal.h @@ -200,7 +200,7 @@ static inline void *kmap_local_pfn(unsigned long pfn) static inline void __kunmap_local(cons...
73bdf65ea74857d7fb2ec3067a3cec0e261b1462
Analyze and fix the following issue in the Linux kernel code: migrate: hugetlb: check for hugetlb shared PMD in node migration
Problem Details: migrate_pages/mempolicy semantics state that CAP_SYS_NICE is required to move pages shared with another process to a different node. page_mapcount > 1 is being used to determine if a hugetlb page is shared. However, a hugetlb page will have a mapcount of 1 if mapped by multiple processes via a shared...
```diff diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 02c8a712282f..f940395667c8 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -600,7 +600,8 @@ static int queue_pages_hugetlb(pte_t *pte, unsigned long hmask, /* With MPOL_MF_MOVE, we migrate only unshared hugepage. */ if (flags & (MPOL_MF_MOVE_ALL) || -...
3489dbb696d25602aea8c3e669a6d43b76bd5358
Analyze and fix the following issue in the Linux kernel code: mm: hugetlb: proc: check for hugetlb shared PMD in /proc/PID/smaps
Problem Details: Patch series "Fixes for hugetlb mapcount at most 1 for shared PMDs". This issue of mapcount in hugetlb pages referenced by shared PMDs was discussed in [1]. The following two patches address user visible behavior caused by this issue. [1] https://lore.kernel.org/linux-mm/Y9BF+OCdWnCSilEu@monkey/ T...
```diff diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index e35a0398db63..af1c49ae11b1 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -745,9 +745,7 @@ static int smaps_hugetlb_range(pte_t *pte, unsigned long hmask, page = pfn_swap_entry_to_page(swpent); } if (page) { - int mapcount = page_m...
edb5d0cf5525357652aff6eacd9850b8ced07143
Analyze and fix the following issue in the Linux kernel code: mm/MADV_COLLAPSE: catch !none !huge !bad pmd lookups
Problem Details: In commit 34488399fa08 ("mm/madvise: add file and shmem support to MADV_COLLAPSE") we make the following change to find_pmd_or_thp_or_none(): - if (!pmd_present(pmde)) - return SCAN_PMD_NULL; + if (pmd_none(pmde)) + return SCAN_PMD_NONE; This was for-use by...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 935aa8b71d1c..90acfea40c13 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -847,6 +847,10 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address, return SCAN_SUCCEED; } +/* + * See pmd_trans_unstable() for how the result ...
8ef852f1cb426a5812aee700d3b4297aaa426acc
Analyze and fix the following issue in the Linux kernel code: Revert "mm: kmemleak: alloc gray object for reserved region with direct map"
Problem Details: This reverts commit 972fa3a7c17c9d60212e32ecc0205dc585b1e769. Kmemleak operates by periodically scanning memory regions for pointers to allocated memory blocks to determine if they are leaked or not. However, reserved memory regions can be used for DMA transactions between a device and a CPU, and thu...
```diff diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index f08b25195ae7..d1a68b6d03b3 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -26,7 +26,6 @@ #include <linux/serial_core.h> #include <linux/sysfs.h> #include <linux/random.h> -#include <linux/kmemleak.h> #include <asm/setup.h> /* for COMMAND_LIN...
0d7866eace86c174e2d4f4fe3a7eca7a3a31247a
Analyze and fix the following issue in the Linux kernel code: freevxfs: Kconfig: fix spelling
Problem Details: Fix a spello in freevxfs Kconfig. (reported by codespell) Link: https://lkml.kernel.org/r/20230124181638.15604-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
```diff diff --git a/fs/freevxfs/Kconfig b/fs/freevxfs/Kconfig index c05c71d57291..0e2fc08f7de4 100644 --- a/fs/freevxfs/Kconfig +++ b/fs/freevxfs/Kconfig @@ -8,7 +8,7 @@ config VXFS_FS of SCO UnixWare (and possibly others) and optionally available for Sunsoft Solaris, HP-UX and many other operating systems. Ho...
ab6ef70a8b0d314c2160af70b0de984664d675e0
Analyze and fix the following issue in the Linux kernel code: maple_tree: should get pivots boundary by type
Problem Details: We should get pivots boundary by type. Fixes a potential overindexing of mt_pivots[]. Link: https://lkml.kernel.org/r/20221112234308.23823-1-richard.weiyang@gmail.com Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Reviewed-by: Liam R. Ho...
```diff diff --git a/lib/maple_tree.c b/lib/maple_tree.c index b990ccea454e..5a976393c9ae 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -670,12 +670,13 @@ static inline unsigned long mte_pivot(const struct maple_enode *mn, unsigned char piv) { struct maple_node *node = mte_to_node(mn); + enum maple_t...
d014cd7c1c358edc3ea82ebf327a036a42ed0164
Analyze and fix the following issue in the Linux kernel code: mm, mremap: fix mremap() expanding for vma's with vm_ops->close()
Problem Details: Fabian has reported another regression in 6.1 due to ca3d76b0aa80 ("mm: add merging after mremap resize"). The problem is that vma_merge() can fail when vma has a vm_ops->close() method, causing is_mergeable_vma() test to be negative. This was happening for vma mapping a file from fuse-overlayfs, whi...
```diff diff --git a/mm/mremap.c b/mm/mremap.c index fe587c5d6591..930f65c315c0 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -1027,16 +1027,29 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, } /* - * Function vma_merge() is called on the extension we are adding to - * the alread...
72e544b1b28325fe78a4687b980871a7e4101f76
Analyze and fix the following issue in the Linux kernel code: squashfs: harden sanity check in squashfs_read_xattr_id_table
Problem Details: While mounting a corrupted filesystem, a signed integer '*xattr_ids' can become less than zero. This leads to the incorrect computation of 'len' and 'indexes' values which can cause null-ptr-deref in copy_bio_to_actor() or out-of-bounds accesses in the next sanity checks inside squashfs_read_xattr_id_...
```diff diff --git a/fs/squashfs/xattr_id.c b/fs/squashfs/xattr_id.c index 087cab8c78f4..f6d78cbc3e74 100644 --- a/fs/squashfs/xattr_id.c +++ b/fs/squashfs/xattr_id.c @@ -76,7 +76,7 @@ __le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 table_start, /* Sanity check values */ /* there is always at lea...
6f28a2613497fc587e347afa99fa2c52230678a7
Analyze and fix the following issue in the Linux kernel code: ia64: fix build error due to switch case label appearing next to declaration
Problem Details: Since commit aa06a9bd8533 ("ia64: fix clock_getres(CLOCK_MONOTONIC) to report ITC frequency"), gcc 10.1.0 fails to build ia64 with the gnomic: | ../arch/ia64/kernel/sys_ia64.c: In function 'ia64_clock_getres': | ../arch/ia64/kernel/sys_ia64.c:189:3: error: a label can only be part of a statement and a ...
```diff diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c index f6a502e8f02c..6e948d015332 100644 --- a/arch/ia64/kernel/sys_ia64.c +++ b/arch/ia64/kernel/sys_ia64.c @@ -170,6 +170,9 @@ ia64_mremap (unsigned long addr, unsigned long old_len, unsigned long new_len, u asmlinkage long ia64_clock_get...
de08eaa6156405f2e9369f06ba5afae0e4ab3b62
Analyze and fix the following issue in the Linux kernel code: mm: multi-gen LRU: fix crash during cgroup migration
Problem Details: lru_gen_migrate_mm() assumes lru_gen_add_mm() runs prior to itself. This isn't true for the following scenario: CPU 1 CPU 2 clone() cgroup_can_fork() cgroup_procs_write() cgroup_post_fork() task_l...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index e83d2a74e942..bf3eedf0209c 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3323,13 +3323,16 @@ void lru_gen_migrate_mm(struct mm_struct *mm) if (mem_cgroup_disabled()) return; + /* migration can happen before addition */ + if (!mm->lru_gen.memcg) + return; + ...
55ab834a86a9934c4f17825c115f7dc16a89aae7
Analyze and fix the following issue in the Linux kernel code: Revert "mm: add nodes= arg to memory.reclaim"
Problem Details: This reverts commit 12a5d3955227b0d7e04fb793ccceeb2a1dd275c5. Although it is recognized that a finer grained pro-active reclaim is something we need and want the semantic of this implementation is really ambiguous. In a follow up discussion it became clear that there are two essential usecases here. ...
```diff diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst index c8ae7c897f14..74cec76be9f2 100644 --- a/Documentation/admin-guide/cgroup-v2.rst +++ b/Documentation/admin-guide/cgroup-v2.rst @@ -1245,13 +1245,17 @@ PAGE_SIZE multiple when read back. This is a simple interfa...
85b325815b566e8e7472e0089c8cbb0d5ea274ec
Analyze and fix the following issue in the Linux kernel code: zsmalloc: fix a race with deferred_handles storing
Problem Details: Currently, there is a race between zs_free() and zs_reclaim_page(): zs_reclaim_page() finds a handle to an allocated object, but before the eviction happens, an independent zs_free() call to the same handle could come in and overwrite the object value stored at the handle with the last deferred handle....
```diff diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 9445bee6b014..702bc3fd687a 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -113,7 +113,23 @@ * have room for two bit at least. */ #define OBJ_ALLOCATED_TAG 1 -#define OBJ_TAG_BITS 1 + +#ifdef CONFIG_ZPOOL +/* + * The second least-significant bit in the obj...
023f47a8250c6bdb4aebe744db4bf7f73414028b
Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: fix ->anon_vma race
Problem Details: If an ->anon_vma is attached to the VMA, collapse_and_free_pmd() requires it to be locked. Page table traversal is allowed under any one of the mmap lock, the anon_vma lock (if the VMA is associated with an anon_vma), and the mapping lock (if the VMA is associated with a mapping); and so to be able to...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 79be13133322..935aa8b71d1c 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1642,7 +1642,7 @@ static int retract_page_tables(struct address_space *mapping, pgoff_t pgoff, * has higher cost too. It would also probably require locking * the anon_v...
7327e8111adb315423035fb5233533016dfd3f2e
Analyze and fix the following issue in the Linux kernel code: maple_tree: fix mas_empty_area_rev() lower bound validation
Problem Details: mas_empty_area_rev() was not correctly validating the start of a gap against the lower limit. This could lead to the range starting lower than the requested minimum. Fix the issue by better validating a gap once one is found. This commit also adds tests to the maple tree test suite for this issue an...
```diff diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 26e2045d3cda..b990ccea454e 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4887,7 +4887,7 @@ static bool mas_rev_awalk(struct ma_state *mas, unsigned long size) unsigned long *pivots, *gaps; void __rcu **slots; unsigned long gap = 0; - unsign...
fe137a4fe0e77eb95396cfc5c3dd7df404421aa4
Analyze and fix the following issue in the Linux kernel code: tools/tracing/rtla: osnoise_hist: use total duration for average calculation
Problem Details: Sampled durations must be weighted by observed quantity, to arrive at a correct average duration value. Perform calculation of total duration by summing (duration * count). Link: https://lkml.kernel.org/r/20230103103400.275566-2-br015@umbiko.net Fixes: 829a6c0b5698 ("rtla/osnoise: Add the hist mode"...
```diff diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c index 5d7ea479ac89..fe34452fc4ec 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -121,6 +121,7 @@ static void osnoise_hist_update_multiple(struct osnoise_tool *tool, int c...
e5ae8803847b80fe9d744a3174abe2b7bfed222a
Analyze and fix the following issue in the Linux kernel code: cgroup/cpuset: Fix wrong check in update_parent_subparts_cpumask()
Problem Details: It was found that the check to see if a partition could use up all the cpus from the parent cpuset in update_parent_subparts_cpumask() was incorrect. As a result, it is possible to leave parent with no effective cpu left even if there are tasks in the parent cpuset. This can lead to system panic as rep...
```diff diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index a29c0b13706b..205dc9edcaa9 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -1346,7 +1346,7 @@ static int update_parent_subparts_cpumask(struct cpuset *cs, int cmd, * A parent can be left with no CPU as long as there is no...
b66f723bb552ad59c2acb5d45ea45c890f84498b
Analyze and fix the following issue in the Linux kernel code: gfs2: Improve gfs2_make_fs_rw error handling
Problem Details: In gfs2_make_fs_rw(), make sure to call gfs2_consist() to report an inconsistency and mark the filesystem as withdrawn when gfs2_find_jhead() fails. At the end of gfs2_make_fs_rw(), when we discover that the filesystem has been withdrawn, make sure we report an error. This also replaces the gfs2_with...
```diff diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 52c3502de58c..a83fa62106f0 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -138,8 +138,10 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp) return -EIO; error = gfs2_find_jhead(sdp->sd_jdesc, &head, false); - if (error || gfs2_withdrawn(sdp)) + if (er...
fd5f446f0b3d529e55cf2f81f3b994a7216808ca
Analyze and fix the following issue in the Linux kernel code: gfs2: check gl_object in rgrp glops
Problem Details: Function gfs2_clear_rgrpd() is called during unmount to free all rgrps and their sub-objects. If the rgrp glock is held (e.g. in SH) it calls gfs2_glock_cb() to unlock, then calls flush_delayed_work() to make sure any glock work is finished. However, there is a race with other cluster nodes who may req...
```diff diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index e4c585f16ddd..007cd59d0e47 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -193,7 +193,7 @@ static int rgrp_go_sync(struct gfs2_glock *gl) struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl); int error; - if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)...
228804a35caa7edae4a81049281e7f106dea1ad1
Analyze and fix the following issue in the Linux kernel code: gfs2: Make glock lru list scanning safer
Problem Details: In __gfs2_glock_put(), remove the glock from the lru list *after* dropping the glock lock. This prevents deadlocks against gfs2_scan_glock_lru(). In gfs2_scan_glock_lru(), make sure that the glock's reference count is zero before moving the glock to the dispose list. This skips glocks that are marke...
```diff diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 05ef0ffa7ea6..fbfbf7a2feac 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -274,9 +274,8 @@ static void __gfs2_glock_put(struct gfs2_glock *gl) struct address_space *mapping = gfs2_glock2aspace(gl); lockref_mark_dead(&gl->gl_lockref); - - gfs2_glo...
c913cd5489930abbb557ef144a333846286754c3
Analyze and fix the following issue in the Linux kernel code: drm/panel: boe-tv101wum-nl6: Ensure DSI writes succeed during disable
Problem Details: The unprepare sequence has started to fail after moving to panel bridge code in the msm drm driver (commit 007ac0262b0d ("drm/msm/dsi: switch to DRM_PANEL_BRIDGE")). You'll see messages like this in the kernel logs: panel-boe-tv101wum-nl6 ae94000.dsi.0: failed to set panel off: -22 This is because...
```diff diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index 857a2f0420d7..c924f1124ebc 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -1193,14 +1193,11 @@ static int boe_panel_enter_sleep_...
19eee67386fe68b8f39dc947d15711a5b5cef6ac
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sc8280xp: add p1 register blocks to DP nodes
Problem Details: Per DT bindings add p1 register blocks to all DP controllers on SC8280XP platform. Fixes: 6f299ae7f96d ("arm64: dts: qcom: sc8280xp: add p1 register blocks to DP nodes") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lo...
```diff diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi index fa2d0d7d1367..dceb7eb3106b 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi @@ -3204,7 +3204,8 @@ reg = <0 0xae9a000 0 0x200>, <0 0xae9a200 0 0x200>,...
b05ada5615f844c3fdcf5e2a0fa35a4bc1a394f2
Analyze and fix the following issue in the Linux kernel code: Doc/damon: fix the data path error
Problem Details: %s/modules/module/ Signed-off-by: Hui Su <suhui_kernel@163.com> Reviewed-by: Alex Shi <alexsshi@kernel.org> Reviewed-by: SeongJae Park <sj@kernel.org> Link: https://lore.kernel.org/r/Y9Tm1FiKBPKA2Tcx@localhost.localdomain Signed-off-by: Jonathan Corbet <corbet@lwn.net>
```diff diff --git a/Documentation/admin-guide/mm/damon/lru_sort.rst b/Documentation/admin-guide/mm/damon/lru_sort.rst index c09cace80651..7b0775d281b4 100644 --- a/Documentation/admin-guide/mm/damon/lru_sort.rst +++ b/Documentation/admin-guide/mm/damon/lru_sort.rst @@ -54,7 +54,7 @@ that is built with ``CONFIG_DAMON_L...
19a1261322335642282cc100867cb93579b03f0b
Analyze and fix the following issue in the Linux kernel code: Documentation: coccinelle: Escape --options to fix Sphinx output
Problem Details: Without such escaping, -- is rendered as – (en dash). Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Acked-by: Julia Lawall <Julia.Lawall@inria.fr> Link: https://lore.kernel.org/r/20230129151408.1525324-1-j.neuschaefer@gmx.net Signed-off-by: Jonathan Corbet <corbet@lwn.net>
```diff diff --git a/Documentation/dev-tools/coccinelle.rst b/Documentation/dev-tools/coccinelle.rst index d9976069ed12..535ce126fb4f 100644 --- a/Documentation/dev-tools/coccinelle.rst +++ b/Documentation/dev-tools/coccinelle.rst @@ -219,7 +219,7 @@ instance:: cat cocci.err You can use SPFLAGS to add debugging...
242b6f34b5b51ec151dc3abafd16edb1f685bb3c
Analyze and fix the following issue in the Linux kernel code: arm64/sysreg: clean up some inconsistent indenting
Problem Details: No functional modification involved. ./arch/arm64/kvm/sys_regs.c:80:2-9: code aligned with following code on line 82. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3897 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https...
```diff diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index d5ee52d6bf73..d852e4c26177 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -78,7 +78,7 @@ void vcpu_write_sys_reg(struct kvm_vcpu *vcpu, u64 val, int reg) __vcpu_write_sys_reg_to_cpu(val, reg)) return; ...
4f64a6c9f6f11e8b7314f8e27e2c4568706009e6
Analyze and fix the following issue in the Linux kernel code: perf: Fix perf_event_pmu_context serialization
Problem Details: Syzkaller triggered a WARN in put_pmu_ctx(). WARNING: CPU: 1 PID: 2245 at kernel/events/core.c:4925 put_pmu_ctx+0x1f0/0x278 This is because there is no locking around the access of "if (!epc->ctx)" in find_get_pmu_context() and when it is set to NULL in put_pmu_ctx(). The decrement of the referenc...
```diff diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 1341f7d62da4..be48f1cb1878 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -476,6 +476,15 @@ extern int _atomic_dec_and_lock_irqsave(atomic_t *atomic, spinlock_t *lock, #define atomic_dec_and_lock_irqsave(atomic, loc...
7914695743d598b189d549f2f57af24aa5633705
Analyze and fix the following issue in the Linux kernel code: x86/amd: Cache debug register values in percpu variables
Problem Details: Reading DR[0-3]_ADDR_MASK MSRs takes about 250 cycles which is going to be noticeable with the AMD KVM SEV-ES DebugSwap feature enabled. KVM is going to store host's DR[0-3] and DR[0-3]_ADDR_MASK before switching to a guest; the hardware is going to swap these on VMRUN and VMEXIT. Store MSR values pa...
```diff diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h index b049d950612f..f126b2ee890f 100644 --- a/arch/x86/include/asm/debugreg.h +++ b/arch/x86/include/asm/debugreg.h @@ -126,9 +126,14 @@ static __always_inline void local_db_restore(unsigned long dr7) } #ifdef CONFIG_CPU_SUP_AMD ...
4ce11e833319c2794905c51be7ab00b12f25b264
Analyze and fix the following issue in the Linux kernel code: drm/amd: Fix initialization for nbio 4.3.0
Problem Details: A mistake has been made on some boards with NBIO 4.3.0 where some NBIO registers aren't properly set by the hardware. Ensure that they're set during initialization. Cc: Natikar Basavaraj <Basavaraj.Natikar@amd.com> Tested-by: Satyanarayana ReddyTVN <Satyanarayana.ReddyTVN@amd.com> Tested-by: Rutvij G...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c b/drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c index 15eb3658d70e..09fdcd20cb91 100644 --- a/drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c @@ -337,7 +337,13 @@ const struct nbio_hdp_flush_reg nbio_v4_3_hdp_flush_reg = { stati...
504f9ba8e02b2fb4496f6bccfa331b10fd34d14a
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: 3.2.221
Problem Details: This version brings along following fixes: - fix linux dp link lost handled only one time - Reset DMUB mailbox SW state after HW reset - Unassign does_plane_fit_in_mall function from dcn3.2 - Add Function delaration in dc_link - Fix crash when connecting 2 displays with video playback - Adjust downscal...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index 42ce45306483..2e23fd8b4e9f 100644 --- a/drivers/gpu/drm/amd/display/dc/dc.h +++ b/drivers/gpu/drm/amd/display/dc/dc.h @@ -47,7 +47,7 @@ struct aux_payload; struct set_config_cmd_payload; struct dmub_notification; -#...
e322843e5e33e72ff218d661f3d15ff9c9f2f1b5
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: fix linux dp link lost handled only one time
Problem Details: [Why] linux amdgpu defer handle link lost irq. dm add handle request to irq work queue for the first irq of link lost. if link training fails for link lost handle, link will not be enabled anymore. [How] allow adding handle request of link lost to work queue before running dp link training for link lo...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index ffbbd50a61d1..f4451fa6f781 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1301,10 +1301,28 @@ static void dm_handle...
972243f973eb0821084e5833d5f7f4ed025f42da
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: fix FCLK pstate change underflow
Problem Details: [Why] Currently we set FCLK p-state change watermark calculated based on dummy p-state latency when UCLK p-state is not supported [How] Calculate FCLK p-state change watermark based on on FCLK pstate change latency in case UCLK p-state is not supported Reviewed-by: Nevenko Stupar <Nevenko.Stupar@amd....
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c index 0dc1a03999b6..28e9f3644bf4 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c @@ -2126,6 +2126,10 @@ void dcn32...
32e3da4310bb1c55b076ed477dea6ddf5a965e69
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Fix only one ABM pipe enabled under ODM combined case
Problem Details: [Why] ABM set pipe before updating ODM status, it leads to incorrect ABM pipe setting when enabling ODM combine. [How] Call ABM set pipe flow after ODM status update in program pipe sequence. Reviewed-by: Chun-Liang Chang <Chun-Liang.Chang@amd.com> Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauska...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c index 916dceecd3de..cb8edb14603a 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c @@ -1777,6 +1777,15 @@ static void dcn20_...
73dd4ca4b5a01235607231839bd351bbef75a1d2
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Fix Z8 support configurations
Problem Details: [Why] It's not supported in multi-display, but it is supported in 2nd eDP screen only. [How] Remove multi display support, restrict number of planes for all z-states support, but still allow Z8 if we're not using PWRSEQ0. Reviewed-by: Charlene Liu <Charlene.Liu@amd.com> Acked-by: Alex Hung <alex.hung...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c index 197df404761a..d3ba65efe1d2 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c @@ -949,7 +949,6 @@ static enum d...
e3834491b92a10d97f0cc0029e276d1938469bfe
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: Add Debug Log for MST and PCON
Problem Details: Add log for MST/PCON specific use case: 1. If DP1.2 hub where gives reduced link bw and no dsc support. 2. If less than 4-lane configuration where gives reduced bw. 3. If FRL PCON enabled for asic. 4. Track MST sink count. Reviewed-by: Hersen Wu <Hersenxs.Wu@amd.com> Acked-by: Alex Hung <alex.hung@amd...
```diff diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 9846bd6e0456..ffbbd50a61d1 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1622,6 +1622,9 @@ static int amdgpu_dm_in...
918d5166439078364453f2eb5b4d8e75095a510e
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: fix MALL size hardcoded for DCN321
Problem Details: [Why] MALL size available can vary for different SKUs MALL size was still hardcoded for DCN321 [How] Remove hardcoding MALL size for DCN321 Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com> Acked-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Samson Tam <Samson.Tam@amd.com> Tested-by: Daniel Wheeler <dan...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c b/drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c index fd57e0167737..55f918b44077 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c @@ -1714,7 +1714,6 @@...
cf488dcd0ab75d01bb09edd529aa6381c5ebec68
Analyze and fix the following issue in the Linux kernel code: drm/amd: Allow s0ix without BIOS support
Problem Details: We guard the suspend entry code from running unless we have proper BIOS support for either S3 mode or s0ix mode. If a user's system doesn't support either of these modes the kernel still does offer s2idle in `/sys/power/mem_sleep` so there is an expectation from users that it works even if the power c...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index f29c1d0ad4c1..458362e4ea01 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -1079,20 +1079,16 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *ade...
ae267fc1cfe9f941afcb90dc963ee6448dae73cf
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to abort atomic write only during do_exist()
Problem Details: Commit 7a10f0177e11 ("f2fs: don't give partially written atomic data from process crash") attempted to drop atomic write data after process crash, however, f2fs_abort_atomic_write() may be called from noncrash case, fix it by adding missed PF_EXITING check condition f2fs_file_flush(). - application cr...
```diff diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 391da47761e3..eaae2ad3957b 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1876,7 +1876,8 @@ static int f2fs_file_flush(struct file *file, fl_owner_t id) * until all the writers close its file. Since this should be done * before dropping file lock, i...
e6261beb0c629403dc58997294dd521bd23664af
Analyze and fix the following issue in the Linux kernel code: f2fs: allow set compression option of files without blocks
Problem Details: Files created by truncate have a size but no blocks, so they can be allowed to set compression option. Fixes: e1e8debec656 ("f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl") Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.or...
```diff diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index f5c1b7814954..391da47761e3 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3941,7 +3941,7 @@ static int f2fs_ioc_set_compress_option(struct file *filp, unsigned long arg) goto out; } - if (inode->i_size != 0) { + if (F2FS_HAS_BLOCKS(inode)) { ret...
9a5571cff4ffcfc24847df9fd545cc5799ac0ee5
Analyze and fix the following issue in the Linux kernel code: f2fs: fix information leak in f2fs_move_inline_dirents()
Problem Details: When converting an inline directory to a regular one, f2fs is leaking uninitialized memory to disk because it doesn't initialize the entire directory block. Fix this by zero-initializing the block. This bug was introduced by commit 4ec17d688d74 ("f2fs: avoid unneeded initializing when converting inli...
```diff diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 08e302d32118..72269e7efd26 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -421,18 +421,17 @@ static int f2fs_move_inline_dirents(struct inode *dir, struct page *ipage, dentry_blk = page_address(page); + /* + * Start by zeroing the full block...
b1b9896718bc1a212dc288ad66a5fa2fef11353d
Analyze and fix the following issue in the Linux kernel code: fs: f2fs: initialize fsdata in pagecache_write()
Problem Details: When aops->write_begin() does not initialize fsdata, KMSAN may report an error passing the latter to aops->write_end(). Fix this by unconditionally initializing fsdata. Suggested-by: Eric Biggers <ebiggers@kernel.org> Fixes: 95ae251fe828 ("f2fs: add fs-verity support") Signed-off-by: Alexander Potape...
```diff diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c index c352fff88a5e..3f4f3295f1c6 100644 --- a/fs/f2fs/verity.c +++ b/fs/f2fs/verity.c @@ -81,7 +81,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count, size_t n = min_t(size_t, count, PAGE_SIZE - offset_in_page(pos)); st...
9b13a8662ea61430005d3de3fc1d73e383b1ce5a
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to check warm_data_age_threshold
Problem Details: hot_data_age_threshold is a non-zero positive number, and condition 2 includes condition 1, so there is no need to additionally judge whether t is 0. And let's remove it. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index e396851a6dd1..3c6425f9ed0a 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -689,7 +689,7 @@ out: } if (!strcmp(a->attr.name, "warm_data_age_threshold")) { - if (t == 0 || t <= sbi->hot_data_age_threshold) + if (t <= sbi->hot_data_age_threshold) ...
c1085957dece02bda586cbffc1328f3bca09325f
Analyze and fix the following issue in the Linux kernel code: f2fs: clarify compress level bit offset
Problem Details: commit 3fde13f817e2 ("f2fs: compress: support compress level") introduce compress level, which macro(COMPRESS_LEVEL_OFFSET) is 8, But use wrong comment about compress level. Let's fix it. Signed-off-by: Yangtao Li <frank.li@vivo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <...
```diff diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index ee0d75d9a302..1701f25117ea 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h @@ -315,7 +315,7 @@ struct f2fs_inode { __u8 i_log_cluster_size; /* log of cluster size */ __le16 i_compress_flag; /* compress flag */ ...
2381a68556c0d2cb027f9dbfabc654a899782c62
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to show discard_unit mount opt
Problem Details: Convert to show discard_unit only when has DISCARD opt. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 5fc83771042d..ab8a77ffc1f4 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1908,10 +1908,17 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) seq_puts(seq, ",disable_roll_forward"); if (test_opt(sbi, NORECOVERY)) seq_pu...
d48a7b3a72f121655d95b5157c32c7d555e44c05
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to do sanity check on extent cache correctly
Problem Details: In do_read_inode(), sanity_check_inode() should be called after f2fs_init_read_extent_tree(), fix it. Fixes: 72840cccc0a1 ("f2fs: allocate the extent_cache by default") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 01b9e6f85f6b..fd2ee5554985 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -413,12 +413,6 @@ static int do_read_inode(struct inode *inode) fi->i_inline_xattr_size = 0; } - if (!sanity_check_inode(inode, node_page)) { - f2fs_put_page(node_page, 1...
81ea42b9c3d61ea34d82d900ed93f4b4851f13b0
Analyze and fix the following issue in the Linux kernel code: block: Fix the blk_mq_destroy_queue() documentation
Problem Details: Commit 2b3f056f72e5 moved a blk_put_queue() call from blk_mq_destroy_queue() into its callers. Reflect this change in the documentation block above blk_mq_destroy_queue(). Cc: Christoph Hellwig <hch@lst.de> Cc: Sagi Grimberg <sagi@grimberg.me> Cc: Chaitanya Kulkarni <kch@nvidia.com> Cc: Keith Busch <k...
```diff diff --git a/block/blk-mq.c b/block/blk-mq.c index 9d463f7563bc..9c8dc70020bc 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4069,8 +4069,9 @@ EXPORT_SYMBOL(blk_mq_init_queue); * blk_mq_destroy_queue - shutdown a request queue * @q: request queue to shutdown * - * This shuts down a request queue all...
4958db3245fa655bf18251bd2a83bcc164071c39
Analyze and fix the following issue in the Linux kernel code: ima: Introduce MMAP_CHECK_REQPROT hook
Problem Details: Commit 98de59bfe4b2f ("take calculation of final prot in security_mmap_file() into a helper") caused ima_file_mmap() to receive the protections requested by the application and not those applied by the kernel. After restoring the original MMAP_CHECK behavior, existing attestation servers might be brok...
```diff diff --git a/Documentation/ABI/testing/ima_policy b/Documentation/ABI/testing/ima_policy index db17fc8a0c9f..49db0ff288e5 100644 --- a/Documentation/ABI/testing/ima_policy +++ b/Documentation/ABI/testing/ima_policy @@ -35,7 +35,7 @@ Description: [FIRMWARE_CHECK] [KEXEC_KERNEL_CHECK] [KEXEC_INITRAMFS_C...
4971c268b85e1c7a734a61622fc0813c86e2362e
Analyze and fix the following issue in the Linux kernel code: ima: Align ima_file_mmap() parameters with mmap_file LSM hook
Problem Details: Commit 98de59bfe4b2f ("take calculation of final prot in security_mmap_file() into a helper") moved the code to update prot, to be the actual protections applied to the kernel, to a new helper called mmap_prot(). However, while without the helper ima_file_mmap() was getting the updated prot, with the ...
```diff diff --git a/include/linux/ima.h b/include/linux/ima.h index 5a0b2a285a18..d79fee67235e 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h @@ -21,7 +21,8 @@ extern int ima_file_check(struct file *file, int mask); extern void ima_post_create_tmpfile(struct user_namespace *mnt_userns, struct ino...
0c6924c262e819c4997b9cae0df6bd6e7b0b8754
Analyze and fix the following issue in the Linux kernel code: s390/cio: introduce locking for register/unregister functions
Problem Details: Unbinding an I/O subchannel with a child-CCW device in disconnected state sometimes causes a kernel-panic. The race condition was seen mostly during testing, when setting all the CHPIDs of a device to offline and at the same time, the unbinding the I/O subchannel driver. The kernel-panic occurs becaus...
```diff diff --git a/arch/s390/include/asm/ccwdev.h b/arch/s390/include/asm/ccwdev.h index bd1596810cc1..91d261751d25 100644 --- a/arch/s390/include/asm/ccwdev.h +++ b/arch/s390/include/asm/ccwdev.h @@ -15,6 +15,7 @@ #include <asm/fcx.h> #include <asm/irq.h> #include <asm/schid.h> +#include <linux/mutex.h> /* str...
e966ccf836e8964edf984adc4b4af5f3a3e07de6
Analyze and fix the following issue in the Linux kernel code: s390/boot: avoid mapping standby memory
Problem Details: Commit bb1520d581a3 ("s390/mm: start kernel with DAT enabled") doesn't consider online memory holes due to potential memory offlining and erroneously creates pgtables for stand-by memory, which bear RW+X attribute and trigger a warning: RANGE SIZE STATE REMOVABLE BLOC...
```diff diff --git a/arch/s390/boot/boot.h b/arch/s390/boot/boot.h index 8abedae76e53..830cfabaa6a0 100644 --- a/arch/s390/boot/boot.h +++ b/arch/s390/boot/boot.h @@ -44,7 +44,7 @@ void print_missing_facilities(void); void sclp_early_setup_buffer(void); void print_pgm_check_info(void); unsigned long get_random_base(...
7ab41c2c08a32132ba8c14624910e2fe8ce4ba4b
Analyze and fix the following issue in the Linux kernel code: s390/decompressor: specify __decompress() buf len to avoid overflow
Problem Details: Historically calls to __decompress() didn't specify "out_len" parameter on many architectures including s390, expecting that no writes beyond uncompressed kernel image are performed. This has changed since commit 2aa14b1ab2c4 ("zstd: import usptream v1.5.2") which includes zstd library commit 6a7ede3df...
```diff diff --git a/arch/s390/boot/decompressor.c b/arch/s390/boot/decompressor.c index 8dcd7af2911a..b519a1f045d8 100644 --- a/arch/s390/boot/decompressor.c +++ b/arch/s390/boot/decompressor.c @@ -80,6 +80,6 @@ void *decompress_kernel(void) void *output = (void *)decompress_offset; __decompress(_compressed_star...
8250865c164e3ddb930953523c93b3c821bdd322
Analyze and fix the following issue in the Linux kernel code: evm: call dump_security_xattr() in all cases to remove code duplication
Problem Details: Currently dump_security_xattr() is used to dump security xattr value which is larger than 64 bytes, otherwise, pr_debug() is used. In order to remove code duplication, refactor dump_security_xattr() and call it in all cases. Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by: Mimi Zoha...
```diff diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c index fa5ff13fa8c9..0fe6c9cd8eab 100644 --- a/security/integrity/evm/evm_crypto.c +++ b/security/integrity/evm/evm_crypto.c @@ -183,8 +183,8 @@ static void hmac_add_misc(struct shash_desc *desc, struct inode *inode, * Dump ...
84e28aa513af814807a5e9a0e5f3cab773946f3c
Analyze and fix the following issue in the Linux kernel code: rxrpc: Generate extra pings for RTT during heavy-receive call
Problem Details: When doing a call that has a single transmitted data packet and a massive amount of received data packets, we only ping for one RTT sample, which means we don't get a good reading on it. Fix this by converting occasional IDLE ACKs into PING ACKs to elicit a response. Signed-off-by: David Howells <dho...
```diff diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h index cdcadb1345dc..450b8f345814 100644 --- a/include/trace/events/rxrpc.h +++ b/include/trace/events/rxrpc.h @@ -360,11 +360,12 @@ EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \ EM(rxrpc_propose_ack_input_data, "DataIn ") \ EM(rxr...
254c71374a70051a043676b67ba4f7ad392b5fe6
Analyze and fix the following issue in the Linux kernel code: kunit: fix kunit_test_init_section_suites(...)
Problem Details: Looks like kunit_test_init_section_suites(...) was messed up in a merge conflict. This fixes it. kunit_test_init_section_suites(...) was not updated to avoid the extra level of indirection when .kunit_test_suites was flattened. Given no-one was actively using it, this went unnoticed for a long period ...
```diff diff --git a/include/kunit/test.h b/include/kunit/test.h index a20bff149bdf..08d3559dd703 100644 --- a/include/kunit/test.h +++ b/include/kunit/test.h @@ -303,7 +303,6 @@ static inline int kunit_run_all_tests(void) */ #define kunit_test_init_section_suites(__suites...) \ __kunit_test_suites(CONCATENATE(_...
c888b7bd916c4d85e06a6c3e507d5d68b229518f
Analyze and fix the following issue in the Linux kernel code: arm64: rename ARM64_HAS_IRQ_PRIO_MASKING to ARM64_HAS_GIC_PRIO_MASKING
Problem Details: Subsequent patches will add more GIC-related cpucaps. When we do so, it would be nice to give them a consistent HAS_GIC_* prefix. In preparation for doing so, this patch renames the existing ARM64_HAS_IRQ_PRIO_MASKING cap to ARM64_HAS_GIC_PRIO_MASKING. The cpucaps file was hand-modified; all other ch...
```diff diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index 03d1c9d7af82..c50928398e4b 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -806,7 +806,7 @@ static inline bool system_has_full_ptr_auth(void) static __always_inline bool sy...
0e62ccb9598dae492588bef0453a059bb2bbbabe
Analyze and fix the following issue in the Linux kernel code: arm64: rename ARM64_HAS_SYSREG_GIC_CPUIF to ARM64_HAS_GIC_CPUIF_SYSREGS
Problem Details: Subsequent patches will add more GIC-related cpucaps. When we do so, it would be nice to give them a consistent HAS_GIC_* prefix. In preparation for doing so, this patch renames the existing ARM64_HAS_SYSREG_GIC_CPUIF cap to ARM64_HAS_GIC_CPUIF_SYSREGS. The 'CPUIF_SYSREGS' suffix is chosen so that th...
```diff diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index a77315b338e6..ad2a1f5503f3 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2142,7 +2142,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { }, { .desc = "GIC system reg...
b2ab432bcf65e6fa3ec3fef6dd08796404b009d0
Analyze and fix the following issue in the Linux kernel code: kselftest/arm64: Remove redundant _start labels from zt-test
Problem Details: The newly added zt-test program copied the pattern from the other FP stress test programs of having a redundant _start label which is rejected by clang, as we did in a parallel series for the other tests remove the label so we can build with clang. No functional change. Signed-off-by: Mark Brown <bro...
```diff diff --git a/tools/testing/selftests/arm64/fp/zt-test.S b/tools/testing/selftests/arm64/fp/zt-test.S index 7ec90976cf5e..d63286397638 100644 --- a/tools/testing/selftests/arm64/fp/zt-test.S +++ b/tools/testing/selftests/arm64/fp/zt-test.S @@ -200,7 +200,6 @@ endfunction // Main program entry point .globl _sta...
921e672dee91af86f8f9e44a067c735ebac0744b
Analyze and fix the following issue in the Linux kernel code: cacheinfo: Remove unused check in init_cache_level()
Problem Details: commit e75d18cecbb3 ("arm64: cacheinfo: Fix incorrect assignment of signed error value to unsigned fw_level") checks the fw_level value in init_cache_level() in case the value is negative. Remove this check as the error code is not returned through fw_level anymore, and reset fw_level if acpi_get_cache...
```diff diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c index 91677f4d3395..3ba70985e3a2 100644 --- a/arch/arm64/kernel/cacheinfo.c +++ b/arch/arm64/kernel/cacheinfo.c @@ -67,9 +67,6 @@ int init_cache_level(unsigned int cpu) fw_level = 0; } - if (fw_level < 0) - return fw_level; - ...
ecaef469920fd6d2c7687f19081946f47684a423
Analyze and fix the following issue in the Linux kernel code: cacheinfo: Initialize variables in fetch_cache_info()
Problem Details: Set potentially uninitialized variables to 0. This is particularly relevant when CONFIG_ACPI_PPTT is not set. Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/all/202301052307.JYt1GWaJ-lkp@intel.com/ Reported-by: Dan Carpenter <error27@gmail.com> Link: https://lore.kernel.o...
```diff diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index 418a18acc8f9..f6573c335f4c 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -424,7 +424,7 @@ int allocate_cache_info(int cpu) int fetch_cache_info(unsigned int cpu) { struct cpu_cacheinfo *this_cpu_ci; - unsigned i...
48a9051980242128f844defe44c7e83217f79872
Analyze and fix the following issue in the Linux kernel code: ublk_drv: only allow owner to open unprivileged disk
Problem Details: Owner of one unprivileged ublk device could be one evil user, which can grant this disk's privilege to other users deliberately, and this way could be like making one trap and waiting for other users to be caught. So only owner to open unprivileged disk even though the owner grants disk privilege to o...
```diff diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index a725a236a38f..c932e9ea5a0f 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -377,8 +377,50 @@ static void ublk_free_disk(struct gendisk *disk) put_device(&ub->cdev_dev); } +static void ublk_store_owner_uid_gid(uns...
29baef789c838bd5c02f50c88adbbc6b955aaf61
Analyze and fix the following issue in the Linux kernel code: block: ublk: extending queue_size to fix overflow
Problem Details: When validating drafted SPDK ublk target, in a case that assigning large queue depth to multiqueue ublk device, ublk target would run into a weird incorrect state. During rounds of review and debug, An overflow bug was found in ublk driver. In ublk_cmd.h, UBLK_MAX_QUEUE_DEPTH is 4096 which means each ...
```diff diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index e54693204630..6368b56eacf1 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -137,7 +137,7 @@ struct ublk_device { char *__queues; - unsigned short queue_size; + unsigned int queue_size; struct ublksrv_ctrl_dev...
226fae124b2dac217ea5436060d623ff3385bc34
Analyze and fix the following issue in the Linux kernel code: vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF
Problem Details: After a call to console_unlock() in vcs_read() the vc_data struct can be freed by vc_deallocate(). Because of that, the struct vc_data pointer load must be done at the top of while loop in vcs_read() to avoid a UAF when vcs_size() is called. Syzkaller reported a UAF in vcs_size(). BUG: KASAN: use-aft...
```diff diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index 1850bacdb5b0..f566eb1839dc 100644 --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c @@ -386,10 +386,6 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) uni_mode = use_unicode(inode); attr ...
12cb7a3349a53efa8698a01fe0efdc61d887e541
Analyze and fix the following issue in the Linux kernel code: ARM: dts: dove.dtsi: Move ethphy to fix schema error
Problem Details: Running 'make dtbs_check' with schema in net/marvell,orion-mdio.yaml gives following warnings: mdio-bus@72004: Unevaluated properties are not allowed ('ethernet-phy' was unexpected) arch/arm/boot/dts/dove-cubox.dtb arch/arm/boot/dts/dove-cubox-es.dtb arch/arm/boot/dts/dove-d2plug.dtb arch/arm/boot/...
```diff diff --git a/arch/arm/boot/dts/dove-cm-a510.dtsi b/arch/arm/boot/dts/dove-cm-a510.dtsi index 9b9dfbe07be4..2f2f0a4bf004 100644 --- a/arch/arm/boot/dts/dove-cm-a510.dtsi +++ b/arch/arm/boot/dts/dove-cm-a510.dtsi @@ -124,9 +124,17 @@ }; /* Optional RTL8211D GbE PHY on SMI address 0x03 */ -&ethphy { - reg = <3...
c956940a4ab73a87d0165e911c001dbdd2c8200f
Analyze and fix the following issue in the Linux kernel code: RDMA/umem: Use dma-buf locked API to solve deadlock
Problem Details: The cited commit moves umem to call the unlocked versions of dmabuf unmap/map attachment, but the lock is held while calling to these functions, hence move back to the locked versions of these APIs. Fixes: 21c9c5c0784f ("RDMA/umem: Prepare to dynamic dma-buf locking specification") Link: https://lore....
```diff diff --git a/drivers/infiniband/core/umem_dmabuf.c b/drivers/infiniband/core/umem_dmabuf.c index 43b26bc12288..39357dc2d229 100644 --- a/drivers/infiniband/core/umem_dmabuf.c +++ b/drivers/infiniband/core/umem_dmabuf.c @@ -26,8 +26,8 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf) if (umem...
4d627628d7584f3d3add1d53342d0f01aa878e04
Analyze and fix the following issue in the Linux kernel code: cpuidle: Fix poll_idle() noinstr annotation
Problem Details: The instrumentation_begin()/end() annotations in poll_idle() were complete nonsense. Specifically they caused tracing to happen in the middle of noinstr code, resulting in RCU splats. Now that local_clock() is noinstr, mark up the rest and let it rip. Fixes: 00717eb8c955 ("cpuidle: Annotate poll_idle...
```diff diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 500d1720421e..0b00f21cefe3 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -426,7 +426,7 @@ void cpuidle_reflect(struct cpuidle_device *dev, int index) * @dev: the cpuidle device * */ -u64 cpuidle_poll_tim...
3017ba4b831bc7fd67cc82e744116b6e45e259a4
Analyze and fix the following issue in the Linux kernel code: cpuidle: tracing, preempt: Squash _rcuidle tracing
Problem Details: Extend/fix commit: 9aedeaed6fc6 ("tracing, hardirq: No moar _rcuidle() tracing") ... to also cover trace_preempt_{on,off}() which were mysteriously untouched. Fixes: 9aedeaed6fc6 ("tracing, hardirq: No moar _rcuidle() tracing") Reported-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Peter ...
```diff diff --git a/kernel/trace/trace_preemptirq.c b/kernel/trace/trace_preemptirq.c index f992444a0b1f..e37446f7916e 100644 --- a/kernel/trace/trace_preemptirq.c +++ b/kernel/trace/trace_preemptirq.c @@ -15,10 +15,6 @@ #define CREATE_TRACE_POINTS #include <trace/events/preemptirq.h> -#ifdef CONFIG_TRACE_IRQFLAGS...
5a5d7e9badd2cb8065db171961bd30bd3595e4b6
Analyze and fix the following issue in the Linux kernel code: cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG
Problem Details: In order to avoid WARN/BUG from generating nested or even recursive warnings, force rcu_is_watching() true during WARN/lockdep_rcu_suspicious(). Notably things like unwinding the stack can trigger rcu_dereference() warnings, which then triggers more unwinding which then triggers more warnings etc.. S...
```diff diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index dcef4a9e4d63..d4afa8508a80 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h @@ -130,9 +130,36 @@ static __always_inline unsigned long ct_state_inc(int incby) return arch_atomic_add_return...
393e2ea30aec634b37004d401863428e120d5e1b
Analyze and fix the following issue in the Linux kernel code: cpuidle: drivers: firmware: psci: Dont instrument suspend code
Problem Details: The PSCI suspend code is currently instrumentable, which is not safe as instrumentation (e.g. ftrace) may try to make use of RCU during idle periods when RCU is not watching. To fix this we need to ensure that psci_suspend_finisher() and anything it calls are not instrumented. We can do this fairly si...
```diff diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index aef76d85cacf..29619f49873a 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -108,9 +108,10 @@ bool psci_power_state_is_valid(u32 state) return !(state & ~valid_mask); } -static unsigned long __invo...
918b8f7eeea1c9f7f54b3d8ea74e8c6fa68e5a9d
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: avoid duplicate assignment
Problem Details: With extra warnings enabled, gcc warns about two assignments of the same .mmap callback: In file included from drivers/accel/ivpu/ivpu_drv.c:10: include/drm/drm_accel.h:31:27: error: initialized field overwritten [-Werror=override-init] 31 | .mmap = drm_gem_mmap | ...
```diff diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c index 2bc2f1b90671..a29e8ee0dce6 100644 --- a/drivers/accel/ivpu/ivpu_drv.c +++ b/drivers/accel/ivpu/ivpu_drv.c @@ -356,7 +356,6 @@ int ivpu_shutdown(struct ivpu_device *vdev) static const struct file_operations ivpu_fops = { .owner...
2fe03412e2e1be3d5ab37b8351a37c3aec506556
Analyze and fix the following issue in the Linux kernel code: memblock: Avoid useless checks in memblock_merge_regions().
Problem Details: memblock_merge_regions() is called after regions have been modified to merge the neighboring compatible regions. That will check all regions but most checks are useless. Most of the time we only insert one or a few new regions, or modify one or a few regions. At this time, we don't need to check all t...
```diff diff --git a/mm/memblock.c b/mm/memblock.c index 836eb71ea3ea..22e48b0f57ad 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -500,15 +500,19 @@ static int __init_memblock memblock_double_array(struct memblock_type *type, /** * memblock_merge_regions - merge neighboring compatible regions * @type: memblock...
8bf305087629a98224aa97769587434ea4016767
Analyze and fix the following issue in the Linux kernel code: soc: mediatek: mtk-svs: keep svs alive if CONFIG_DEBUG_FS not supported
Problem Details: Some projects might not support CONFIG_DEBUG_FS but still needs svs to be alive. Therefore, enclose debug cmd codes with CONFIG_DEBUG_FS to make sure svs can be alive when CONFIG_DEBUG_FS not supported. Signed-off-by: Roger Lu <roger.lu@mediatek.com> Link: https://lore.kernel.org/r/20230111074528.2935...
```diff diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index 00526fd37d7b..e55fb16fdc5a 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -138,6 +138,7 @@ static DEFINE_SPINLOCK(svs_lock); +#ifdef CONFIG_DEBUG_FS #define debug_fops_ro(name) \ ...
37fa2aff8fe490771f2229b0f2fcd15796b1bfca
Analyze and fix the following issue in the Linux kernel code: soc: mediatek: mtk-svs: Use pm_runtime_resume_and_get() in svs_init01()
Problem Details: svs_init01() calls pm_runtime_get_sync() and added fail path as svs_init01_finish to put usage_counter. However, pm_runtime_get_sync() will increment usage_counter even it failed. Fix it by replacing it with pm_runtime_resume_and_get() to keep usage counter balanced. Fixes: 681a02e95000 ("soc: mediate...
```diff diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index e0b8aa75c84b..00526fd37d7b 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -1324,7 +1324,7 @@ static int svs_init01(struct svs_platform *svsp) svsb->pm_runtime_enabled_count++; } - ...
f4f8ad204a15d57c1a3e8ea7eca62157b44cbf59
Analyze and fix the following issue in the Linux kernel code: soc: mediatek: mtk-svs: reset svs when svs_resume() fail
Problem Details: Add svs reset when svs_resume() fail. Fixes: a825d72f74a3 ("soc: mediatek: fix missing clk_disable_unprepare() on err in svs_resume()") Signed-off-by: Roger Lu <roger.lu@mediatek.com> Link: https://lore.kernel.org/r/20230111074528.29354-3-roger.lu@mediatek.com Signed-off-by: Matthias Brugger <matthias...
```diff diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index 9859e6cf6b8f..e0b8aa75c84b 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -1614,12 +1614,16 @@ static int svs_resume(struct device *dev) ret = svs_init02(svsp); if (ret) - goto out_of_r...
a0674cd237fc24b08c7dcb4f8e48df3ee769293a
Analyze and fix the following issue in the Linux kernel code: soc: mediatek: mtk-svs: restore default voltages when svs_init02() fail
Problem Details: If svs init02 fail, it means we cannot rely on svs bank voltages anymore. We need to disable svs function and restore DVFS opp voltages back to the default voltages for making sure we have enough DVFS voltages. Fixes: 681a02e95000 ("soc: mediatek: SVS: introduce MTK SVS engine") Fixes: 0bbb09b2af9d ("...
```diff diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index 75b2f534aa9d..9859e6cf6b8f 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -1461,6 +1461,7 @@ static int svs_init02(struct svs_platform *svsp) { struct svs_bank *svsb; unsigned long flags,...
bd0e06f0def75ba26572a94e5350324474a55562
Analyze and fix the following issue in the Linux kernel code: Revert "netfilter: conntrack: fix bug in for_each_sctp_chunk"
Problem Details: There is no bug. If sch->length == 0, this would result in an infinite loop, but first caller, do_basic_checks(), errors out in this case. After this change, packets with bogus zero-length chunks are no longer detected as invalid, so revert & add comment wrt. 0 length check. Fixes: 98ee00774525 ("ne...
```diff diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index 945dd40e7077..011d414038ea 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c @@ -142,10 +142,11 @@ static void sctp_print_conntrack(struct seq_file *s, struct nf_...
2b272bb558f1d3a5aa95ed8a82253786fd1a48ba
Analyze and fix the following issue in the Linux kernel code: netfilter: br_netfilter: disable sabotage_in hook after first suppression
Problem Details: When using a xfrm interface in a bridged setup (the outgoing device is bridged), the incoming packets in the xfrm interface are only tracked in the outgoing direction. $ brctl show bridge name interfaces br_eth1 eth1 $ conntrack -L tcp 115 SYN_SENT src=192... dst=192... [UNREPLIED] ... I...
```diff diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c index f20f4373ff40..9554abcfd5b4 100644 --- a/net/bridge/br_netfilter_hooks.c +++ b/net/bridge/br_netfilter_hooks.c @@ -871,6 +871,7 @@ static unsigned int ip_sabotage_in(void *priv, if (nf_bridge && !nf_bridge->in_prerouting && ...
532a38292c7213aa6d950e6a1b86659d08b5aa67
Analyze and fix the following issue in the Linux kernel code: drivers: Restore alignment and newline in Makefile
Problem Details: The introduction of drivers/accel/ broke alignment, and removed the newline at the end of the file. Fix all of that. Fixes: 35b137630f08 ("accel/ivpu: Introduce a new DRM driver for Intel VPU") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> A...
```diff diff --git a/drivers/Makefile b/drivers/Makefile index f0972e2226c9..9ea6eb3b5d7b 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -189,4 +189,4 @@ obj-$(CONFIG_COUNTER) += counter/ obj-$(CONFIG_MOST) += most/ obj-$(CONFIG_PECI) += peci/ obj-$(CONFIG_HTE) += hte/ -obj-$(CONFIG_DRM_ACCEL) += accel/...
5f82bfced6118450cb9ea3f12316568f6fac10ab
Analyze and fix the following issue in the Linux kernel code: clk: imx6ul: fix enet1 gate configuration
Problem Details: According to the "i.MX 6UltraLite Applications Processor Reference Manual, Rev. 2, 03/2017", BIT(13) is ENET1_125M_EN which is not controlling root of PLL6. It is controlling ENET1 separately. So, instead of this picture (implementation before this patch): fec1 <- enet_ref (divider) <-----------------...
```diff diff --git a/drivers/clk/imx/clk-imx6ul.c b/drivers/clk/imx/clk-imx6ul.c index 67a7a77ca540..c3c465c1b0e7 100644 --- a/drivers/clk/imx/clk-imx6ul.c +++ b/drivers/clk/imx/clk-imx6ul.c @@ -176,7 +176,7 @@ static void __init imx6ul_clocks_init(struct device_node *ccm_node) hws[IMX6UL_CLK_PLL3_USB_OTG] = imx_clk_...
562c65486cf197f28f84283979c076601eb50042
Analyze and fix the following issue in the Linux kernel code: net: dsa: microchip: ptp: fix up PTP dependency
Problem Details: When NET_DSA_MICROCHIP_KSZ_COMMON is built-in but PTP is a loadable module, the ksz_ptp support still causes a link failure: ld.lld-16: error: undefined symbol: ptp_clock_index >>> referenced by ksz_ptp.c >>> drivers/net/dsa/microchip/ksz_ptp.o:(ksz_get_ts_info) in archive vmlinux.a Thi...
```diff diff --git a/drivers/net/dsa/microchip/Kconfig b/drivers/net/dsa/microchip/Kconfig index 0546c573668a..394ca8678d2b 100644 --- a/drivers/net/dsa/microchip/Kconfig +++ b/drivers/net/dsa/microchip/Kconfig @@ -11,7 +11,6 @@ menuconfig NET_DSA_MICROCHIP_KSZ_COMMON config NET_DSA_MICROCHIP_KSZ9477_I2C tristate "K...
2f8c06cb6622b55ebd0092abaa49630b411cb720
Analyze and fix the following issue in the Linux kernel code: drm/i915/guc: Update GT/GuC messages in intel_uc.c
Problem Details: Use new macros to have common prefix that also include GT#. v2: pass gt to print_fw_ver v3: prefer guc_dbg in suspend/resume logs Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Signed-of...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c b/drivers/gpu/drm/i915/gt/uc/intel_uc.c index 9a8a1abf71d7..de7f987cf611 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c @@ -6,11 +6,13 @@ #include <linux/string_helpers.h> #include "gt/intel_gt.h" +#include "g...
f0c4fc416e5ea21cfb8f4b3f8d0955bd5a69b154
Analyze and fix the following issue in the Linux kernel code: drm/i915/guc: Update GuC messages in intel_guc_submission.c
Problem Details: Use new macros to have common prefix that also include GT#. v2: improve few existing messages Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c index 2e6ab0bb5c2b..53f3ed3244d5 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -27,6 +27,7 @@ #include "intel_guc_ads....
357d420ef21258ab7203be1ef31b31cda470f8b9
Analyze and fix the following issue in the Linux kernel code: drm/i915/guc: Update GuC messages in intel_guc_log.c
Problem Details: Use new macros to have common prefix that also include GT#. v2: drop redundant GuC strings, minor improvements v3: more message improvements Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c index 68331c538b0a..c3792ddeec80 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c @@ -12,6 +12,7 @@ #include "i915_memcpy.h" #include "intel_guc_capture....
d8ff10816243a643cf4b77536f13c4138aaec702
Analyze and fix the following issue in the Linux kernel code: drm/i915/guc: Update GuC messages in intel_guc_fw.c
Problem Details: Use new macros to have common prefix that also include GT#. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c index 5b86b2e286e0..3d2249bda368 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c @@ -13,6 +13,7 @@ #include "gt/intel_gt_mcr.h" #include "gt/intel_gt_regs.h...
7388acb253d9222adb30c3e333b64bf993b33b19
Analyze and fix the following issue in the Linux kernel code: drm/i915/guc: Update GuC messages in intel_guc_ct.c
Problem Details: Use new macros to have common prefix that also include GT#. v2: drop unused helpers Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c index 2b22065e87bf..1803a633ed64 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c @@ -11,38 +11,23 @@ #include "i915_drv.h" #include "intel_guc_ct.h" -#inc...
140f9309d25402283024574d33adb504b4c3d78b
Analyze and fix the following issue in the Linux kernel code: drm/i915/guc: Update GuC messages in intel_guc_ads.c
Problem Details: Use new macros to have common prefix that also include GT#. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c index a7f737c4792e..69ce06faf8cd 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c @@ -15,6 +15,7 @@ #include "intel_guc_ads.h" #include "intel_guc_captur...
ecb89c2c4d3a91c874466936152527acc1847aa9
Analyze and fix the following issue in the Linux kernel code: drm/i915/guc: Update GuC messages in intel_guc.c
Problem Details: Use new macros to have common prefix that also include GT#. v2: drop now redundant "GuC" word from the message Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Signed-off-by: Tvrtko Ursuli...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c index 1bccc175f9e6..d76508fa3af7 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c @@ -11,6 +11,7 @@ #include "intel_guc.h" #include "intel_guc_ads.h" #include "intel_gu...
697c3892d825fb78f42ec8e53bed065dd728db3e
Analyze and fix the following issue in the Linux kernel code: regmap: apply reg_base and reg_downshift for single register ops
Problem Details: reg_base and reg_downshift currently don't have any effect if used with a regmap_bus or regmap_config which only offers single register operations (ie. reg_read, reg_write and optionally reg_update_bits). Fix that and take them into account also for regmap_bus with only reg_read and read_write operati...
```diff diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index d12d669157f2..d2a54eb0efd9 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1942,6 +1942,8 @@ static int _regmap_bus_reg_write(void *context, unsigned int reg, { struct regmap *map = context; + re...
3dca1f89ae3455963d7b53245ecf298ea9bae857
Analyze and fix the following issue in the Linux kernel code: soundwire: bus_type: Avoid lockdep assert in sdw_drv_probe()
Problem Details: Don't hold sdw_dev_lock while calling the peripheral driver probe() and remove() callbacks. Holding sdw_dev_lock around the probe() and remove() calls causes a theoretical mutex inversion which lockdep will assert on. During probe() the sdw_dev_lock mutex is taken first and then ASoC/ALSA locks are t...
```diff diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c index 04b3529f8929..963498db0fd2 100644 --- a/drivers/soundwire/bus_type.c +++ b/drivers/soundwire/bus_type.c @@ -105,20 +105,19 @@ static int sdw_drv_probe(struct device *dev) if (ret) return ret; - mutex_lock(&slave->sdw_dev_lock)...
e6acaf25cba14661211bb72181c35dd13b24f5b3
Analyze and fix the following issue in the Linux kernel code: firmware: coreboot: framebuffer: Ignore reserved pixel color bits
Problem Details: The coreboot framebuffer doesn't support transparency, its 'reserved' bit field is merely padding for byte/word alignment of pixel colors [1]. When trying to match the framebuffer to a simplefb format, the kernel driver unnecessarily requires the format's transparency bit field to exactly match this pa...
```diff diff --git a/drivers/firmware/google/framebuffer-coreboot.c b/drivers/firmware/google/framebuffer-coreboot.c index c6dcc1ef93ac..c323a818805c 100644 --- a/drivers/firmware/google/framebuffer-coreboot.c +++ b/drivers/firmware/google/framebuffer-coreboot.c @@ -43,9 +43,7 @@ static int framebuffer_probe(struct cor...
31d5f93454f2efb7152a70fb736afa858aafc6ae
Analyze and fix the following issue in the Linux kernel code: drivers: misc: ti-st: Fix a typo ("unknow")
Problem Details: Spell it as "unknown". Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Link: https://lore.kernel.org/r/20230129161942.1627267-1-j.neuschaefer@gmx.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index 7f6976a9f508..01d2257deea4 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c @@ -338,7 +338,7 @@ void st_int_recv(void *disc_data, ptr++; count--; continue; - /* Unknow packet? */ + /* Unkno...
9d2c7203ffdb846399b82b0660563c89e918c751
Analyze and fix the following issue in the Linux kernel code: x86/debug: Fix stack recursion caused by wrongly ordered DR7 accesses
Problem Details: In kernels compiled with CONFIG_PARAVIRT=n, the compiler re-orders the DR7 read in exc_nmi() to happen before the call to sev_es_ist_enter(). This is problematic when running as an SEV-ES guest because in this environment the DR7 read might cause a #VC exception, and taking #VC exceptions is not safe ...
```diff diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h index b049d950612f..ca97442e8d49 100644 --- a/arch/x86/include/asm/debugreg.h +++ b/arch/x86/include/asm/debugreg.h @@ -39,7 +39,20 @@ static __always_inline unsigned long native_get_debugreg(int regno) asm("mov %%db6, %0" :"=r" (...