id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
1921044eebf1d6861a6de1a76e3f63729a45e712
Analyze and fix the following issue in the Linux kernel code: lib/kstrtox: fix kstrtobool() docstring to mention enabled/disabled
Problem Details: Commit ae5b3500856f ("kstrtox: add support for enabled and disabled in kstrtobool()") added support for 'e'/'E' (enabled) and 'd'/'D' (disabled) inputs, but did not update the docstring accordingly. Update the docstring to include 'Ee' (for true) and 'Dd' (for false) in the list of accepted first char...
```diff diff --git a/lib/kstrtox.c b/lib/kstrtox.c index bdde40cd69d7..97be2a39f537 100644 --- a/lib/kstrtox.c +++ b/lib/kstrtox.c @@ -340,8 +340,8 @@ EXPORT_SYMBOL(kstrtos8); * @s: input string * @res: result * - * This routine returns 0 iff the first character is one of 'YyTt1NnFf0', or - * [oO][NnFf] for "on" ...
c243413740b39b0cf0a88732de5efc2b45716d81
Analyze and fix the following issue in the Linux kernel code: kfifo: fix kmalloc_array_node() argument order
Problem Details: To be consistent, pass the kmalloc_array_node() parameters in the order (number_of_elements, element_size). Since only the product of the two values is used, this is not a bug fix. Link: https://lkml.kernel.org/r/20251220054541.2295599-1-rdunlap@infradead.org Closes: https://bugzilla.kernel.org/show_...
```diff diff --git a/lib/kfifo.c b/lib/kfifo.c index 525e66f8294c..2633f9cc336c 100644 --- a/lib/kfifo.c +++ b/lib/kfifo.c @@ -41,7 +41,7 @@ int __kfifo_alloc_node(struct __kfifo *fifo, unsigned int size, return -EINVAL; } - fifo->data = kmalloc_array_node(esize, size, gfp_mask, node); + fifo->data = kmalloc_arr...
bd58782995a2e6a07fd07255f3cc319f40b131c9
Analyze and fix the following issue in the Linux kernel code: vmcoreinfo: make hwerr_data visible for debugging
Problem Details: If the kernel is compiled with LTO, hwerr_data symbol might be lost, and vmcoreinfo doesn't have it dumped. This is currently seen in some production kernels with LTO enabled. Remove the static qualifier from hwerr_data so that the information is still preserved when the kernel is built with LTO. Ma...
```diff diff --git a/kernel/vmcore_info.c b/kernel/vmcore_info.c index fe9bf8db1922..e2784038bbed 100644 --- a/kernel/vmcore_info.c +++ b/kernel/vmcore_info.c @@ -36,7 +36,11 @@ struct hwerr_info { time64_t timestamp; }; -static struct hwerr_info hwerr_data[HWERR_RECOV_MAX]; +/* + * The hwerr_data[] array is decla...
12b2285bf3d14372238d36215b73af02ac3bdfc1
Analyze and fix the following issue in the Linux kernel code: mm/zone_device: reinitialize large zone device private folios
Problem Details: Reinitialize metadata for large zone device private folios in zone_device_page_init prior to creating a higher-order zone device private folio. This step is necessary when the folio's order changes dynamically between zone_device_page_init calls to avoid building a corrupt folio. As part of the metad...
```diff diff --git a/arch/powerpc/kvm/book3s_hv_uvmem.c b/arch/powerpc/kvm/book3s_hv_uvmem.c index e5000bef90f2..7cf9310de0ec 100644 --- a/arch/powerpc/kvm/book3s_hv_uvmem.c +++ b/arch/powerpc/kvm/book3s_hv_uvmem.c @@ -723,7 +723,7 @@ static struct page *kvmppc_uvmem_get_page(unsigned long gpa, struct kvm *kvm) dpa...
cbbbf7795fc35a740e1d09f3a55aba543b72a8d3
Analyze and fix the following issue in the Linux kernel code: mm/mm_init: don't cond_resched() in deferred_init_memmap_chunk() if called from deferred_grow_zone()
Problem Details: Commit 3acb913c9d5b ("mm/mm_init: use deferred_init_memmap_chunk() in deferred_grow_zone()") made deferred_grow_zone() call deferred_init_memmap_chunk() within a pgdat_resize_lock() critical section with irqs disabled. It did check for irqs_disabled() in deferred_init_memmap_chunk() to avoid calling c...
```diff diff --git a/mm/mm_init.c b/mm/mm_init.c index fc2a6f1e518f..2a809cd8e7fa 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -2059,7 +2059,7 @@ static unsigned long __init deferred_init_pages(struct zone *zone, */ static unsigned long __init deferred_init_memmap_chunk(unsigned long start_pfn, unsigned long end...
870ff19251bf3910dda7a7245da826924045fedd
Analyze and fix the following issue in the Linux kernel code: mm/kfence: randomize the freelist on initialization
Problem Details: Randomize the KFENCE freelist during pool initialization to make allocation patterns less predictable. This is achieved by shuffling the order in which metadata objects are added to the freelist using get_random_u32_below(). Additionally, ensure the error path correctly calculates the address range t...
```diff diff --git a/mm/kfence/core.c b/mm/kfence/core.c index da0f5b6f5744..4f79ec720752 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -596,7 +596,7 @@ static void rcu_guarded_free(struct rcu_head *h) static unsigned long kfence_init_pool(void) { unsigned long addr, start_pfn; - int i; + int i, rand; ...
e86436ad0ad2a9aaf88802d69b68f02cbd1f04a9
Analyze and fix the following issue in the Linux kernel code: kho: init alloc tags when restoring pages from reserved memory
Problem Details: Memblock pages (including reserved memory) should have their allocation tags initialized to CODETAG_EMPTY via clear_page_tag_ref() before being released to the page allocator. When kho restores pages through kho_restore_page(), missing this call causes mismatched allocation/deallocation tracking and b...
```diff diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c index d4482b6e3cae..96767b106cac 100644 --- a/kernel/liveupdate/kexec_handover.c +++ b/kernel/liveupdate/kexec_handover.c @@ -255,6 +255,14 @@ static struct page *kho_restore_page(phys_addr_t phys, bool is_folio) if (is_folio...
c657c5dc1360fa1ed1b090aedb5883d9cf9f0a0f
Analyze and fix the following issue in the Linux kernel code: mm: memfd_luo: restore and free memfd_luo_ser on failure
Problem Details: memfd_luo_ser has the serialization metadata. It is of no use once restoration fails. Free it on failure. Link: https://lkml.kernel.org/r/20260122151842.4069702-4-pratyush@kernel.org Fixes: b3749f174d68 ("mm: memfd_luo: allow preserving memfd") Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel...
```diff diff --git a/mm/memfd_luo.c b/mm/memfd_luo.c index 01a72e4d3ef6..a34fccc23b6a 100644 --- a/mm/memfd_luo.c +++ b/mm/memfd_luo.c @@ -447,7 +447,8 @@ static int memfd_luo_retrieve(struct liveupdate_file_op_args *args) file = memfd_alloc_file("", 0); if (IS_ERR(file)) { pr_err("failed to setup file: %pe\n", ...
02e117b8ca58928f193e5b4df48d6763232f5e91
Analyze and fix the following issue in the Linux kernel code: mm: memfd_luo: use memfd_alloc_file() instead of shmem_file_setup()
Problem Details: When restoring a memfd, the file is created using shmem_file_setup(). While memfd creation also calls this function to get the file, it also does other things: 1. The O_LARGEFILE flag is set on the file. If this is not done, writes on the memfd exceeding 2 GiB fail. 2. FMODE_LSEEK, FMODE_PREAD...
```diff diff --git a/mm/memfd_luo.c b/mm/memfd_luo.c index 4f6ba63b4310..01a72e4d3ef6 100644 --- a/mm/memfd_luo.c +++ b/mm/memfd_luo.c @@ -78,6 +78,7 @@ #include <linux/liveupdate.h> #include <linux/shmem_fs.h> #include <linux/vmalloc.h> +#include <linux/memfd.h> #include "internal.h" static int memfd_luo_preser...
71e2b5eadbad43d33f0e2cf6d767395273ba5eaa
Analyze and fix the following issue in the Linux kernel code: memfd: export alloc_file()
Problem Details: Patch series "mm: memfd_luo hotfixes". This series contains a couple of fixes for memfd preservation using LUO. This patch (of 3): The Live Update Orchestrator's (LUO) memfd preservation works by preserving all the folios of a memfd, re-creating an empty memfd on the next boot, and then inserting b...
```diff diff --git a/include/linux/memfd.h b/include/linux/memfd.h index cc74de3dbcfe..c328a7b356d0 100644 --- a/include/linux/memfd.h +++ b/include/linux/memfd.h @@ -17,6 +17,7 @@ struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx); * to by vm_flags_ptr. */ int memfd_check_seals_mmap(struct file *fil...
dd9e2f5b38f1fdd49b1ab6d3a85f81c14369eacc
Analyze and fix the following issue in the Linux kernel code: flex_proportions: make fprop_new_period() hardirq safe
Problem Details: Bernd has reported a lockdep splat from flexible proportions code that is essentially complaining about the following race: <timer fires> run_timer_softirq - we are in softirq context call_timer_fn writeout_period fprop_new_period write_seqcount_begin(&p->sequence); <hardi...
```diff diff --git a/lib/flex_proportions.c b/lib/flex_proportions.c index 84ecccddc771..012d5614efb9 100644 --- a/lib/flex_proportions.c +++ b/lib/flex_proportions.c @@ -64,13 +64,14 @@ void fprop_global_destroy(struct fprop_global *p) bool fprop_new_period(struct fprop_global *p, int periods) { s64 events = percp...
a148a2040191b12b45b82cb29c281cb3036baf90
Analyze and fix the following issue in the Linux kernel code: mm/memory-failure: fix missing ->mf_stats count in hugetlb poison
Problem Details: When a newly poisoned subpage ends up in an already poisoned hugetlb folio, 'num_poisoned_pages' is incremented, but the per node ->mf_stats is not. Fix the inconsistency by designating action_result() to update them both. While at it, define __get_huge_page_for_hwpoison() return values in terms of s...
```diff diff --git a/mm/memory-failure.c b/mm/memory-failure.c index c80c2907da33..473204359e1f 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1883,12 +1883,22 @@ static unsigned long __folio_free_raw_hwp(struct folio *folio, bool move_flag) return count; } -static int folio_set_hugetlb_hwpoison(st...
a0f3c0845a4ff68d403c568266d17e9cc553e561
Analyze and fix the following issue in the Linux kernel code: mm, swap: restore swap_space attr aviod kernel panic
Problem Details: commit 8b47299a411a ("mm, swap: mark swap address space ro and add context debug check") made the swap address space read-only. It may lead to kernel panic if arch_prepare_to_swap returns a failure under heavy memory pressure as follows, el1_abort+0x40/0x64 el1h_64_sync_handler+0x48/0xcc el1h_64_sync...
```diff diff --git a/mm/swap.h b/mm/swap.h index d034c13d8dd2..1bd466da3039 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -198,7 +198,7 @@ int swap_writeout(struct folio *folio, struct swap_iocb **swap_plug); void __swap_writepage(struct folio *folio, struct swap_iocb **swap_plug); /* linux/mm/swap_state.c */ -extern s...
9b47d4eea3f7c1f620e95bda1d6221660bde7d7b
Analyze and fix the following issue in the Linux kernel code: mm/kasan: fix KASAN poisoning in vrealloc()
Problem Details: A KASAN warning can be triggered when vrealloc() changes the requested size to a value that is not aligned to KASAN_GRANULE_SIZE. ------------[ cut here ]------------ WARNING: CPU: 2 PID: 1 at mm/kasan/shadow.c:174 kasan_unpoison+0x40/0x48 ... pc : kasan_unpoison+0x40/0x48 lr : __k...
```diff diff --git a/include/linux/kasan.h b/include/linux/kasan.h index 9c6ac4b62eb9..338a1921a50a 100644 --- a/include/linux/kasan.h +++ b/include/linux/kasan.h @@ -641,6 +641,17 @@ kasan_unpoison_vmap_areas(struct vm_struct **vms, int nr_vms, __kasan_unpoison_vmap_areas(vms, nr_vms, flags); } +void __kasan_vre...
8a1968bd997f45a9b11aefeabdd1232e1b6c7184
Analyze and fix the following issue in the Linux kernel code: mm/shmem, swap: fix race of truncate and swap entry split
Problem Details: The helper for shmem swap freeing is not handling the order of swap entries correctly. It uses xa_cmpxchg_irq to erase the swap entry, but it gets the entry order before that using xa_get_order without lock protection, and it may get an outdated order value if the entry is split or changed in other wa...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index ec6c01378e9d..6c3485d24d66 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -962,17 +962,29 @@ static void shmem_delete_from_page_cache(struct folio *folio, void *radswap) * being freed). */ static long shmem_free_swap(struct address_space *mapping, - pgoff_t ind...
252cf8c4d679fc40cdb934da6c5128e5943fec3f
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to show simulate_lock_timeout correctly
Problem Details: Commit d36de29f4bb5 ("f2fs: sysfs: introduce inject_lock_timeout") introduces a bug as below, fix it. cat /sys/fs/f2fs/vdx/inject_lock_timeout s/fs/f2fs/vdx/inject_lock_timeout: Invalid argument Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index cd22bfe75c45..d01a2664a250 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -86,7 +86,8 @@ static unsigned char *__struct_ptr(struct f2fs_sb_info *sbi, int struct_type) return (unsigned char *)sbi; #ifdef CONFIG_F2FS_FAULT_INJECTION else if (struct...
a16ac6ca46d62bcbcbd7b01be0ef03fb39530d7b
Analyze and fix the following issue in the Linux kernel code: m68knommu: Replace deprecated strcpy with strscpy in init_ucsimm
Problem Details: strcpy() has been deprecated [1] because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. Replace it with the safer strscpy(). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] Signed-off-by: Thorsten Blum <thorsten.blum@linux....
```diff diff --git a/arch/m68k/68000/ucsimm.c b/arch/m68k/68000/ucsimm.c index c54fde75eae8..6b84e826040f 100644 --- a/arch/m68k/68000/ucsimm.c +++ b/arch/m68k/68000/ucsimm.c @@ -9,6 +9,7 @@ * for more details. */ #include <linux/init.h> +#include <linux/string.h> #include <asm/bootstd.h> #include <asm/machdep.h...
590fe2f46c8698bb758f9002cb247ca10ce95569
Analyze and fix the following issue in the Linux kernel code: m68k: nommu: fix memmove() with differently aligned src and dest for 68000
Problem Details: 68000 has different alignment needs to 68020+. memcpy() checks if the destination is aligned and does a smaller copy to fix the alignment and then critically for 68000 it checks if the source is still unaligned and if it is reverts to smaller copies. memmove() does not currently do the second part and...
```diff diff --git a/arch/m68k/lib/memmove.c b/arch/m68k/lib/memmove.c index 6519f7f349f6..e33f00b02e4c 100644 --- a/arch/m68k/lib/memmove.c +++ b/arch/m68k/lib/memmove.c @@ -24,6 +24,15 @@ void *memmove(void *dest, const void *src, size_t n) src = csrc; n--; } +#if defined(CONFIG_M68000) + if ((long)src & ...
c16dd9eb0b58c0cabf955592a072c2022804c7e8
Analyze and fix the following issue in the Linux kernel code: m68k: defconfig: Clean up references to non-existing configs
Problem Details: - Drop 'CONFIG_I2C_COMPAT is not set' (removed in commit 7e722083fcc3 ("i2c: Remove I2C_COMPAT config symbol and related code")) - Drop 'CONFIG_SCHED_DEBUG is not set' (removed in commit b52173065e0a ("sched/debug: Remove CONFIG_SCHED_DEBUG")) Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redh...
```diff diff --git a/arch/m68k/configs/amcore_defconfig b/arch/m68k/configs/amcore_defconfig index 88832e9cd7cb..f310b5dacfd8 100644 --- a/arch/m68k/configs/amcore_defconfig +++ b/arch/m68k/configs/amcore_defconfig @@ -61,7 +61,6 @@ CONFIG_SERIAL_MCF_BAUDRATE=115200 CONFIG_SERIAL_MCF_CONSOLE=y # CONFIG_HW_RANDOM is n...
3da35aa8af345abf6cd180cfc0538c753b927a18
Analyze and fix the following issue in the Linux kernel code: net: include <linux/hex.h> from sysctl_net_core.c
Problem Details: Needed for hex_byte_pack(). x86_64 was already including it, but some arches were not. Fixes: 37b0ea8fef56 ("net: expand NETDEV_RSS_KEY_LEN to 256 bytes") Reported-by: Mark Brown <broonie@kernel.org> Closes: https://lore.kernel.org/netdev/aXeka0KYBnrkwUcF@sirena.org.uk/ Signed-off-by: Eric Dumazet <e...
```diff diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 0f761d4b9447..03aea10073f0 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c @@ -17,6 +17,7 @@ #include <linux/init.h> #include <linux/slab.h> #include <linux/sched/isolation.h> +#include <linux/hex.h> #inclu...
60bfb8baf8f0d5b0d521744dfd01c880ce1a23f3
Analyze and fix the following issue in the Linux kernel code: drm/xe: Unregister drm device on probe error
Problem Details: Call drm_dev_unregister() when xe_device_probe() fails after successful drm_dev_register(). This ensures the DRM device is promptly unregistered before returning an error, avoiding leaving it registered on the failure path. Otherwise, there is warn message if xe_device_probe() is called again: " [ 207...
```diff diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index aad4aa53a51f..7c2f8b783c56 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -1017,6 +1017,7 @@ int xe_device_probe(struct xe_device *xe) err_unregister_display: xe_display_unregister(xe); +...
0550069cc25f513ce1f109c88f7c1f01d63297db
Analyze and fix the following issue in the Linux kernel code: tracing: Properly process error handling in event_hist_trigger_parse()
Problem Details: Memory allocated with trigger_data_alloc() requires trigger_data_free() for proper cleanup. Replace kfree() with trigger_data_free() to fix this. Found via static analysis and code review. This isn't a real bug due to the current code basically being an open coded version of trigger_data_free() with...
```diff diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index c97bb2fda5c0..7e50df8b800b 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -6911,7 +6911,7 @@ static int event_hist_trigger_parse(struct event_command *cmd_ops, remove_hist_vars(his...
801a6e61f5fbab2c0dd76c8360f45b625b49e410
Analyze and fix the following issue in the Linux kernel code: drm/xe/ptl: Disable DCC on PTL
Problem Details: On PTL, the recommendation is to disable DCC(Duty Cycle Control) as it may cause some regressions due to added latencies. Upcoming GuC releases will disable DCC on PTL as well, but we need to force it in KMD so that this behavior is propagated to older kernels. v2: Update commit message (Rodrigo) v3: ...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c index 54702a0fd05b..5e5495a39a3c 100644 --- a/drivers/gpu/drm/xe/xe_guc_pc.c +++ b/drivers/gpu/drm/xe/xe_guc_pc.c @@ -1198,6 +1198,36 @@ int xe_guc_pc_set_power_profile(struct xe_guc_pc *pc, const char *buf) return ret; } +static ...
d39fb5ca7207a2a8824639b4fada20811d3f2bdf
Analyze and fix the following issue in the Linux kernel code: drm/xe: Reduce LRC timestamp stuck message on VFs to notice
Problem Details: An LRC timestamp getting stuck is a somewhat normal occurrence. If a single VF submits a job that does not get timesliced, the LRC timestamp will not increment. Reduce the LRC timestamp stuck message on VFs to notice (same log level as job timeout) to avoid false CI bugs in tests where a VF submits a j...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index a27ea931b956..1b2f66f4425b 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -1317,9 +1317,14 @@ static bool check_timeout(struct xe_exec_queue *q, struct xe_sched_job *job) c...
546e9289c74f606423ef72075b34cc38eda3bb49
Analyze and fix the following issue in the Linux kernel code: vdso/gettimeofday: Force inlining of __cvdso_clock_getres_common()
Problem Details: With CONFIG_CC_OPTIMIZE_FOR_SIZE=y, GCC may decide not to inline __cvdso_clock_getres_common(). This introduces spurious internal function calls in the vDSO fastpath. Furthermore, with automatic stack variable initialization (CONFIG_INIT_STACK_ALL_ZERO or CONFIG_INIT_STACK_ALL_PATTERN) GCC can emit a ...
```diff diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c index 95df0153f05a..4399e143d43a 100644 --- a/lib/vdso/gettimeofday.c +++ b/lib/vdso/gettimeofday.c @@ -421,7 +421,7 @@ static __maybe_unused __kernel_old_time_t __cvdso_time(__kernel_old_time_t *time #endif /* VDSO_HAS_TIME */ #ifdef VDSO_HAS_C...
40ee63f5df2d5c6471b583df800aac89dc0502a4
Analyze and fix the following issue in the Linux kernel code: drm/xe/ptl: Disable DCC on PTL
Problem Details: On PTL, the recommendation is to disable DCC(Duty Cycle Control) as it may cause some regressions due to added latencies. Upcoming GuC releases will disable DCC on PTL as well, but we need to force it in KMD so that this behavior is propagated to older kernels. v2: Update commit message (Rodrigo) v3: ...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c index 54702a0fd05b..5e5495a39a3c 100644 --- a/drivers/gpu/drm/xe/xe_guc_pc.c +++ b/drivers/gpu/drm/xe/xe_guc_pc.c @@ -1198,6 +1198,36 @@ int xe_guc_pc_set_power_profile(struct xe_guc_pc *pc, const char *buf) return ret; } +static ...
233ccfe911aa62c0f9211f2e3297d6a7f870b295
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: rt1320-sdw: Refactor to reduce stack frames
Problem Details: Compiler is not happy about used stack frames in a couple of functions: sound/soc/codecs/rt1320-sdw.c: In function 'rt1320_rae_load': sound/soc/codecs/rt1320-sdw.c:1570:1: error: the frame size of 1336 bytes is larger than 1280 bytes [-Werror=frame-larger-than=] sound/soc/codecs/rt1320-sdw.c: In funct...
```diff diff --git a/sound/soc/codecs/rt1320-sdw.c b/sound/soc/codecs/rt1320-sdw.c index e37b4cb87fbe..3ad51db23dea 100644 --- a/sound/soc/codecs/rt1320-sdw.c +++ b/sound/soc/codecs/rt1320-sdw.c @@ -1429,8 +1429,7 @@ static int rt1320_rae_load(struct rt1320_sdw_priv *rt1320) unsigned int addr, size; unsigned int fu...
76b2cf07a6d2a836108f9c2486d76599f7adf6e8
Analyze and fix the following issue in the Linux kernel code: perf vendor events amd: Fix Zen 5 MAB allocation events
Problem Details: The unit masks for PMCx041 vary across different generations of Zen processors. Fix the Zen 5 events based on PMCx041 as they incorrectly use the same unit masks as that of Zen 4. Fixes: 45c072f2537ab07b ("perf vendor events amd: Add Zen 5 core events") Reported-by: Suyash Mahar <smahar@meta.com> Rev...
```diff diff --git a/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json b/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json index ff6627a77805..06bbaea15925 100644 --- a/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json +++ b/tools/perf/pmu-events/arch/x86/amdzen5/load-store.json @@ -70,19 +70,19 @@ ...
008603bda19b29687edce533e4c09acff68c1077
Analyze and fix the following issue in the Linux kernel code: perf test: Fix test perf evlist for z/VM s390x
Problem Details: Perf test case 'perf evlist tests' fails on z/VM machines on s390. The failure is causes by event cycles. This event is not available on virtualized machines like z/VM on s390. Change to software event cpu-clock to fix this. Output before: # ./perf test 78 79: perf evlist tests ...
```diff diff --git a/tools/perf/tests/shell/evlist.sh b/tools/perf/tests/shell/evlist.sh index 5632be391710..8a22f4171c07 100755 --- a/tools/perf/tests/shell/evlist.sh +++ b/tools/perf/tests/shell/evlist.sh @@ -21,13 +21,13 @@ trap trap_cleanup EXIT TERM INT test_evlist_simple() { echo "Simple evlist test" - if ! ...
dda5f926a1006c735b00ed5c27291fce64236656
Analyze and fix the following issue in the Linux kernel code: perf annotate: Fix BUILD_NONDISTRO=1 missing args->ms conversions to pointer
Problem Details: Fix a few missing conversions to pointer in the usage of 'struct annotate_args' 'ms' member in symbol__disassemble_bpf_libbfd(). Fixes: 00419892bac28bf1 ("perf annotate: Fix args leak of map_symbol") Reviewed-by: Ian Rogers <irogers@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
```diff diff --git a/tools/perf/util/libbfd.c b/tools/perf/util/libbfd.c index 79f4528234a9..63ea3fb53e77 100644 --- a/tools/perf/util/libbfd.c +++ b/tools/perf/util/libbfd.c @@ -501,7 +501,7 @@ int symbol__disassemble_bpf_libbfd(struct symbol *sym __maybe_unused, struct bpf_prog_info_node *info_node; int len = sym...
129bb23a6f7d022610f902b57d36d69d7d210128
Analyze and fix the following issue in the Linux kernel code: Revert "perf tools: Fix arm64 build by generating unistd_64.h"
Problem Details: This reverts: commit 8988c4b91945173a ("perf tools: Fix in-source libperf build") commit bfb713ea53c746b0 ("perf tools: Fix arm64 build by generating unistd_64.h") Since we now have a static unistd_64.h for the arm64 build, there is no need to generate unistd_64.h in libperf. Revert all patches rela...
```diff diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile index 27e6490f64dc..9692d0742ed0 100644 --- a/tools/lib/perf/Makefile +++ b/tools/lib/perf/Makefile @@ -42,7 +42,6 @@ libdir_relative_SQ = $(subst ','\'',$(libdir_relative)) TEST_ARGS := $(if $(V),-v) INCLUDES = \ --I$(OUTPUT)arch/$(SRCARCH)/inc...
096b86ce08332fbcb0ec6ff6714c44899ec03970
Analyze and fix the following issue in the Linux kernel code: tools headers: Go back to include asm-generic/unistd.h for arm64
Problem Details: The header unistd.h is included under Arm64's uAPI folder (see tools/arch/arm64/include/uapi/asm/), but it does not include its dependent header unistd_64.h. The intention is for unistd_64.h to be generated dynamically using scripts/Makefile.asm-headers. However, this dynamic approach causes problems...
```diff diff --git a/tools/arch/arm64/include/uapi/asm/unistd.h b/tools/arch/arm64/include/uapi/asm/unistd.h index df36f23876e8..9306726337fe 100644 --- a/tools/arch/arm64/include/uapi/asm/unistd.h +++ b/tools/arch/arm64/include/uapi/asm/unistd.h @@ -1,2 +1,24 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-...
9502b7df5a3c7e174f74f20324ac1fe781fc5c2d
Analyze and fix the following issue in the Linux kernel code: ASoC: amd: yc: Add DMI quirk for Acer TravelMate P216-41-TCO
Problem Details: Add a DMI quirk for the Acer TravelMate P216-41-TCO fixing the issue where the internal microphone was not detected. Link: https://bugzilla.kernel.org/show_bug.cgi?id=220983 Cc: stable@vger.kernel.org Signed-off-by: Zhang Heng <zhangheng@kylinos.cn> Link: https://patch.msgid.link/20260126014952.367445...
```diff diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c index f801ce4741ff..c18da0915baa 100644 --- a/sound/soc/amd/yc/acp6x-mach.c +++ b/sound/soc/amd/yc/acp6x-mach.c @@ -682,6 +682,14 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "GOH-X"), ...
474d54095090be8ea8701d4a16476f488aa06959
Analyze and fix the following issue in the Linux kernel code: drm/display: bridge_connector: move audio_infoframe checks to OP_HDMI
Problem Details: There are DRM_BRIDGE_OP_HDMI_AUDIO bridges (e.g. Lontium LT9611UXC) which don't implement DRM_BRIDGE_OP_HDMI and don't implement hdmi_clear_audio_infoframe / hdmi_write_audio_infoframe callbacks. Move corresponding checks under the DRM_BRIDGE_OP_HDMI condition, making sure that we require those callba...
```diff diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c index ba8ff113cff1..258132c6b8b5 100644 --- a/drivers/gpu/drm/display/drm_bridge_connector.c +++ b/drivers/gpu/drm/display/drm_bridge_connector.c @@ -851,6 +851,11 @@ struct drm_connector *drm_bridge_con...
7e90360e6d4599795b6f4e094e20d0bdf3b2615f
Analyze and fix the following issue in the Linux kernel code: PCI: Fix bridge window alignment with optional resources
Problem Details: pbus_size_mem() has two alignments, one for required resources in min_align and another in add_align that takes account optional resources. The add_align is applied to the bridge window through the realloc_head list. It can happen, however, that add_align is larger than min_align but calculated size1 ...
```diff diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 6e90f46f52af..4b918ff4d2d8 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -14,6 +14,7 @@ * tighter packing. Prefetchable range support. */ +#include <linux/align.h> #include <linux/bitops.h> #include <linux/...
d935187cfb27fc4168f78f3959aef4eafaae76bb
Analyze and fix the following issue in the Linux kernel code: remoteproc: mediatek: Break lock dependency to `prepare_lock`
Problem Details: A potential circular locking dependency (ABBA deadlock) exists between `ec_dev->lock` and the clock framework's `prepare_lock`. The first order (A -> B) occurs when scp_ipi_send() is called while `ec_dev->lock` is held (e.g., within cros_ec_cmd_xfer()): 1. cros_ec_cmd_xfer() acquires `ec_dev->lock` an...
```diff diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 328541e62158..4651311aeb07 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -283,7 +283,7 @@ static irqreturn_t scp_irq_handler(int irq, void *priv) struct mtk_scp *scp = priv; int ret; - ret = cl...
4796eaafd6a170db012395a40385d2baf4f4d118
Analyze and fix the following issue in the Linux kernel code: nvmem: an8855: drop an unused Kconfig symbol
Problem Details: MFD_AIROHA_AN8855 is referenced here but never defined, so drop it from the Kconfig file. Fixes: e2258cfd9b98 ("nvmem: an8855: Add support for Airoha AN8855 Switch EFUSE") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Srinivas Kandagatla <srini@kernel.org> Link: https://patch.msgi...
```diff diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index bf47a982cf62..74ddbd0f79b0 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -30,7 +30,7 @@ source "drivers/nvmem/layouts/Kconfig" config NVMEM_AN8855_EFUSE tristate "Airoha AN8855 eFuse support" - depends on MFD_AIROHA_AN8855...
f397bc0781553d01b4cdba506c09334a31cb0ec5
Analyze and fix the following issue in the Linux kernel code: nvmem: Drop OF node reference on nvmem_add_one_cell() failure
Problem Details: If nvmem_add_one_cell() failed, the ownership of "child" (or "info.np"), thus its OF reference, is not passed further and function should clean up by putting the reference it got via earlier of_node_get(). Note that this is independent of references obtained via for_each_child_of_node() loop. Fixes: ...
```diff diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 387c88c55259..ff68fd5ad3d6 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -831,6 +831,7 @@ static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_nod kfree(info.name); if (ret) { of_node_put(child); +...
1769f90e5ba2a6d24bb46b85da33fe861c68f005
Analyze and fix the following issue in the Linux kernel code: binder: fix BR_FROZEN_REPLY error log
Problem Details: The error logging for failed transactions is misleading as it always reports "dead process or thread" even when the target is actually frozen. Additionally, the pid and tid are reversed which can further confuse debugging efforts. Fix both issues. Cc: stable@kernel.org Cc: Steven Moreland <smoreland@g...
```diff diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 4e16438eceb7..b356c9b88254 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -3824,8 +3824,9 @@ static void binder_transaction(struct binder_proc *proc, return; err_dead_proc_or_thread: - binder_txn_error("%d:%d de...
d047248190d86a52164656d47bec9bfba61dc71e
Analyze and fix the following issue in the Linux kernel code: rust_binder: add additional alignment checks
Problem Details: This adds some alignment checks to match C Binder more closely. This causes the driver to reject more transactions. I don't think any of the transactions in question are harmful, but it's still a bug because it's the wrong uapi to accept them. The cases where usize is changed for u64, it will affect o...
```diff diff --git a/drivers/android/binder/thread.rs b/drivers/android/binder/thread.rs index dcd47e10aeb8..e0ea33ccfe58 100644 --- a/drivers/android/binder/thread.rs +++ b/drivers/android/binder/thread.rs @@ -39,6 +39,10 @@ use core::{ sync::atomic::{AtomicU32, Ordering}, }; +fn is_aligned(value: usize, to: u...
5e8a3d01544282e50d887d76f30d1496a0a53562
Analyze and fix the following issue in the Linux kernel code: binder: fix UAF in binder_netlink_report()
Problem Details: Oneway transactions sent to frozen targets via binder_proc_transaction() return a BR_TRANSACTION_PENDING_FROZEN error but they are still treated as successful since the target is expected to thaw at some point. It is then not safe to access 't' after BR_TRANSACTION_PENDING_FROZEN errors as the transact...
```diff diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 535fc881c8da..4e16438eceb7 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -2991,6 +2991,10 @@ static void binder_set_txn_from_error(struct binder_transaction *t, int id, * @t: the binder transaction that failed ...
8f589c9c3be539d6c2b393c82940c3783831082f
Analyze and fix the following issue in the Linux kernel code: rust_binder: correctly handle FDA objects of length zero
Problem Details: Fix a bug where an empty FDA (fd array) object with 0 fds would cause an out-of-bounds error. The previous implementation used `skip == 0` to mean "this is a pointer fixup", but 0 is also the correct skip length for an empty FDA. If the FDA is at the end of the buffer, then this results in an attempt t...
```diff diff --git a/drivers/android/binder/thread.rs b/drivers/android/binder/thread.rs index 1a8e6fdc0dc4..dcd47e10aeb8 100644 --- a/drivers/android/binder/thread.rs +++ b/drivers/android/binder/thread.rs @@ -69,17 +69,24 @@ struct ScatterGatherEntry { } /// This entry specifies that a fixup should happen at `tar...
3e6397b056335cc56ef0e9da36c95946a19f5118
Analyze and fix the following issue in the Linux kernel code: SUNRPC: auth_gss: fix memory leaks in XDR decoding error paths
Problem Details: The gssx_dec_ctx(), gssx_dec_status(), and gssx_dec_name() functions allocate memory via gssx_dec_buffer(), which calls kmemdup(). When a subsequent decode operation fails, these functions return immediately without freeing previously allocated buffers, causing memory leaks. The leak in gssx_dec_ctx()...
```diff diff --git a/net/sunrpc/auth_gss/gss_rpc_xdr.c b/net/sunrpc/auth_gss/gss_rpc_xdr.c index 7d2cdc2bd374..f320c0a8e604 100644 --- a/net/sunrpc/auth_gss/gss_rpc_xdr.c +++ b/net/sunrpc/auth_gss/gss_rpc_xdr.c @@ -320,29 +320,47 @@ static int gssx_dec_status(struct xdr_stream *xdr, /* status->minor_status */ p =...
404d779466646bf1461f2090ff137e99acaecf42
Analyze and fix the following issue in the Linux kernel code: nfsd: fix return error code for nfsd_map_name_to_[ug]id
Problem Details: idmap lookups can time out while the cache is waiting for a userspace upcall reply. In that case cache_check() returns -ETIMEDOUT to callers. The nfsd_map_name_to_[ug]id functions currently proceed with attempting to map the id to a kuid despite a potentially temporary failure to perform the idmap loo...
```diff diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index b5b3d45979c9..c319c31b0f64 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c @@ -672,6 +672,8 @@ __be32 nfsd_map_name_to_uid(struct svc_rqst *rqstp, const char *name, return nfserr_inval; status = do_name_to_id(rqstp, IDMAP_TYPE_USER, ...
f9c206cdc4266caad6a9a7f46341420a10f03ccb
Analyze and fix the following issue in the Linux kernel code: nfsd: never defer requests during idmap lookup
Problem Details: During v4 request compound arg decoding, some ops (e.g. SETATTR) can trigger idmap lookup upcalls. When those upcall responses get delayed beyond the allowed time limit, cache_check() will mark the request for deferral and cause it to be dropped. This prevents nfs4svc_encode_compoundres from being exe...
```diff diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index 8cca1329f348..b5b3d45979c9 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c @@ -643,13 +643,31 @@ static __be32 encode_name_from_id(struct xdr_stream *xdr, return idmap_id_to_name(xdr, rqstp, type, id); } -__be32 -nfsd_map_name_to_uid(s...
9abb3549227e4fb70f0d8ba515bf7ddd249ad710
Analyze and fix the following issue in the Linux kernel code: xdrgen: Improve parse error reporting
Problem Details: The current verbose Lark exception output makes it difficult to quickly identify and fix syntax errors in XDR specifications. Users must wade through hundreds of lines of cascading errors to find the root cause. Replace this with concise, compiler-style error messages showing file, line, column, the u...
```diff diff --git a/tools/net/sunrpc/xdrgen/subcmds/declarations.py b/tools/net/sunrpc/xdrgen/subcmds/declarations.py index c5e8d79986ef..2fd5c255a547 100644 --- a/tools/net/sunrpc/xdrgen/subcmds/declarations.py +++ b/tools/net/sunrpc/xdrgen/subcmds/declarations.py @@ -8,7 +8,6 @@ import logging from argparse impor...
eb1f3b55ac6202a013daf14ed508066947cdafa8
Analyze and fix the following issue in the Linux kernel code: xdrgen: Remove inclusion of nlm4.h header
Problem Details: The client-side source code template mistakenly includes the nlm4.h header file, which is specific to the NLM protocol and should not be present in the generic template that generates client stubs for all XDR-based protocols. Fixes: 903a7d37d9ea ("xdrgen: Update the files included in client-side sourc...
```diff diff --git a/tools/net/sunrpc/xdrgen/templates/C/source_top/client.j2 b/tools/net/sunrpc/xdrgen/templates/C/source_top/client.j2 index c5518c519854..df3598c38b2c 100644 --- a/tools/net/sunrpc/xdrgen/templates/C/source_top/client.j2 +++ b/tools/net/sunrpc/xdrgen/templates/C/source_top/client.j2 @@ -8,6 +8,5 @@ ...
27b0fcae8f535fb882b1876227a935dcfdf576aa
Analyze and fix the following issue in the Linux kernel code: xdrgen: Initialize data pointer for zero-length items
Problem Details: The xdrgen decoders for strings and opaque data had an optimization that skipped calling xdr_inline_decode() when the item length was zero. This left the data pointer uninitialized, which could lead to unpredictable behavior when callers access it. Remove the zero-length check and always call xdr_inli...
```diff diff --git a/include/linux/sunrpc/xdrgen/_builtins.h b/include/linux/sunrpc/xdrgen/_builtins.h index 52ed9a9151c4..a723fb1da9c8 100644 --- a/include/linux/sunrpc/xdrgen/_builtins.h +++ b/include/linux/sunrpc/xdrgen/_builtins.h @@ -248,12 +248,10 @@ xdrgen_decode_string(struct xdr_stream *xdr, string *ptr, u32 m...
41b0a87bc60d5ccfa8575481ddb4d4d8758507fa
Analyze and fix the following issue in the Linux kernel code: NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation
Problem Details: fstests generic/215 and generic/407 were failing because the server wasn't updating mtime properly. When deleg attribute support is not compiled in and thus no attribute delegation was given, the server was skipping updating mtime and ctime because FMODE_NOCMTIME was uncoditionally set for the write de...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d854eac6db42..b46e793ab0d2 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -6353,7 +6353,8 @@ nfs4_open_delegation(struct svc_rqst *rqstp, struct nfsd4_open *open, dp->dl_ctime = stat.ctime; dp->dl_mtime = stat.mtime; spin_lock(...
789477b849394afdb60507924d65f7ef18f078ce
Analyze and fix the following issue in the Linux kernel code: nfsd: fix nfs4_file refcount leak in nfsd_get_dir_deleg()
Problem Details: Claude pointed out that there is a nfs4_file refcount leak in nfsd_get_dir_deleg(). Ensure that the reference to "fp" is released before returning. Fixes: 8b99f6a8c116 ("nfsd: wire up GET_DIR_DELEGATION handling") Cc: stable@vger.kernel.org Cc: Chris Mason <clm@meta.com> Signed-off-by: Jeff Layton <jl...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 4a896c7b494f..d854eac6db42 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -9516,8 +9516,10 @@ nfsd_get_dir_deleg(struct nfsd4_compound_state *cstate, spin_unlock(&clp->cl_lock); spin_unlock(&state_lock); - if (!status) + if (!stat...
0ac903d1bfdce8ff40657c2b7d996947b72b6645
Analyze and fix the following issue in the Linux kernel code: NFS: NFSERR_INVAL is not defined by NFSv2
Problem Details: A documenting comment in include/uapi/linux/nfs.h claims incorrectly that NFSv2 defines NFSERR_INVAL. There is no such definition in either RFC 1094 or https://pubs.opengroup.org/onlinepubs/9629799/chap7.htm NFS3ERR_INVAL is introduced in RFC 1813. NFSD returns NFSERR_INVAL for PROC_GETACL, which has...
```diff diff --git a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c index 5fb202acb0fd..0ac538c76180 100644 --- a/fs/nfsd/nfs2acl.c +++ b/fs/nfsd/nfs2acl.c @@ -45,7 +45,7 @@ static __be32 nfsacld_proc_getacl(struct svc_rqst *rqstp) inode = d_inode(fh->fh_dentry); if (argp->mask & ~NFS_ACL_MASK) { - resp->status = nfserr_...
bf0fe9ad3d597d8e1378dc9953ca96dfc3addb2b
Analyze and fix the following issue in the Linux kernel code: xdrgen: Fix struct prefix for typedef types in program wrappers
Problem Details: The program templates for decoder/argument.j2 and encoder/result.j2 unconditionally add 'struct' prefix to all types. This is incorrect when an RPC protocol specification lists a typedef'd basic type or an enum as a procedure argument or result (e.g., NFSv2's fhandle or stat), resulting in compiler err...
```diff diff --git a/tools/net/sunrpc/xdrgen/generators/__init__.py b/tools/net/sunrpc/xdrgen/generators/__init__.py index e22632cf38fb..1d577a986c6c 100644 --- a/tools/net/sunrpc/xdrgen/generators/__init__.py +++ b/tools/net/sunrpc/xdrgen/generators/__init__.py @@ -6,7 +6,7 @@ from pathlib import Path from jinja2 imp...
9be4b7e74eb7b82ec6d7453a95e9878deab39763
Analyze and fix the following issue in the Linux kernel code: nfsd: prefix notification in nfsd4_finalize_deleg_timestamps() with "nfsd: "
Problem Details: Make it distinct that this message comes from nfsd. Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d5e0f3a52d4f..96e19817cd6b 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1253,7 +1253,7 @@ static void nfsd4_finalize_deleg_timestamps(struct nfs4_delegation *dp, struct f if (ret) { struct inode *inode = file_inode(f); - pr_n...
4329010ad9c36775e7092e451c37c24c4f90243f
Analyze and fix the following issue in the Linux kernel code: xdrgen: Address some checkpatch whitespace complaints
Problem Details: This is a roll-up of three template fixes that eliminate noise from checkpatch output so that it's easier to spot non-trivial problems. To follow conventional kernel C style, when a union declaration is marked with "pragma public", there should be a blank line between the emitted "union xxx { ... };" ...
```diff diff --git a/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2 b/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2 index d1405c7c5354..c7ae506076bb 100644 --- a/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2 +++ b/tools/net/sunrpc/xdrgen/templates/C/enum/declaration/enum.j2 @...
2b4e00d8e70ca8736fda82447be6a4e323c6d1f5
Analyze and fix the following issue in the Linux kernel code: platform/x86/amd/pmc: Add quirk for MECHREVO Wujie 15X Pro
Problem Details: The MECHREVO Wujie 15X Pro suffers from spurious IRQ issues related to the AMD PMC. Add it to the quirk list to use the spurious_8042 fix. Signed-off-by: gongqi <550230171hxy@gmail.com> Link: https://patch.msgid.link/20260122155501.376199-4-550230171hxy@gmail.com Signed-off-by: Ilpo Järvinen <ilpo.jar...
```diff diff --git a/drivers/platform/x86/amd/pmc/pmc-quirks.c b/drivers/platform/x86/amd/pmc/pmc-quirks.c index 404e62ad293a..ed285afaf9b0 100644 --- a/drivers/platform/x86/amd/pmc/pmc-quirks.c +++ b/drivers/platform/x86/amd/pmc/pmc-quirks.c @@ -302,6 +302,13 @@ static const struct dmi_system_id fwbug_list[] = { D...
39e9c376ac42705af4ed4ae39eec028e8bced9b4
Analyze and fix the following issue in the Linux kernel code: platform/x86: intel_telemetry: Fix PSS event register mask
Problem Details: The PSS telemetry info parsing incorrectly applies TELEM_INFO_SRAMEVTS_MASK when extracting event register count from firmware response. This reads bits 15-8 instead of the correct bits 7-0, causing misdetection of hardware capabilities. The IOSS path correctly uses TELEM_INFO_NENABLES_MASK for regist...
```diff diff --git a/drivers/platform/x86/intel/telemetry/pltdrv.c b/drivers/platform/x86/intel/telemetry/pltdrv.c index f23c170a55dc..d9aa349f81e4 100644 --- a/drivers/platform/x86/intel/telemetry/pltdrv.c +++ b/drivers/platform/x86/intel/telemetry/pltdrv.c @@ -610,7 +610,7 @@ static int telemetry_setup(struct platfor...
25e9e322d2ab5c03602eff4fbf4f7c40019d8de2
Analyze and fix the following issue in the Linux kernel code: platform/x86: intel_telemetry: Fix swapped arrays in PSS output
Problem Details: The LTR blocking statistics and wakeup event counters are incorrectly cross-referenced during debugfs output rendering. The code populates pss_ltr_blkd[] with LTR blocking data and pss_s0ix_wakeup[] with wakeup data, but the display loops reference the wrong arrays. This causes the "LTR Blocking Statu...
```diff diff --git a/drivers/platform/x86/intel/telemetry/debugfs.c b/drivers/platform/x86/intel/telemetry/debugfs.c index 70e5736c44c7..189c61ff7ff0 100644 --- a/drivers/platform/x86/intel/telemetry/debugfs.c +++ b/drivers/platform/x86/intel/telemetry/debugfs.c @@ -449,7 +449,7 @@ static int telem_pss_states_show(stru...
128497456756e1b952bd5a912cd073836465109d
Analyze and fix the following issue in the Linux kernel code: platform/x86: toshiba_haps: Fix memory leaks in add/remove routines
Problem Details: toshiba_haps_add() leaks the haps object allocated by it if it returns an error after allocating that object successfully. toshiba_haps_remove() does not free the object pointed to by toshiba_haps before clearing that pointer, so it becomes unreachable allocated memory. Address these memory leaks by ...
```diff diff --git a/drivers/platform/x86/toshiba_haps.c b/drivers/platform/x86/toshiba_haps.c index 03dfddeee0c0..e9324bf16aea 100644 --- a/drivers/platform/x86/toshiba_haps.c +++ b/drivers/platform/x86/toshiba_haps.c @@ -183,7 +183,7 @@ static int toshiba_haps_add(struct acpi_device *acpi_dev) pr_info("Toshiba HD...
43b0b7eff4b3fb684f257d5a24376782e9663465
Analyze and fix the following issue in the Linux kernel code: platform/x86: panasonic-laptop: Fix sysfs group leak in error path
Problem Details: The acpi_pcc_hotkey_add() error path leaks sysfs group pcc_attr_group if platform_device_register_simple() fails for the "panasonic" platform device. Address this by making it call sysfs_remove_group() in that case for the group in question. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.co...
```diff diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 255317e6fec8..937f1a5b78ed 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -1089,7 +1089,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device) ...
2df8b310bcfe76827fd71092f58a2493ee6590b0
Analyze and fix the following issue in the Linux kernel code: dm: use bio_clone_blkg_association
Problem Details: The origin bio carries blk-cgroup information which could be set from foreground(task_css(css) - wbc->wb->blkcg_css), so the blkcg won't control buffer io since commit ca522482e3eaf ("dm: pass NULL bdev to bio_alloc_clone"). The synchronous io is still under control by blkcg, because 'bio->bi_blkg' is ...
```diff diff --git a/drivers/md/dm.c b/drivers/md/dm.c index ea2c43cddde1..e178fe19973e 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1364,6 +1364,8 @@ void dm_submit_bio_remap(struct bio *clone, struct bio *tgt_clone) if (!tgt_clone) tgt_clone = clone; + bio_clone_blkg_association(tgt_clone, io->orig_b...
5fdf86e7353ce2d91a24dcbe7320935b40d55367
Analyze and fix the following issue in the Linux kernel code: KVM: nVMX: Disallow access to vmcs12 fields that aren't supported by "hardware"
Problem Details: Disallow access (VMREAD/VMWRITE), both emulated and via a shadow VMCS, to VMCS fields that the loaded incarnation of KVM doesn't support, e.g. due to lack of hardware support, as a middle ground between allowing access to any vmcs12 field defined by KVM (current behavior) and gating access based on the...
```diff diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 61113ead3d7b..f7950d8465a9 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -86,6 +86,9 @@ static void init_vmcs_shadow_fields(void) pr_err("Missing field from shadow_read_only_field %x\n", field + 1...
5d4ae0bffb6eeada6dd16ba52150457ae96c3725
Analyze and fix the following issue in the Linux kernel code: platform/wmi: string-kunit: Add missing oversized string test case
Problem Details: When compiling the WMI string kunit tests using llvm, the compiler will issue a warning about "oversized_test_utf8_string" being unused. This happens because the test case that was supposed to use said variable was accidentally omitted when adding the kunit tests. Fix this by adding the aforementioned...
```diff diff --git a/drivers/platform/wmi/tests/string_kunit.c b/drivers/platform/wmi/tests/string_kunit.c index 9aa3ffa85090..117f32ee26a8 100644 --- a/drivers/platform/wmi/tests/string_kunit.c +++ b/drivers/platform/wmi/tests/string_kunit.c @@ -228,6 +228,23 @@ static void wmi_string_to_utf8s_oversized_test(struct ku...
ca8dcfedac480e424b8860e3d1394afdcdc550fe
Analyze and fix the following issue in the Linux kernel code: drm/xe: derive mem copy capability from graphics version
Problem Details: Drop .has_mem_copy_instr from the platform descriptors and set it in xe_info_init() after handle_gmdid() populates graphics_verx100. Centralizing the GRAPHICS_VER(xe) >= 20 check keeps MEM_COPY enabled on Xe2+ and removes redundant per-platform plumbing. Bspec: 57561 Fixes: 1e12dbae9d72 ("drm/xe/migr...
```diff diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 9c9ea10d994c..2aa883f5ef79 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -342,7 +342,6 @@ static const struct xe_device_desc lnl_desc = { .has_display = true, .has_flat_ccs = 1, .has_pxp = true, - ...
051be49133971076717846e2a04c746ab3476282
Analyze and fix the following issue in the Linux kernel code: drm/xe/xelp: Fix Wa_18022495364
Problem Details: It looks I mistyped CS_DEBUG_MODE2 as CS_DEBUG_MODE1 when adding the workaround. Fix it. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Fixes: ca33cd271ef9 ("drm/xe/xelp: Add Wa_18022495364") Cc: Matt Roper <matthew.d.roper@intel.com> Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com...
```diff diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c index 281286f2b5f9..b8c1dd953665 100644 --- a/drivers/gpu/drm/xe/xe_lrc.c +++ b/drivers/gpu/drm/xe/xe_lrc.c @@ -1185,7 +1185,7 @@ static ssize_t setup_invalidate_state_cache_wa(struct xe_lrc *lrc, return -ENOSPC; *cmd++ = MI_LOAD_REGI...
c73a8917b31e8ddbd53cc248e17410cec27f8f58
Analyze and fix the following issue in the Linux kernel code: drm/xe: Skip address copy for sync-only execs
Problem Details: For parallel exec queues, xe_exec_ioctl() copied the batch buffer address array from userspace without checking num_batch_buffer. If user creates a sync-only exec that doesn't use the address field, the exec will fail with -EFAULT. Add num_batch_buffer check to skip the copy, and the exec could be exec...
```diff diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c index fd9480031750..8e3614b24010 100644 --- a/drivers/gpu/drm/xe/xe_exec.c +++ b/drivers/gpu/drm/xe/xe_exec.c @@ -190,9 +190,9 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file) goto err_syncs; } - if (x...
7fe6cae2f7fad2b5166b0fc096618629f9e2ebcb
Analyze and fix the following issue in the Linux kernel code: drm/xe/xelp: Fix Wa_18022495364
Problem Details: It looks I mistyped CS_DEBUG_MODE2 as CS_DEBUG_MODE1 when adding the workaround. Fix it. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Fixes: ca33cd271ef9 ("drm/xe/xelp: Add Wa_18022495364") Cc: Matt Roper <matthew.d.roper@intel.com> Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com...
```diff diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c index f4f31bc240d9..3db7968aa5e2 100644 --- a/drivers/gpu/drm/xe/xe_lrc.c +++ b/drivers/gpu/drm/xe/xe_lrc.c @@ -1203,7 +1203,7 @@ static ssize_t setup_invalidate_state_cache_wa(struct xe_lrc *lrc, return -ENOSPC; *cmd++ = MI_LOAD_REGI...
22150a7d401d9e9169b9b68e05bed95f7f49bf69
Analyze and fix the following issue in the Linux kernel code: gfs2: Fix slab-use-after-free in qd_put
Problem Details: Commit a475c5dd16e5 ("gfs2: Free quota data objects synchronously") started freeing quota data objects during filesystem shutdown instead of putting them back onto the LRU list, but it failed to remove these objects from the LRU list, causing LRU list corruption. This caused use-after-free when the sh...
```diff diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 21dfe1e48da6..1c3455093ae8 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -334,6 +334,7 @@ static void qd_put(struct gfs2_quota_data *qd) lockref_mark_dead(&qd->qd_lockref); spin_unlock(&qd->qd_lockref.lock); + list_lru_del_obj(&gfs2_qd_lru, &...
c45fefe3a930ba8a7fef0ed6ad509a02097dfa80
Analyze and fix the following issue in the Linux kernel code: gfs2: Fix gfs2_log_get_bio argument type
Problem Details: Fix the type of gfs2_log_get_bio()'s op argument: callers pass in a blk_opf_t value and the function passes that value on as a blk_opf_t value, so the current argument type makes no sense. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
```diff diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 879635ebddae..df7916bf49c1 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -277,7 +277,7 @@ static struct bio *gfs2_log_alloc_bio(struct gfs2_sbd *sdp, u64 blkno, * @sdp: The super block * @blkno: The device block number we want to write to * @biop: T...
08ca56ffcd43b37061bc675545796b3f01f9937d
Analyze and fix the following issue in the Linux kernel code: gfs2: gfs2_chain_bio start sector fix
Problem Details: Pass the start sector into gfs2_chain_bio(): the new bio isn't necessarily contiguous with the previous one. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
```diff diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index c3317432a25b..879635ebddae 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -479,13 +479,13 @@ static void gfs2_jhead_process_page(struct gfs2_jdesc *jd, unsigned long index, } static struct bio *gfs2_chain_bio(struct bio *prev, unsigned int nr_iovecs, -...
4a94f052e0982794aa65312fe8b69999e4494a20
Analyze and fix the following issue in the Linux kernel code: gfs2: Initialize bio->bi_opf early
Problem Details: Pass the right blk_opf_t value to bio_alloc() so that ->bi_ops is initialized correctly and doesn't have to be changed later. Adjust the call chain to pass that value through to where it is needed (and only there). Add a separate blk_opf_t argument to gfs2_chain_bio() instead of copying the value fro...
```diff diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 2a3b9d10eba7..347df29d610e 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -888,8 +888,9 @@ void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd, sb->s_blocksize - LH_V1_SIZE - 4); lh->lh_crc = cpu_to_be32(crc); - gfs2_log_write(sd...
4928c36536d218ae70a1b79f1c0d3302ffe31f69
Analyze and fix the following issue in the Linux kernel code: gfs2: Do not cancel internal demote requests
Problem Details: Trying to change the state of a glock may result in a "conversion deadlock" error, indicating that the requested state transition would cause a deadlock. In this case, we unlock and retry the state change. It makes no sense to try canceling those unlock requests, but the current code is not aware of t...
```diff diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 776179933315..7c3d488327ee 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -60,7 +60,8 @@ struct gfs2_glock_iter { typedef void (*glock_examiner) (struct gfs2_glock * gl); -static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigne...
11d763f0b0afc2cf5f92f4adae5dbbbbef712f8f
Analyze and fix the following issue in the Linux kernel code: gfs2: Retries missing in gfs2_{rename,exchange}
Problem Details: Fix a bug in gfs2's asynchronous glock handling for rename and exchange operations. The original async implementation from commit ad26967b9afa ("gfs2: Use async glocks for rename") mentioned that retries were needed but never implemented them, causing operations to fail with -ESTALE instead of retryin...
```diff diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 47e8809575d5..f358448d7b3d 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1284,31 +1284,45 @@ static int glocks_pending(unsigned int num_gh, struct gfs2_holder *ghs) * gfs2_glock_async_wait - wait on multiple asynchronous glock acquisitions * @num...
f8f04248c7e9f5d77a93857e3a5d28c0833056dc
Analyze and fix the following issue in the Linux kernel code: gfs2: glock cancelation flag fix
Problem Details: When an asynchronous glock holder is dequeued that hasn't been granted yet (HIF_HOLDER not set) and no dlm operation is in progress on behalf of that holder (GLF_LOCK not set), the dequeuing takes place in __gfs2_glock_dq(). There, we are not clearing the HIF_WAIT flag and waking up waiters. Fix that...
```diff diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 92e029104d8a..47e8809575d5 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1545,6 +1545,8 @@ static void __gfs2_glock_dq(struct gfs2_holder *gh) list_del_init(&gh->gh_list); clear_bit(HIF_HOLDER, &gh->gh_iflags); trace_gfs2_glock_queue(gh, 0); + ...
1956f0a74ccf5dc9c3ef717f2985c3ed3400aab0
Analyze and fix the following issue in the Linux kernel code: RDMA/uverbs: Validate wqe_size before using it in ib_uverbs_post_send
Problem Details: ib_uverbs_post_send() uses cmd.wqe_size from userspace without any validation before passing it to kmalloc() and using the allocated buffer as struct ib_uverbs_send_wr. If a user provides a small wqe_size value (e.g., 1), kmalloc() will succeed, but subsequent accesses to user_wr->opcode, user_wr->num...
```diff diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index ce16404cdfb8..3259e9848cc7 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -2049,7 +2049,10 @@ static int ib_uverbs_post_send(struct uverbs_attr_bundle *attrs) if (ret...
5f64ae1ef639a2bab7e39497c55f76cc0682f108
Analyze and fix the following issue in the Linux kernel code: ata: libata-core: Quirk INTEL SSDSC2KG480G8 max_sectors
Problem Details: Commit 9b8b84879d4a ("block: Increase BLK_DEF_MAX_SECTORS_CAP") increased the default max_sectors_kb from 1280 KiB to 4096 KiB. INTEL SSDSC2KG480G8 with FW rev XCV10120 times out when sending I/Os of size 4096 KiB. Enable ATA_QUIRK_MAX_SEC, with value 8191 (sectors) for this device, since any I/O wit...
```diff diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e888f2445692..8e41e8a33096 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4082,6 +4082,7 @@ static const struct ata_dev_quirk_value __ata_dev_max_sec_quirks[] = { { "LITEON CX1-JB*-HP", NULL, 1024 }, { "LI...
68e28facbc8ab3e701e1814323d397a75b400865
Analyze and fix the following issue in the Linux kernel code: drm/panel: ilitek-ili9882t: Select DRM_DISPLAY_DSC_HELPER
Problem Details: The panel-ilitek-ili9882t driver uses drm_dsc_pps_payload_pack() which is provided by the DRM_DISPLAY_DSC_HELPER. Add the missing Kconfig select to fix the following build error: ERROR: modpost: "drm_dsc_pps_payload_pack" [drivers/gpu/drm/panel/panel-ilitek-ili9882t.ko] undefined! Fixes: 65ce1f5834...
```diff diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index a0fe6069e5e4..ae25f003aa33 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -280,6 +280,7 @@ config DRM_PANEL_ILITEK_ILI9882T depends on OF depends on DRM_MIPI_DSI depends on BACKLIGHT_CLASS_D...
12f15d52d38ac53f7c70ea3d4b3d76afed04e064
Analyze and fix the following issue in the Linux kernel code: drm: Do not allow userspace to trigger kernel warnings in drm_gem_change_handle_ioctl()
Problem Details: Since GEM bo handles are u32 in the uapi and the internal implementation uses idr_alloc() which uses int ranges, passing a new handle larger than INT_MAX trivially triggers a kernel warning: idr_alloc(): ... if (WARN_ON_ONCE(start < 0)) return -EINVAL; ... Fix it by rejecting new handles above INT...
```diff diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index e4df43427394..25f68fed9b48 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -960,16 +960,21 @@ int drm_gem_change_handle_ioctl(struct drm_device *dev, void *data, { struct drm_gem_change_handle *args = data; s...
41399c5d476156635c9a58de870d39318e22fa09
Analyze and fix the following issue in the Linux kernel code: regulator: spacemit-p1: Fix n_voltages for BUCK and LDO regulators
Problem Details: Higher voltage settings were unusable due to incorrect n_voltages values causing registration failures. For example, setting aldo4 to 3.3V failed with -EINVAL because the required selector (123) exceeded the allowed range (n_voltages=117). Fix by aligning n_voltages with the hardware register widths p...
```diff diff --git a/drivers/regulator/spacemit-p1.c b/drivers/regulator/spacemit-p1.c index 2bf9137e12b1..2b585ba01a93 100644 --- a/drivers/regulator/spacemit-p1.c +++ b/drivers/regulator/spacemit-p1.c @@ -87,13 +87,13 @@ static const struct linear_range p1_ldo_ranges[] = { } #define P1_BUCK_DESC(_n) \ - P1_REG_D...
403a0591be681eebc0c4825f8b42afe7fd13ee7f
Analyze and fix the following issue in the Linux kernel code: ASoC: soc-acpi-intel-ptl-match: fix name_prefix of rt1320-2
Problem Details: rt1320_2_group2_adr works with rt1320_1_group2_adr and the name_prefix should be rt1320-2. Fixes: ffe450cb6bce ("ASoC: Intel: soc-acpi-intel-ptl-match: add rt713_vb_l3_rt1320_l12 support") Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.inte...
```diff diff --git a/sound/soc/intel/common/soc-acpi-intel-ptl-match.c b/sound/soc/intel/common/soc-acpi-intel-ptl-match.c index 060955825fe0..e297c8ecedb7 100644 --- a/sound/soc/intel/common/soc-acpi-intel-ptl-match.c +++ b/sound/soc/intel/common/soc-acpi-intel-ptl-match.c @@ -442,7 +442,7 @@ static const struct snd_s...
cb39cf99d88e8f2c68a41fb3bb01c4f40a8fcc30
Analyze and fix the following issue in the Linux kernel code: m68k: sun3: Replace vsprintf() with bounded vsnprintf()
Problem Details: vsprintf() performs no bounds checking and can overflow - replace it with the safer vsnprintf(). Also remove the useless '+ 1' that is a leftover of commit 66ed28ea096c ("m68k: sun3: Remove unused vsprintf() return value in prom_printf()"). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Revie...
```diff diff --git a/arch/m68k/sun3/prom/printf.c b/arch/m68k/sun3/prom/printf.c index db5537ef1250..cb4934d39833 100644 --- a/arch/m68k/sun3/prom/printf.c +++ b/arch/m68k/sun3/prom/printf.c @@ -30,9 +30,9 @@ prom_printf(char *fmt, ...) #ifdef CONFIG_KGDB ppbuf[0] = 'O'; - vsprintf(ppbuf + 1, fmt, args) + 1; + vsn...
ad3ebcc2d06875738cd463fb5424cda70cd94a34
Analyze and fix the following issue in the Linux kernel code: drm/i915/display: Prevent u64 underflow in intel_fbc_stolen_end
Problem Details: Static analysis reveals a potential integer underflow in intel_fbc_stolen_end. This can apparently occur if intel_parent_stolen_area_size returns zero (or, theoretically, any value less than 2^23), as 2^23 is subtracted from the return value and stored in a u64. While this doesn't appear to cause any...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c index fef2f35ff1e9..1f3f5237a1c2 100644 --- a/drivers/gpu/drm/i915/display/intel_fbc.c +++ b/drivers/gpu/drm/i915/display/intel_fbc.c @@ -809,19 +809,32 @@ static u64 intel_fbc_cfb_base_max(struct intel_display *dis...
891b77d459d0ce993c68365d899134bc9fd47ac0
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/realtek: fix right sounds and mute/micmute LEDs for HP machine
Problem Details: The HP EliteBook 630 G11 (103c:8c8f) is using ALC236 codec which used 0x02 to control mute LED and 0x01 to control micmute LED. Therefore, add a quirk to make it works. Link: https://bugzilla.kernel.org/show_bug.cgi?id=220828 Cc: <stable@vger.kernel.org> Signed-off-by: Zhang Heng <zhangheng@kylinos.cn...
```diff diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c index 4b19d26d9822..a9ee084677ec 100644 --- a/sound/hda/codecs/realtek/alc269.c +++ b/sound/hda/codecs/realtek/alc269.c @@ -6750,6 +6750,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x103c, 0x8c8c, "H...
cefcb9297fbdb6d94b61787b4f8d84f55b741470
Analyze and fix the following issue in the Linux kernel code: md raid: fix hang when stopping arrays with metadata through dm-raid
Problem Details: When using device-mapper's dm-raid target, stopping a RAID array can cause the system to hang under specific conditions. This occurs when: - A dm-raid managed device tree is suspended from top to bottom (the top-level RAID device is suspended first, followed by its underlying metadata and data...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 606f616190d7..59cd303548de 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6851,13 +6851,15 @@ static void __md_stop_writes(struct mddev *mddev) { timer_delete_sync(&mddev->safemode_timer); - if (mddev->pers && mddev->pers->quiesce) { - mddev->pe...
f150e753cb8dd756085f46e86f2c35ce472e0a3c
Analyze and fix the following issue in the Linux kernel code: md-cluster: fix NULL pointer dereference in process_metadata_update
Problem Details: The function process_metadata_update() blindly dereferences the 'thread' pointer (acquired via rcu_dereference_protected) within the wait_event() macro. While the code comment states "daemon thread must exist", there is a valid race condition window during the MD array startup sequence (md_run): 1. b...
```diff diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c index 11f1e91d387d..896279988dfd 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c @@ -549,8 +549,13 @@ static void process_metadata_update(struct mddev *mddev, struct cluster_msg *msg dlm_lock_sync(cinfo->no_new_dev_lockres, DL...
46ef85f854dfa9d5226b3c1c46493d79556c9589
Analyze and fix the following issue in the Linux kernel code: md/bitmap: fix GPF in write_page caused by resize race
Problem Details: A General Protection Fault occurs in write_page() during array resize: RIP: 0010:write_page+0x22b/0x3c0 [md_mod] This is a use-after-free race between bitmap_daemon_work() and __bitmap_resize(). The daemon iterates over `bitmap->storage.filemap` without locking, while the resize path frees that storag...
```diff diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index dbe4c4b9a1da..1d4a050dab3a 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -2453,6 +2453,7 @@ static int __bitmap_resize(struct bitmap *bitmap, sector_t blocks, memcpy(page_address(store.sb_page), page_address(bi...
d119bd2e1643cc023210ff3c6f0657e4f914e71d
Analyze and fix the following issue in the Linux kernel code: md/md-llbitmap: fix percpu_ref not resurrected on suspend timeout
Problem Details: When llbitmap_suspend_timeout() times out waiting for percpu_ref to become zero, it returns -ETIMEDOUT without resurrecting the percpu_ref. The caller (md_llbitmap_daemon_fn) then continues to the next page without calling llbitmap_resume(), leaving the percpu_ref in a killed state permanently. Fix th...
```diff diff --git a/drivers/md/md-llbitmap.c b/drivers/md/md-llbitmap.c index 9c1ade19b774..cd713a7dc270 100644 --- a/drivers/md/md-llbitmap.c +++ b/drivers/md/md-llbitmap.c @@ -712,8 +712,10 @@ static int llbitmap_suspend_timeout(struct llbitmap *llbitmap, int page_idx) percpu_ref_kill(&pctl->active); if (!wait...
cd1635d844d26471c56c0a432abdee12fc9ad735
Analyze and fix the following issue in the Linux kernel code: md/raid5: fix IO hang with degraded array with llbitmap
Problem Details: When llbitmap bit state is still unwritten, any new write should force rcw, as bitmap_ops->blocks_synced() is checked in handle_stripe_dirtying(). However, later the same check is missing in need_this_block(), causing stripe to deadloop during handling because handle_stripe() will decide to go to handl...
```diff diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 6d408aaaacf3..8854e024f311 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -3751,9 +3751,14 @@ static int need_this_block(struct stripe_head *sh, struct stripe_head_state *s, struct r5dev *dev = &sh->dev[disk_idx]; struct r5dev *fdev[2] ...
7435b73f05fbb40c07b087fefd3d40bfd759519c
Analyze and fix the following issue in the Linux kernel code: md/raid10: cleanup skip handling in raid10_sync_request
Problem Details: Skip a sector in raid10_sync_request() when it needs no syncing or no readable device exists. Current skip handling is unnecessary: - Use 'skip' label to reissue the next sector instead of return directly - Complete sync and return 'max_sectors' when multiple sectors are skipped due to badblocks Th...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index b258ed8b4e3a..6f5a4aefb4e5 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3161,11 +3161,8 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, int i; int max_sync; sector_t sync_blocks; - sector_t secto...
99582edb3f62e8ee6c34512021368f53f9b091f2
Analyze and fix the following issue in the Linux kernel code: md/raid10: fix any_working flag handling in raid10_sync_request
Problem Details: In raid10_sync_request(), 'any_working' indicates if any IO will be submitted. When there's only one In_sync disk with badblocks, 'any_working' might be set to 1 but no IO is submitted. Fix it by setting 'any_working' after badblock checks. Link: https://lore.kernel.org/linux-raid/20260105110300.14425...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 7fe363729a5a..b258ed8b4e3a 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -3395,7 +3395,6 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr, !test_bit(In_sync, &rdev->flags)) continue; /*...
fd4d44c14ff6a0e815eefd5d87bbba2b2668b18f
Analyze and fix the following issue in the Linux kernel code: md: mark rdev Faulty when badblocks setting fails
Problem Details: Currently when sync read fails and badblocks set fails (exceeding 512 limit), rdev isn't immediately marked Faulty. Instead 'recovery_disabled' is set and non-In_sync rdevs are removed later. This preserves array availability if bad regions aren't read, but bad sectors might be read by users before rde...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 97b023536afc..f1debba1b026 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -10422,8 +10422,14 @@ bool rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors, else s += rdev->data_offset; - if (!badblocks_set(&rdev->badblocks, s, sectors...
2d9f7150ac197ce79c9c917a004d4cf0b26ad7e0
Analyze and fix the following issue in the Linux kernel code: md/raid5: fix raid5_run() to return error when log_init() fails
Problem Details: Since commit f63f17350e53 ("md/raid5: use the atomic queue limit update APIs"), the abort path in raid5_run() returns 'ret' instead of -EIO. However, if log_init() fails, 'ret' is still 0 from the previous successful call, causing raid5_run() to return success despite the failure. Fix this by capturin...
```diff diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 8dc98f545969..a85878b009f9 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -8057,7 +8057,8 @@ static int raid5_run(struct mddev *mddev) goto abort; } - if (log_init(conf, journal_dev, raid5_has_ppl(conf))) + ret = log_init(conf, jour...
540de7ade1e1327119e367ec5f662a627b3fe9f9
Analyze and fix the following issue in the Linux kernel code: riscv/mm: update write protect to work on shadow stacks
Problem Details: 'fork' implements copy-on-write (COW) by making pages readonly in both child and parent. ptep_set_wrprotect() and pte_wrprotect() clear _PAGE_WRITE in PTE. The assumption is that the page is readable and, on a fault, copy-on-write happens. To implement COW on shadow stack pages, clearing the W bit ma...
```diff diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 7f81eecac243..1340aa398a74 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -411,7 +411,7 @@ static inline int pte_special(pte_t pte) static inline pte_t pte_wrprotect(pte_t pte) { -...
c68c2ef9d64169317a6e0e6f0506953637760409
Analyze and fix the following issue in the Linux kernel code: riscv/mm: teach pte_mkwrite to manufacture shadow stack PTEs
Problem Details: pte_mkwrite() creates PTEs with WRITE encodings for the underlying architecture. The underlying architecture can have two types of writeable mappings: one that can be written using regular store instructions, and another one that can only be written using specialized store instructions (like shadow st...
```diff diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 153a692a5640..7f81eecac243 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -451,6 +451,10 @@ static inline pte_t pte_swp_clear_uffd_wp(pte_t pte) /* static inline pte_t pte_mkread(pt...
f56ffb8ada46aae61580905d93c31e4006572240
Analyze and fix the following issue in the Linux kernel code: riscv/mm: manufacture shadow stack ptes
Problem Details: This patch implements the creation of a shadow stack pte on riscv. Creating shadow stack PTE on riscv means clearing RWX and then setting W=1. Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Zong Li <zong.li@sifive.com> Signed-off-by: Deepak Gupta <debug@rivosinc.com> Tested-by: And...
```diff diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index b384a1a9327e..153a692a5640 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -456,6 +456,11 @@ static inline pte_t pte_mkwrite_novma(pte_t pte) return __pte(pte_val(pte) | _PAGE_WRITE);...
6c7559f22b6fcb2d4b52c445434c71ade36b004c
Analyze and fix the following issue in the Linux kernel code: riscv/mm: ensure PROT_WRITE leads to VM_READ | VM_WRITE
Problem Details: 'arch_calc_vm_prot_bits' is implemented on risc-v to return VM_READ | VM_WRITE if PROT_WRITE is specified. Similarly 'riscv_sys_mmap' is updated to convert all incoming PROT_WRITE to (PROT_WRITE | PROT_READ). This is to make sure that any existing apps using PROT_WRITE still work. Earlier 'protection_...
```diff diff --git a/arch/riscv/include/asm/mman.h b/arch/riscv/include/asm/mman.h new file mode 100644 index 000000000000..0ad1d19832eb --- /dev/null +++ b/arch/riscv/include/asm/mman.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_MMAN_H__ +#define __ASM_MMAN_H__ + +#include <linux/compiler....
79dd4f2f40d0414aab670c46b801b11850306448
Analyze and fix the following issue in the Linux kernel code: riscv: Add usercfi state for task and save/restore of CSR_SSP on trap entry/exit
Problem Details: Carve out space in the RISC-V architecture-specific thread struct for cfi status and shadow stack in usermode. This patch: - defines a new structure cfi_status with status bit for cfi feature - defines shadow stack pointer, base and size in cfi_status structure - defines offsets to new member fields i...
```diff diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h index da5426122d28..4c3dd94d0f63 100644 --- a/arch/riscv/include/asm/processor.h +++ b/arch/riscv/include/asm/processor.h @@ -16,6 +16,7 @@ #include <asm/insn-def.h> #include <asm/alternative-macros.h> #include <asm/hwcap.h>...
41a2452c99f327f2b57811e63f6d2497a4a96a9f
Analyze and fix the following issue in the Linux kernel code: riscv: add Zicfiss / Zicfilp extension CSR and bit definitions
Problem Details: The Zicfiss and Zicfilp extensions are enabled via b3 and b2 in *envcfg CSRs. menvcfg controls enabling for S/HS mode. henvcfg controls enabling for VS. senvcfg controls enabling for U/VU mode. The Zicfilp extension extends *status CSRs to hold an 'expected landing pad' bit. A trap or interrupt ca...
```diff diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h index 4a37a98398ad..55a07e8722ff 100644 --- a/arch/riscv/include/asm/csr.h +++ b/arch/riscv/include/asm/csr.h @@ -18,6 +18,15 @@ #define SR_MPP _AC(0x00001800, UL) /* Previously Machine */ #define SR_SUM _AC(0x00040000, UL) /* Supervis...
df11708566d7458d1ce11eb28a59ef6a42ee5236
Analyze and fix the following issue in the Linux kernel code: riscv: zicfiss / zicfilp enumeration
Problem Details: This patch adds support for detecting the RISC-V ISA extensions Zicfiss and Zicfilp. Zicfiss and Zicfilp stand for the unprivileged integer spec extensions for shadow stack and indirect branch tracking, respectively. This patch looks for Zicfiss and Zicfilp in the device tree and accordingly lights u...
```diff diff --git a/arch/riscv/include/asm/cpufeature.h b/arch/riscv/include/asm/cpufeature.h index 62837fa981e8..739fcc84bf7b 100644 --- a/arch/riscv/include/asm/cpufeature.h +++ b/arch/riscv/include/asm/cpufeature.h @@ -152,4 +152,16 @@ static __always_inline bool riscv_cpu_has_extension_unlikely(int cpu, const unsi...
f94645fc03b864cf0823548c87a455346e87c22c
Analyze and fix the following issue in the Linux kernel code: dt-bindings: riscv: document zicfilp and zicfiss in extensions.yaml
Problem Details: Make an entry for cfi extensions in extensions.yaml. Signed-off-by: Deepak Gupta <debug@rivosinc.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Tested-by: Andreas Korb <andreas.korb@aisec.fraunhofer.de> # QEMU, custom CVA6 Tested-by: Valentin Haudiquet <valentin.haudiquet@canonical.com> Link: http...
```diff diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml index 5bab356addc8..1aeff17c7f24 100644 --- a/Documentation/devicetree/bindings/riscv/extensions.yaml +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml @@ -469,6 +469,20 @@ ...
98036587a475f371005e42d3fff9feb9cf713880
Analyze and fix the following issue in the Linux kernel code: mm: add VM_SHADOW_STACK definition for riscv
Problem Details: VM_HIGH_ARCH_5 is used for riscv. Reviewed-by: Zong Li <zong.li@sifive.com> Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Acked-by: David Hildenbrand <david@redhat.com> Signed-off-by: Deepak Gupta <debug@rivosinc.com> Tested-by: Andreas Korb <andreas.korb@aisec.fraunhofer.de> # QEMU, custom CV...
```diff diff --git a/include/linux/mm.h b/include/linux/mm.h index f0d5be9dc736..26c8a0c3fbaa 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -359,7 +359,7 @@ enum { DECLARE_VMA_BIT_ALIAS(PKEY_BIT2, HIGH_ARCH_2), DECLARE_VMA_BIT_ALIAS(PKEY_BIT3, HIGH_ARCH_3), DECLARE_VMA_BIT_ALIAS(PKEY_BIT4, HIGH_ARCH...