id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
69c5d284f67089b4750d28ff6ac6f52ec224b330
Analyze and fix the following issue in the Linux kernel code: netfilter: xt_u32: validate user space input
Problem Details: The xt_u32 module doesn't validate the fields in the xt_u32 structure. An attacker may take advantage of this to trigger an OOB read by setting the size fields with a value beyond the arrays boundaries. Add a checkentry function to validate the structure. This was originally reported by the ZDI proje...
```diff diff --git a/net/netfilter/xt_u32.c b/net/netfilter/xt_u32.c index 177b40d08098..117d4615d668 100644 --- a/net/netfilter/xt_u32.c +++ b/net/netfilter/xt_u32.c @@ -96,11 +96,32 @@ static bool u32_mt(const struct sk_buff *skb, struct xt_action_param *par) return ret ^ data->invert; } +static int u32_mt_check...
e99476497687ef9e850748fe6d232264f30bc8f9
Analyze and fix the following issue in the Linux kernel code: netfilter: xt_sctp: validate the flag_info count
Problem Details: sctp_mt_check doesn't validate the flag_count field. An attacker can take advantage of that to trigger a OOB read and leak memory information. Add the field validation in the checkentry function. Fixes: 2e4e6a17af35 ("[NETFILTER] x_tables: Abstraction layer for {ip,ip6,arp}_tables") Cc: stable@vger.k...
```diff diff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c index e8961094a282..b46a6a512058 100644 --- a/net/netfilter/xt_sctp.c +++ b/net/netfilter/xt_sctp.c @@ -149,6 +149,8 @@ static int sctp_mt_check(const struct xt_mtchk_param *par) { const struct xt_sctp_info *info = par->matchinfo; + if (info->f...
28427f368f0e08d504ed06e74bc7cc79d6d06511
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_exthdr: Fix non-linear header modification
Problem Details: Fix skb_ensure_writable() size. Don't use nft_tcp_header_pointer() to make it explicit that pointers point to the packet (not local buffer). Fixes: 99d1712bc41c ("netfilter: exthdr: tcp option set support") Fixes: 7890cbea66e7 ("netfilter: exthdr: add support for tcp option removal") Cc: stable@vger.k...
```diff diff --git a/net/netfilter/nft_exthdr.c b/net/netfilter/nft_exthdr.c index 7f856ceb3a66..a9844eefedeb 100644 --- a/net/netfilter/nft_exthdr.c +++ b/net/netfilter/nft_exthdr.c @@ -238,7 +238,12 @@ static void nft_exthdr_tcp_set_eval(const struct nft_expr *expr, if (!tcph) goto err; + if (skb_ensure_writab...
5eefc5307c983b59344a4cb89009819f580c84fa
Analyze and fix the following issue in the Linux kernel code: drm/i915: mark requests for GuC virtual engines to avoid use-after-free
Problem Details: References to i915_requests may be trapped by userspace inside a sync_file or dmabuf (dma-resv) and held indefinitely across different proceses. To counter-act the memory leaks, we try to not to keep references from the request past their completion. On the other side on fence release we need to know i...
```diff diff --git a/drivers/gpu/drm/i915/gt/intel_engine_types.h b/drivers/gpu/drm/i915/gt/intel_engine_types.h index e99a6fa03d45..a7e677598004 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_types.h +++ b/drivers/gpu/drm/i915/gt/intel_engine_types.h @@ -58,6 +58,7 @@ struct i915_perf_group; typedef u32 intel_en...
5690eed941ab7e33c3c3d6b850100cabf740f075
Analyze and fix the following issue in the Linux kernel code: NFSv4.2: fix handling of COPY ERR_OFFLOAD_NO_REQ
Problem Details: If the client sent a synchronous copy and the server replied with ERR_OFFLOAD_NO_REQ indicating that it wants an asynchronous copy instead, the client should retry with asynchronous copy. Fixes: 539f57b3e0fd ("NFS handle COPY ERR_OFFLOAD_NO_REQS") Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Si...
```diff diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 49f78e23b34c..063e00aff87e 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -471,8 +471,9 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src, continue; } break; - } else if (err == -NFS4ERR_OFFLOAD_NO_REQS && !args.sync...
f67b55b6588bcf9316a1e6e8d529100a5aa3ebe6
Analyze and fix the following issue in the Linux kernel code: NFS: Guard against READDIR loop when entry names exceed MAXNAMELEN
Problem Details: Commit 64cfca85bacd asserts the only valid return values for nfs2/3_decode_dirent should not include -ENAMETOOLONG, but for a server that sends a filename3 which exceeds MAXNAMELEN in a READDIR response the client's behavior will be to endlessly retry the operation. We could map -ENAMETOOLONG into -EB...
```diff diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index 05c3b4b2b3dd..c19093814296 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c @@ -949,7 +949,7 @@ int nfs2_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, error = decode_filename_inline(xdr, &entry->name, &entry->len); if (unlikely(er...
acce85a7dd28eac3858d44230f4c65985d0f271c
Analyze and fix the following issue in the Linux kernel code: platform/x86: asus-wmi: corrections to egpu safety check
Problem Details: An incorrect if statement was preventing the enablement of the egpu. Fixes: d49f4d1a30ac ("platform/x86: asus-wmi: don't allow eGPU switching if eGPU not connected") Signed-off-by: Luke D. Jones <luke@ljones.dev> Link: https://lore.kernel.org/r/20230830022908.36264-2-luke@ljones.dev Reviewed-by: Hans ...
```diff diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 9783893d2d6e..9f8cea5f9615 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -726,19 +726,18 @@ static ssize_t egpu_enable_store(struct device *dev, return -EINVAL; err = asus_wmi_get_...
06469a8dc37598176937dac1f6ca41e8f0db2b81
Analyze and fix the following issue in the Linux kernel code: platform/x86: mlx-platform: Add dependency on PCI to Kconfig
Problem Details: Add dependency on PCI to avoid 'mlx-platform' compilation error in case CONFIG_PCI is not set. Failed on i386: CONFIG_ACPI=y CONFIG_ISA=y Error In function 'mlxplat_pci_fpga_device_init': implicit declaration of function 'pci_request_region': 6204 | err = pci_request_region(pci_dev, 0, res_n...
```diff diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index a43db6731f34..2a1070543391 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -965,8 +965,7 @@ config SERIAL_MULTI_INSTANTIATE config MLX_PLATFORM tristate "Mellanox Technologies platform support" - ...
280410677af763f3871b93e794a199cfcf6fb580
Analyze and fix the following issue in the Linux kernel code: drm/i915: mark requests for GuC virtual engines to avoid use-after-free
Problem Details: References to i915_requests may be trapped by userspace inside a sync_file or dmabuf (dma-resv) and held indefinitely across different proceses. To counter-act the memory leaks, we try to not to keep references from the request past their completion. On the other side on fence release we need to know i...
```diff diff --git a/drivers/gpu/drm/i915/gt/intel_engine_types.h b/drivers/gpu/drm/i915/gt/intel_engine_types.h index e99a6fa03d45..a7e677598004 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_types.h +++ b/drivers/gpu/drm/i915/gt/intel_engine_types.h @@ -58,6 +58,7 @@ struct i915_perf_group; typedef u32 intel_en...
2dcdf8c18d5c1835571bfa40f40ac134c8a1f0f5
Analyze and fix the following issue in the Linux kernel code: dma-contiguous: fix the Kconfig entry for CONFIG_DMA_NUMA_CMA
Problem Details: It makes no sense to expose CONFIG_DMA_NUMA_CMA if CONFIG_NUMA is not enabled, and random config options shouldn't be default unless there is a good reason. Replace the default NUMA with a depends on to fix both issues. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <roin.mur...
```diff diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig index 4c1e9a3c0ab6..f488997b0717 100644 --- a/kernel/dma/Kconfig +++ b/kernel/dma/Kconfig @@ -160,7 +160,7 @@ if DMA_CMA config DMA_NUMA_CMA bool "Enable separate DMA Contiguous Memory Area for NUMA Node" - default NUMA + depends on NUMA help Enab...
10eaac085bfe0b3cf7ffd7406375d3f3bc817a95
Analyze and fix the following issue in the Linux kernel code: drm/display/dp: Assume 8 bpc support when DSC is supported
Problem Details: As per DP v1.4, a DP DSC Sink device shall support 8bpc in DPCD 6Ah. Apparently some panels that do support DSC, are not setting the bit for 8bpc. So always assume 8bpc support by DSC decoder, when DSC is claimed to be supported. v2: Use helper to get check dsc support. (Ankit) v3: Fix styling and ot...
```diff diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c index e6a78fd32380..8a1b64c57dfd 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -2449,12 +2449,16 @@ int drm_dp_dsc_sink_supported_input_bpcs(const u8 dsc_dpcd[DP...
2b8272ff4a70b866106ae13c36be7ecbef5d5da2
Analyze and fix the following issue in the Linux kernel code: cpu/hotplug: Prevent self deadlock on CPU hot-unplug
Problem Details: Xiongfeng reported and debugged a self deadlock of the task which initiates and controls a CPU hot-unplug operation vs. the CFS bandwidth timer. CPU1 CPU2 T1 sets cfs_quota starts hrtimer cfs_bandwidth 'period_timer' T1 is migrated to CPU2 T1 initiates offl...
```diff diff --git a/kernel/cpu.c b/kernel/cpu.c index f6811c857102..6de7c6bb74ee 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1487,8 +1487,22 @@ out: return ret; } +struct cpu_down_work { + unsigned int cpu; + enum cpuhp_state target; +}; + +static long __cpu_down_maps_locked(void *arg) +{ + struct cpu_down_...
96c1fa04f089a7e977a44e4e8fdc92e81be20bef
Analyze and fix the following issue in the Linux kernel code: tick/rcu: Fix false positive "softirq work is pending" messages
Problem Details: In commit 0345691b24c0 ("tick/rcu: Stop allowing RCU_SOFTIRQ in idle") the new function report_idle_softirq() was created by breaking code out of the existing can_stop_idle_tick() for kernels v5.18 and newer. In doing so, the code essentially went from a one conditional: if (a && b && c) warn(); ...
```diff diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 4df14db4da49..87015e9deacc 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1045,7 +1045,7 @@ static bool report_idle_softirq(void) return false; /* On RT, softirqs handling may be waiting on some lock */ - if ...
5195c35ac4f09bc45bde23b98d74c4f5d62bea65
Analyze and fix the following issue in the Linux kernel code: csky: Fixup compile error
Problem Details: Add header file for asmlinkage macro. Error log: In file included from arch/csky/include/asm/ptrace.h:7, from arch/csky/include/asm/elf.h:6, from include/linux/elf.h:6, from kernel/extable.c:6: arch/csky/include/asm/traps.h:43:11: error: expected ';' ...
```diff diff --git a/arch/csky/include/asm/traps.h b/arch/csky/include/asm/traps.h index 1e7d303b91e9..732c4aaa2e26 100644 --- a/arch/csky/include/asm/traps.h +++ b/arch/csky/include/asm/traps.h @@ -3,6 +3,8 @@ #ifndef __ASM_CSKY_TRAPS_H #define __ASM_CSKY_TRAPS_H +#include <linux/linkage.h> + #define VEC_RESET 0 ...
fb5a4315591dae307a65fc246ca80b5159d296e1
Analyze and fix the following issue in the Linux kernel code: dma-debug: don't call __dma_entry_alloc_check_leak() under free_entries_lock
Problem Details: __dma_entry_alloc_check_leak() calls into printk -> serial console output (qcom geni) and grabs port->lock under free_entries_lock spin lock, which is a reverse locking dependency chain as qcom_geni IRQ handler can call into dma-debug code and grab free_entries_lock under port->lock. Move __dma_entry_...
```diff diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index f190651bcadd..06366acd27b0 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -637,15 +637,19 @@ static struct dma_debug_entry *__dma_entry_alloc(void) return entry; } -static void __dma_entry_alloc_check_leak(void) +/* + * This should be ...
a7eb28801b692df2496e21ff9af6ab0dc1969133
Analyze and fix the following issue in the Linux kernel code: s390/mm: use __set_memory() variants where useful
Problem Details: Use the __set_memory_yy() variants instead of set_memory_yy() where useful. This allows to make the code a bit more readable. This also fixes the debug pagealloc case, where set_memory_4k() might be called for an area larger than 8TB which would lead to an overflow of the num_pages parameter of set_me...
```diff diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 8d94e29adcdb..d1631f8e53b5 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c @@ -107,7 +107,7 @@ void mark_rodata_ro(void) { unsigned long size = __end_ro_after_init - __start_ro_after_init; - set_memory_ro((unsigned long)__start_ro_afte...
850612c8e4fb048905af597cbd25dfbb40d9ffdf
Analyze and fix the following issue in the Linux kernel code: s390/set_memory: add __set_memory() variant
Problem Details: Add a __set_memory_yy() variant for all set_memory_yy() implementations. The new variant takes start and end void pointers, which allows them to be used without the usual unsigned long cast. However more important: the new variant can be used for areas larger than 8TB. The old variant comes with an "i...
```diff diff --git a/arch/s390/include/asm/set_memory.h b/arch/s390/include/asm/set_memory.h index 9f6c329a0d4e..06fbabe2f66c 100644 --- a/arch/s390/include/asm/set_memory.h +++ b/arch/s390/include/asm/set_memory.h @@ -24,14 +24,32 @@ enum { #define SET_MEMORY_INV BIT(_SET_MEMORY_INV_BIT) #define SET_MEMORY_DEF BIT(_...
a6e49f10f4411ec87f16ccb1b0ce5ea7e4a04a95
Analyze and fix the following issue in the Linux kernel code: s390/mm: improve description of mapping permissions of prefix pages
Problem Details: Slightly improve the description which explains why the first prefix page must be mapped executable when the BEAR-enhancement facility is not installed. Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
```diff diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index 9b31dc565bc5..a1e01542790b 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c @@ -659,8 +659,11 @@ void __init vmem_map_init(void) (unsigned long)(_einittext - _sinittext) >> PAGE_SHIFT); set_memory_rox((unsigned long)__stext_amode...
7b03942ff33c3b242eb4b52d83dac8fa106c063c
Analyze and fix the following issue in the Linux kernel code: s390/vmem: fix virtual vs physical address confusion
Problem Details: Fix virtual vs physical address confusion (which currently are the same). Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
```diff diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index e44243b9c0a4..0ae363cb47bc 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c @@ -747,8 +747,10 @@ void __init vmem_map_init(void) } #ifdef CONFIG_KASAN - for_each_mem_range(i, &base, &end) - set_memory_kasan(base, end); + for_each_mem_r...
789dd8cb1eb1503c8167bf2ffc88f74a70245044
Analyze and fix the following issue in the Linux kernel code: s390/dcssblk: fix lockdep warning
Problem Details: dcssblk_remove_store() holds the dcssblk_devices_sem semaphore while calling del_gendisk(dev_info->gd), which in turn tries to acquire disk->open_mutex. Then there is dcssblk_release(), which is called with disk->open_mutex held, and tries to acquire dcssblk_devices_sem. Lockdep reports this as possib...
```diff diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 06bcb6c78909..4b7ecd4fd431 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -411,13 +411,13 @@ removeseg: segment_unload(entry->segment_name); } list_del(&dev_info->lh); + up_write(&dcssblk_devi...
67ce50ce01d8abfa36612bcef9ec56e37b9fc247
Analyze and fix the following issue in the Linux kernel code: s390/monreader: fix virtual vs physical address confusion
Problem Details: Fix virtual vs physical address confusion (which currently are the same). Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
```diff diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c index 9fa92e45e0ee..7207a7f5842a 100644 --- a/drivers/s390/char/monreader.c +++ b/drivers/s390/char/monreader.c @@ -111,7 +111,7 @@ static inline unsigned long mon_mca_end(struct mon_msg *monmsg) static inline u8 mon_mca_type(struct m...
e4da8c78973c1e307c0431e0b99a969ffb8aa3f1
Analyze and fix the following issue in the Linux kernel code: net: ipv4, ipv6: fix IPSTATS_MIB_OUTOCTETS increment duplicated
Problem Details: commit edf391ff1723 ("snmp: add missing counters for RFC 4293") had already added OutOctets for RFC 4293. In commit 2d8dbb04c63e ("snmp: fix OutOctets counter to include forwarded datagrams"), OutOctets was counted again, but not removed from ip_output(). According to RFC 4293 "3.2.3. IP Statistics Ta...
```diff diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index e18931a6d153..66fac1216d46 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c @@ -67,7 +67,6 @@ static int ip_forward_finish(struct net *net, struct sock *sk, struct sk_buff *s struct ip_options *opt = &(IPCB(skb)->opt); __IP_INC...
e8f13e061d75ed0eeaaf599532a6b197f195d5f3
Analyze and fix the following issue in the Linux kernel code: x86/audit: Fix -Wmissing-variable-declarations warning for ia32_xyz_class
Problem Details: When building x86 defconfig with Clang-18 I get the following warnings: | arch/x86/ia32/audit.c:6:10: warning: no previous extern declaration for non-static variable 'ia32_dir_class' [-Wmissing-variable-declarations] | 6 | unsigned ia32_dir_class[] = { | arch/x86/ia32/audit.c:11:10: warning:...
```diff diff --git a/arch/x86/include/asm/audit.h b/arch/x86/include/asm/audit.h index 36aec57ea7a3..fa918f01333e 100644 --- a/arch/x86/include/asm/audit.h +++ b/arch/x86/include/asm/audit.h @@ -4,4 +4,11 @@ int ia32_classify_syscall(unsigned int syscall); +extern unsigned ia32_dir_class[]; +extern unsigned ia32_w...
0d6b35283bcf1a379cf20066544af8e6a6b16b46
Analyze and fix the following issue in the Linux kernel code: sched/core: Report correct state for TASK_IDLE | TASK_FREEZABLE
Problem Details: task_state_index() ignores uninteresting state flags (such as TASK_FREEZABLE) for most states, but for TASK_IDLE and TASK_RTLOCK_WAIT it does not. So if a task is waiting TASK_IDLE|TASK_FREEZABLE it gets incorrectly reported as TASK_UNINTERRUPTIBLE or "D". (it is planned for nfsd to change to use thi...
```diff diff --git a/include/linux/sched.h b/include/linux/sched.h index ae6fd76afaf5..77f01ac385f7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1671,7 +1671,7 @@ static inline unsigned int __task_state_index(unsigned int tsk_state, BUILD_BUG_ON_NOT_POWER_OF_2(TASK_REPORT_MAX); - if (tsk_sta...
35d2b7ffffc1d9b3dc6c761010aa3338da49165b
Analyze and fix the following issue in the Linux kernel code: bpf, sockmap: Fix preempt_rt splat when using raw_spin_lock_t
Problem Details: Sockmap and sockhash maps are a collection of psocks that are objects representing a socket plus a set of metadata needed to manage the BPF programs associated with the socket. These maps use the stab->lock to protect from concurrent operations on the maps, e.g. trying to insert to objects into the arr...
```diff diff --git a/net/core/sock_map.c b/net/core/sock_map.c index 8f07fea39d9e..cb11750b1df5 100644 --- a/net/core/sock_map.c +++ b/net/core/sock_map.c @@ -18,7 +18,7 @@ struct bpf_stab { struct bpf_map map; struct sock **sks; struct sk_psock_progs progs; - raw_spinlock_t lock; + spinlock_t lock; }; #defin...
5439cfa7fe612e7d02d5a1234feda3fa6e483ba7
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix flaky cgroup_iter_sleepable subtest
Problem Details: Occasionally, with './test_progs -j' on my vm, I will hit the following failure: test_cgrp_local_storage:PASS:join_cgroup /cgrp_local_storage 0 nsec test_cgroup_iter_sleepable:PASS:skel_open 0 nsec test_cgroup_iter_sleepable:PASS:skel_load 0 nsec test_cgroup_iter_sleepable:PASS:attach_iter 0 n...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_obj_pinning.c b/tools/testing/selftests/bpf/prog_tests/bpf_obj_pinning.c index 31f1e815f671..ee0458a5ce78 100644 --- a/tools/testing/selftests/bpf/prog_tests/bpf_obj_pinning.c +++ b/tools/testing/selftests/bpf/prog_tests/bpf_obj_pinning.c @@ -8,6 +8,7 @@ ...
9d0a67b9d42c630d5013ef81587335d975a7a4a9
Analyze and fix the following issue in the Linux kernel code: xsk: Fix xsk_build_skb() error: 'skb' dereferencing possible ERR_PTR()
Problem Details: Currently, xsk_build_skb() is a function that builds skb in two possible ways and then is ended with common error handling. We can distinguish four possible error paths and handling in xsk_build_skb(): 1. sock_alloc_send_skb fails: Retry (skb is NULL). 2. skb_store_bits fails : Free skb and retry. ...
```diff diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index fcfc8472f73d..55f8b9b0e06d 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -602,7 +602,7 @@ static struct sk_buff *xsk_build_skb_zerocopy(struct xdp_sock *xs, for (copied = 0, i = skb_shinfo(skb)->nr_frags; copied < len; i++) { if (unlikely(i >= MAX_SKB_...
6a8faf10709161e7138202a8cf052b070971239f
Analyze and fix the following issue in the Linux kernel code: bpftool: Fix build warnings with -Wtype-limits
Problem Details: Quentin reported build warnings when building bpftool : link.c: In function ‘perf_config_hw_cache_str’: link.c:86:18: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits] 86 | if ((id) >= 0 && (id) < ARRAY_SIZE(array)) \ | ...
```diff diff --git a/tools/bpf/bpftool/link.c b/tools/bpf/bpftool/link.c index 0b214f6ab5c8..2e5c231e08ac 100644 --- a/tools/bpf/bpftool/link.c +++ b/tools/bpf/bpftool/link.c @@ -83,7 +83,7 @@ const char *evsel__hw_cache_result[PERF_COUNT_HW_CACHE_RESULT_MAX] = { #define perf_event_name(array, id) ({ \ const char ...
ba22e81872c1232ea4ba421251d8109a5ed68c52
Analyze and fix the following issue in the Linux kernel code: crypto: powerpc/chacha20,poly1305-p10 - Add dependency on VSX
Problem Details: Add dependency on VSX as otherwise the build will fail without it. Fixes: 161fca7e3e90 ("crypto: powerpc - Add chacha20/poly1305-p10 to Kconfig and Makefile") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202308251906.SYawej6g-lkp@intel.com/ Signed-off-by...
```diff diff --git a/arch/powerpc/crypto/Kconfig b/arch/powerpc/crypto/Kconfig index f25024afdda5..7a66d7c0e6a2 100644 --- a/arch/powerpc/crypto/Kconfig +++ b/arch/powerpc/crypto/Kconfig @@ -113,7 +113,7 @@ config CRYPTO_AES_GCM_P10 config CRYPTO_CHACHA20_P10 tristate "Ciphers: ChaCha20, XChacha20, XChacha12 (P10 ...
75d1d3a433f0a0748a89eb074830e9b635a19fd2
Analyze and fix the following issue in the Linux kernel code: clk: qcom: Fix SM_GPUCC_8450 dependencies
Problem Details: CONFIG_SM_GCC_8450 depends on ARM64 but it is selected by CONFIG_SM_GPUCC_8450, which can be selected on ARM, resulting in a Kconfig warning. WARNING: unmet direct dependencies detected for SM_GCC_8450 Depends on [n]: COMMON_CLK [=y] && COMMON_CLK_QCOM [=y] && (ARM64 || COMPILE_TEST [=n]) Selected...
```diff diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig index bd9bfb11b328..865db5202e4c 100644 --- a/drivers/clk/qcom/Kconfig +++ b/drivers/clk/qcom/Kconfig @@ -986,6 +986,7 @@ config SM_GPUCC_8350 config SM_GPUCC_8450 tristate "SM8450 Graphics Clock Controller" + depends on ARM64 || COMPILE_TEST...
6372e2ee629894433fe6107d7048536a3280a284
Analyze and fix the following issue in the Linux kernel code: NFSD: da_addr_body field missing in some GETDEVICEINFO replies
Problem Details: The XDR specification in RFC 8881 looks like this: struct device_addr4 { layouttype4 da_layout_type; opaque da_addr_body<>; }; struct GETDEVICEINFO4resok { device_addr4 gdir_device_addr; bitmap4 gdir_notification; }; union GETDEVICEINFO4res switch (nfsstat4 gdir_status) { case NFS4_OK: GETDEV...
```diff diff --git a/fs/nfsd/blocklayoutxdr.c b/fs/nfsd/blocklayoutxdr.c index 8e9c1a0f8d38..1ed2f691ebb9 100644 --- a/fs/nfsd/blocklayoutxdr.c +++ b/fs/nfsd/blocklayoutxdr.c @@ -83,6 +83,15 @@ nfsd4_block_encode_getdeviceinfo(struct xdr_stream *xdr, int len = sizeof(__be32), ret, i; __be32 *p; + /* + * See para...
850bac3ae4a636e9e6bb8de62fe697ac171cb221
Analyze and fix the following issue in the Linux kernel code: SUNRPC: Deduplicate thread wake-up code
Problem Details: Refactor: Extract the loop that finds an idle service thread from svc_xprt_enqueue() and svc_wake_up(). Both functions do just about the same thing. Note that svc_wake_up() currently does not hold the RCU read lock while waking the target thread. It indeed should hold the lock, just as svc_xprt_enqueu...
```diff diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 1c491f02efc8..2b9c6df23078 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -419,6 +419,7 @@ int svc_register(const struct svc_serv *, struct net *, const int, void svc_wake_up(struct svc_serv *); v...
8db14cad28ae8ec3fde0fef18e969782bca204d1
Analyze and fix the following issue in the Linux kernel code: lockd: remove SIGKILL handling
Problem Details: lockd allows SIGKILL and responds by dropping all locks and restarting the grace period. This functionality has been present since 2.1.32 when lockd was added to Linux. This functionality is undocumented and most likely added as a useful debug aid. When there is a need to drop locks, the better appr...
```diff diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 22d3ff3818f5..614faa5f69cd 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -45,7 +45,6 @@ #define NLMDBG_FACILITY NLMDBG_SVC #define LOCKD_BUFSIZE (1024 + NLMSVC_XDRSIZE) -#define ALLOWED_SIGS (sigmask(SIGKILL)) static struct svc_program nlmsvc_pr...
de8d38cf44bac43e83bad28357ba84784c412752
Analyze and fix the following issue in the Linux kernel code: fs: lockd: avoid possible wrong NULL parameter
Problem Details: clang's static analysis warning: fs/lockd/mon.c: line 293, column 2: Null pointer passed as 2nd argument to memory copy function. Assuming 'hostname' is NULL and calling 'nsm_create_handle()', this will pass NULL as 2nd argument to memory copy function 'memcpy()'. So return NULL if 'hostname' is inval...
```diff diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index 1d9488cf0534..87a0f207df0b 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c @@ -276,6 +276,9 @@ static struct nsm_handle *nsm_create_handle(const struct sockaddr *sap, { struct nsm_handle *new; + if (!hostname) + return NULL; + new = kzalloc(sizeof(*new...
d424797032c6e24b44037e6c7a2d32fd958300f0
Analyze and fix the following issue in the Linux kernel code: nfsd: inherit required unset default acls from effective set
Problem Details: A well-formed NFSv4 ACL will always contain OWNER@/GROUP@/EVERYONE@ ACEs, but there is no requirement for inheritable entries for those entities. POSIX ACLs must always have owner/group/other entries, even for a default ACL. nfsd builds the default ACL from inheritable ACEs, but the current code just ...
```diff diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c index 518203821790..96e786b5e544 100644 --- a/fs/nfsd/nfs4acl.c +++ b/fs/nfsd/nfs4acl.c @@ -441,7 +441,7 @@ struct posix_ace_state_array { * calculated so far: */ struct posix_acl_state { - int empty; + unsigned char valid; struct posix_ace_state owner; ...
be2be5f7f4436442d8f6bffbb97a6f438df2896b
Analyze and fix the following issue in the Linux kernel code: lockd: nlm_blocked list race fixes
Problem Details: This patch fixes races when lockd accesses the global nlm_blocked list. It was mostly safe to access the list because everything was accessed from the lockd kernel thread context but there exist cases like nlmsvc_grant_deferred() that could manipulate the nlm_blocked list and it can be called from any ...
```diff diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index c43ccdf28ed9..28abec5c451d 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -131,12 +131,14 @@ static void nlmsvc_insert_block(struct nlm_block *block, unsigned long when) static inline void nlmsvc_remove_block(struct nlm_block *block) { +...
976626073a7502fc91416155bd037a29deee729b
Analyze and fix the following issue in the Linux kernel code: nfsd: remove unsafe BUG_ON from set_change_info
Problem Details: At one time, nfsd would scrape inode information directly out of struct inode in order to populate the change_info4. At that time, the BUG_ON in set_change_info made some sense, since having it unset meant a coding error. More recently, it calls vfs_getattr to get this information, which can fail. If ...
```diff diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index cdf58d181c9e..a9c84339ff65 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -382,6 +382,38 @@ out: return status; } +/** + * set_change_info - set up the change_info4 for a reply + * @cinfo: pointer to nfsd4_change_info to be populated +...
e7421ce71437ec8e4d69cc6bdf35b6853adc5050
Analyze and fix the following issue in the Linux kernel code: NFSD: Rename struct svc_cacherep
Problem Details: The svc_ prefix is identified with the SunRPC layer. Although the duplicate reply cache caches RPC replies, it is only for the NFS protocol. Rename the struct to better reflect its purpose. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
```diff diff --git a/fs/nfsd/cache.h b/fs/nfsd/cache.h index 27610b071880..929248c6ca84 100644 --- a/fs/nfsd/cache.h +++ b/fs/nfsd/cache.h @@ -19,7 +19,7 @@ * typical sockaddr_storage. This is for space reasons, since sockaddr_storage * is much larger than a sockaddr_in6. */ -struct svc_cacherep { +struct nfsd_ca...
f16ff1cafbf1e65cc706af912df90bcc15d39a6c
Analyze and fix the following issue in the Linux kernel code: SUNRPC: Fix the recent bv_offset fix
Problem Details: Jeff confirmed his original fix addressed his pynfs test failure, but this same bug also impacted qemu: accessing qcow2 virtual disks using direct I/O was failing. Jeff's fix missed that you have to shorten the bio_vec element by the same amount as you increased the page offset. Reported-by: Maxim Lev...
```diff diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 2eb8df44f894..589020ed909d 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1244,8 +1244,10 @@ static int svc_tcp_sendmsg(struct socket *sock, struct xdr_buf *xdr, if (ret != head->iov_len) goto out; - if (xdr_buf_pagecount(xd...
fe48ba7daefe75bbbefa2426deddc05f2d530d2d
Analyze and fix the following issue in the Linux kernel code: workqueue: fix data race with the pwq->stats[] increment
Problem Details: KCSAN has discovered a data race in kernel/workqueue.c:2598: [ 1863.554079] ================================================================== [ 1863.554118] BUG: KCSAN: data-race in process_one_work / process_one_work [ 1863.554142] write to 0xffff963d99d79998 of 8 bytes by task 5394 on cpu 27: [ 18...
```diff diff --git a/kernel/workqueue.c b/kernel/workqueue.c index d4364d3d8aaa..c85825e17df8 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -2599,6 +2599,7 @@ __acquires(&pool->lock) */ set_work_pool_and_clear_pending(work, pool->id); + pwq->stats[PWQ_STAT_STARTED]++; raw_spin_unlock_irq(&pool->l...
06afec5c988acb2c4f566eac2f6ec53d30d3a1b5
Analyze and fix the following issue in the Linux kernel code: ASoC: cs35l56: Waiting for firmware to boot must be tolerant of I/O errors
Problem Details: Ignore failure to read from the cs35l56 when polling as the device will NAK i2c accesses until it has booted and this would terminate the poll of regmap_read_poll_timeout(). Fixes: 8a731fd37f8b ("ASoC: cs35l56: Move utility functions to shared file") Signed-off-by: Simon Trimmer <simont@opensource.cir...
```diff diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c index ae373f335ea8..98b1e63360ae 100644 --- a/sound/soc/codecs/cs35l56-shared.c +++ b/sound/soc/codecs/cs35l56-shared.c @@ -243,26 +243,27 @@ int cs35l56_wait_for_firmware_boot(struct cs35l56_base *cs35l56_base) { unsigned int...
b0560bfd4b70277a4936c82e50e940aa253c95bf
Analyze and fix the following issue in the Linux kernel code: perf/x86/intel: Clean up the hybrid CPU type handling code
Problem Details: There is a fairly long list of grievances about the current code. The main beefs: 1. hybrid_big_small assumes that the *HARDWARE* (CPUID) provided core types are a bitmap. They are not. If Intel happened to make a core type of 0xff, hilarity would ensue. 2. adl_get_hybrid_cpu_type() ...
```diff diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 185f902e5f28..40ad1425ffa2 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1887,9 +1887,9 @@ ssize_t events_hybrid_sysfs_show(struct device *dev, str = pmu_attr->event_str; for (i = 0; i < x86_pmu.num_hybrid_pmus; i++)...
4c2fdf7393647a7b01a83f49c4a331d562016640
Analyze and fix the following issue in the Linux kernel code: cpufreq: pcc: Fix the potentinal scheduling delays in target_index()
Problem Details: pcc_cpufreq_target(): cpufreq_freq_transition_begin(); spin_lock(&pcc_lock); [critical section] cpufreq_freq_transition_end(); spin_unlock(&pcc_lock); Above code has a performance issue, consider that Task0 executes 'cpufreq_freq_transition_end()' to wake Task1 and preempted imediatedly without r...
```diff diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c index 84fe37def0f1..6f8b5ea7aeae 100644 --- a/drivers/cpufreq/pcc-cpufreq.c +++ b/drivers/cpufreq/pcc-cpufreq.c @@ -232,8 +232,8 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy, status = ioread16(&pcch_hdr->status); io...
61bfbf7951ba561dcbdd5357702d3cbc2d447812
Analyze and fix the following issue in the Linux kernel code: cpufreq: Fix the race condition while updating the transition_task of policy
Problem Details: The field 'transition_task' of policy structure is used to track the task which is performing the frequency transition. Using this field to print a warning once detect a case where the same task is calling _begin() again before completing the preivous frequency transition via the _end(). However, ther...
```diff diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index bd7bb0d58ef0..d9eb036245c3 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -455,8 +455,10 @@ void cpufreq_freq_transition_end(struct cpufreq_policy *policy, policy->cur, policy->cpuinfo.max_freq); ...
c69290557c7571dff3d995fa27619b965915e8a1
Analyze and fix the following issue in the Linux kernel code: regulator: tps6287x: Fix n_voltages
Problem Details: There are 256 possible voltage settings for each range, not 256 possible voltage settings in total. Fixes: 15a1cd245d5b ("regulator: tps6287x: Fix missing .n_voltages setting") Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com Link: https://lore.kernel.org/r/20230829-tps-voltages-v1-1-7ba...
```diff diff --git a/drivers/regulator/tps6287x-regulator.c b/drivers/regulator/tps6287x-regulator.c index d022184a8e7d..9b7c3d77789e 100644 --- a/drivers/regulator/tps6287x-regulator.c +++ b/drivers/regulator/tps6287x-regulator.c @@ -119,7 +119,7 @@ static struct regulator_desc tps6287x_reg = { .ramp_mask = TPS6287X...
ad6bfe1b66a5c146ec236847eca7af4c8806d666
Analyze and fix the following issue in the Linux kernel code: drm: ci: docs: fix build warning - add missing escape
Problem Details: Fix the following warning: Documentation/gpu/automated_testing.rst:55: WARNING: Inline emphasis start-string without end-string. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http...
```diff diff --git a/Documentation/gpu/automated_testing.rst b/Documentation/gpu/automated_testing.rst index 1b87b802ac7f..469b6fb65c30 100644 --- a/Documentation/gpu/automated_testing.rst +++ b/Documentation/gpu/automated_testing.rst @@ -52,7 +52,7 @@ IGT_VERSION drivers/gpu/drm/ci/testlist.txt ---------------------...
0ba5439d9afa2722e7728df56f272c89987540a4
Analyze and fix the following issue in the Linux kernel code: ksmbd: replace one-element array with flex-array member in struct smb2_ea_info
Problem Details: UBSAN complains about out-of-bounds array indexes on 1-element arrays in struct smb2_ea_info. UBSAN: array-index-out-of-bounds in fs/smb/server/smb2pdu.c:4335:15 index 1 is out of range for type 'char [1]' CPU: 1 PID: 354 Comm: kworker/1:4 Not tainted 6.5.0-rc4 #1 Hardware name: VMware, Inc. VMware Vi...
```diff diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index 2d4b8efaf19f..d12d995f52d7 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -4335,7 +4335,7 @@ static int smb2_get_ea(struct ksmbd_work *work, struct ksmbd_file *fp, if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREF...
4b081ce0d830b684fdf967abc3696d1261387254
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix slub overflow in ksmbd_decode_ntlmssp_auth_blob()
Problem Details: If authblob->SessionKey.Length is bigger than session key size(CIFS_KEY_SIZE), slub overflow can happen in key exchange codes. cifs_arc4_crypt copy to session key array from SessionKey from client. Cc: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21940 Signed-off-by: Na...
```diff diff --git a/fs/smb/server/auth.c b/fs/smb/server/auth.c index af7b2cdba126..229a6527870d 100644 --- a/fs/smb/server/auth.c +++ b/fs/smb/server/auth.c @@ -355,6 +355,9 @@ int ksmbd_decode_ntlmssp_auth_blob(struct authenticate_message *authblob, if (blob_len < (u64)sess_key_off + sess_key_len) return -EIN...
17d5b135bb720832364e8f55f6a887a3c7ec8fdb
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix wrong DataOffset validation of create context
Problem Details: If ->DataOffset of create context is 0, DataBuffer size is not correctly validated. This patch change wrong validation code and consider tag length in request. Cc: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21824 Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Sign...
```diff diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c index 6bc8a1e48171..9bc0103720f5 100644 --- a/fs/smb/server/oplock.c +++ b/fs/smb/server/oplock.c @@ -1481,7 +1481,7 @@ struct create_context *smb2_find_context_vals(void *open_req, const char *tag, i name_len < 4 || name_off + name_len ...
bf26f1b4e0918f017775edfeacf6d867204b680b
Analyze and fix the following issue in the Linux kernel code: ksmbd: Fix one kernel-doc comment
Problem Details: Fix one kernel-doc comment to silence the warning: fs/smb/server/smb2pdu.c:4160: warning: Excess function parameter 'infoclass_size' description in 'buffer_check_err' Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench...
```diff diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index 95520bf8aa16..2d4b8efaf19f 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -4156,7 +4156,6 @@ err_out2: * @reqOutputBufferLength: max buffer length expected in command response * @rsp: query info response buffer cont...
e628bf939aafb61fbc56e9bdac8795cea5127e25
Analyze and fix the following issue in the Linux kernel code: ksmbd: reduce descriptor size if remaining bytes is less than request size
Problem Details: Create 3 kinds of files to reproduce this problem. dd if=/dev/urandom of=127k.bin bs=1024 count=127 dd if=/dev/urandom of=128k.bin bs=1024 count=128 dd if=/dev/urandom of=129k.bin bs=1024 count=129 When copying files from ksmbd share to windows or cifs.ko, The following error message happen from wind...
```diff diff --git a/fs/smb/server/transport_rdma.c b/fs/smb/server/transport_rdma.c index 7f222787c52c..3b269e1f523a 100644 --- a/fs/smb/server/transport_rdma.c +++ b/fs/smb/server/transport_rdma.c @@ -1364,24 +1364,35 @@ static int smb_direct_rdma_xmit(struct smb_direct_transport *t, LIST_HEAD(msg_list); char *de...
65656f5242e500dcfeffa6a0a1519eae14724f86
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix `force create mode' and `force directory mode'
Problem Details: `force create mode' and `force directory mode' should be bitwise ORed with the perms after `create mask' and `directory mask' have been applied, respectively. Signed-off-by: Atte Heikkilä <atteh.mailbox@gmail.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@micr...
```diff diff --git a/fs/smb/server/mgmt/share_config.h b/fs/smb/server/mgmt/share_config.h index 3fd338293942..5f591751b923 100644 --- a/fs/smb/server/mgmt/share_config.h +++ b/fs/smb/server/mgmt/share_config.h @@ -34,29 +34,22 @@ struct ksmbd_share_config { #define KSMBD_SHARE_INVALID_UID ((__u16)-1) #define KSMBD_S...
041bba4414cda37d00063952c9bff9c3d5812a19
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix wrong interim response on compound
Problem Details: If smb2_lock or smb2_open request is compound, ksmbd could send wrong interim response to client. ksmbd allocate new interim buffer instead of using resonse buffer to support compound request. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
```diff diff --git a/fs/smb/server/ksmbd_work.c b/fs/smb/server/ksmbd_work.c index f49c2e01ea9f..51def3ca74c0 100644 --- a/fs/smb/server/ksmbd_work.c +++ b/fs/smb/server/ksmbd_work.c @@ -160,9 +160,11 @@ int ksmbd_iov_pin_rsp_read(struct ksmbd_work *work, void *ib, int len, return __ksmbd_iov_pin_rsp(work, ib, len, a...
0225e10972fa809728b8d4c1bd2772b3ec3fdb57
Analyze and fix the following issue in the Linux kernel code: jfs: validate max amount of blocks before allocation.
Problem Details: The lack of checking bmp->db_max_freebud in extBalloc() can lead to shift out of bounds, so this patch prevents undefined behavior, because bmp->db_max_freebud == -1 only if there is no free space. Signed-off-by: Aleksei Filippov <halip0503@gmail.com> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle...
```diff diff --git a/fs/jfs/jfs_extent.c b/fs/jfs/jfs_extent.c index adaa9ad50d4c..63d21822d309 100644 --- a/fs/jfs/jfs_extent.c +++ b/fs/jfs/jfs_extent.c @@ -311,6 +311,11 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) * blocks in the map. in that case, we'll start off with the * maximum fr...
d2045f87154bf67a50ebefe28d2ca0e1e3f8eef1
Analyze and fix the following issue in the Linux kernel code: perf jevents: Use "default_core" for events with no Unit
Problem Details: The JSON Unit field encodes the name of the PMU to match the events to. When no name is given it has meant the "cpu" core PMU except for tests. On ARM, Intel hybrid and s390 the core PMU is named differently which means that using "cpu" for this case causes the events not to get matched to the PMU. I...
```diff diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py index 712f80d7d071..a7e88332276d 100755 --- a/tools/perf/pmu-events/jevents.py +++ b/tools/perf/pmu-events/jevents.py @@ -266,7 +266,7 @@ class JsonEvent: def unit_to_pmu(unit: str) -> Optional[str]: """Convert a JSON U...
a84260e314029e6dc9904fd6eabf8d9fd7965351
Analyze and fix the following issue in the Linux kernel code: perf test stat_bpf_counters_cgrp: Enhance perf stat cgroup BPF counter test
Problem Details: It has system-wide test and cpu-list test but the cpu-list test fails sometimes. It runs sleep command on CPU1 and measure both user.slice and system.slice cgroups by default (on systemd-based systems). But if the system was idle enough, sometime the system.slice gets no count and it makes the test f...
```diff diff --git a/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh b/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh index a74440a00b6b..e75d0780dc78 100755 --- a/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh +++ b/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh @@ -60,7 +60,7 @@ check_system_wide_counted() ...
68ca249c964f520af7f8763e22f12bd26b57b870
Analyze and fix the following issue in the Linux kernel code: perf test shell stat_bpf_counters: Fix test on Intel
Problem Details: As of now, bpf counters (bperf) don't support event groups. But the default perf stat includes topdown metrics if supported (on recent Intel machines) which require groups. That makes perf stat exiting. $ sudo perf stat --bpf-counter true bpf managed perf events do not yet support groups. Actua...
```diff diff --git a/tools/perf/tests/shell/stat_bpf_counters.sh b/tools/perf/tests/shell/stat_bpf_counters.sh index 513cd1e58e0e..a87bb2814b4c 100755 --- a/tools/perf/tests/shell/stat_bpf_counters.sh +++ b/tools/perf/tests/shell/stat_bpf_counters.sh @@ -22,10 +22,10 @@ compare_number() } # skip if --bpf-counters i...
11f5710d96afcd569a7c8e00395b714bbea3ce5d
Analyze and fix the following issue in the Linux kernel code: perf test shell record_bpf_filter: Skip 6.2 kernel
Problem Details: The BPF sample filtering requires two kernel changes below: * bpf_cast_to_kernel_ctx() kfunc (added in v6.2) * setting perf_sample_data->sample_flags (finished in v6.3) The perf tools can check bpf_cast_to_kernel_ctx() easily so it can refuse BPF filters on those old kernels (v6.1 and earlier). B...
```diff diff --git a/tools/perf/tests/shell/record_bpf_filter.sh b/tools/perf/tests/shell/record_bpf_filter.sh index e76ea861b92c..31c593966e8c 100755 --- a/tools/perf/tests/shell/record_bpf_filter.sh +++ b/tools/perf/tests/shell/record_bpf_filter.sh @@ -49,6 +49,12 @@ test_bpf_filter_basic() { fi if perf script ...
c091c78b73c82f1e2811ab19b8e287ddc7807651
Analyze and fix the following issue in the Linux kernel code: libperf: Get rid of attr.id field
Problem Details: Now there's no in-tree user of the field. To remove the possible bug later, let's get rid of the 'id' field and add a comment for that. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> ...
```diff diff --git a/tools/lib/perf/include/perf/event.h b/tools/lib/perf/include/perf/event.h index e563dd8c3628..ae64090184d3 100644 --- a/tools/lib/perf/include/perf/event.h +++ b/tools/lib/perf/include/perf/event.h @@ -148,7 +148,13 @@ struct perf_record_switch { struct perf_record_header_attr { struct perf_even...
9bf63282ea77a531ea58acb42fb3f40d2d1e4497
Analyze and fix the following issue in the Linux kernel code: perf tools: Handle old data in PERF_RECORD_ATTR
Problem Details: The PERF_RECORD_ATTR is used for a pipe mode to describe an event with attribute and IDs. The ID table comes after the attr and it calculate size of the table using the total record size and the attr size. n_ids = (total_record_size - end_of_the_attr_field) / sizeof(u64) This is fine for most use ...
```diff diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 99c61cdffa54..e13f4bab7c49 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -4378,7 +4378,8 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused, union perf_event *event, struct evlis...
cd4e1efbbc4037c440b84f6be5aff8938c204c9c
Analyze and fix the following issue in the Linux kernel code: perf pmus: Skip duplicate PMUs and don't print list suffix by default
Problem Details: Add a PMUs scan that ignores duplicates. When there are multiple PMUs that differ only by suffix, by default just list the first one and skip all others. The scan routine checks that the PMU names match but doesn't enforce that the numbers are consecutive as for some PMUs there are gaps. If "-v" is pas...
```diff diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c index 8ac97a82744d..1ac47db4d66a 100644 --- a/tools/perf/builtin-list.c +++ b/tools/perf/builtin-list.c @@ -434,6 +434,13 @@ static void json_print_metric(void *ps __maybe_unused, const char *group, strbuf_release(&buf); } +static bool defa...
8d9f5146f5dae2d80217f204d9abd83ef704aa12
Analyze and fix the following issue in the Linux kernel code: perf pmus: Sort pmus by name then suffix
Problem Details: Sort PMUs by name. If two PMUs have the same name but differ by suffix, sort the suffixes numerically. For example, "breakpoint" comes before "cpu", "uncore_imc_free_running_0" comes before "uncore_imc_free_running_1". Suffixes need to be treated specially as otherwise they will be ordered like 0, 1,...
```diff diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c index 4dd5912617ff..7316da1c0ddb 100644 --- a/tools/perf/util/pmus.c +++ b/tools/perf/util/pmus.c @@ -1,8 +1,11 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/list.h> +#include <linux/list_sort.h> +#include <linux/string.h> #include <linux/...
49cf0bf6379d95fc4124adf5a5eef22ff2e1795e
Analyze and fix the following issue in the Linux kernel code: perf beauty mmap_flags: Fix script for archs that use the generic mman.h
Problem Details: To address this error: grep: /root/linux-next/tools/arch/xxxxx/include/uapi/asm//mman.h: No such file or directory Signed-off-by: Yanteng Si <siyanteng@loongson.cn> Acked-by: Huacai Chen <chenhuacai@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin...
```diff diff --git a/tools/perf/trace/beauty/mmap_flags.sh b/tools/perf/trace/beauty/mmap_flags.sh index 3022597c8c17..d035b29fc5ec 100755 --- a/tools/perf/trace/beauty/mmap_flags.sh +++ b/tools/perf/trace/beauty/mmap_flags.sh @@ -19,7 +19,7 @@ arch_mman=${arch_header_dir}/mman.h printf "static const char *mmap_flag...
7467e1da906468bcbd311023b30708193103ecf9
Analyze and fix the following issue in the Linux kernel code: drm/i915/mtl: Update workaround 14016712196
Problem Details: Now this workaround is permanent workaround on MTL and DG2, earlier we used to apply on MTL A0 step only. VLK-45480 Fixes: d922b80b1010 ("drm/i915/gt: Add workaround 14016712196") Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com> Acked-by: Nirmoy Das <nirmoy.das@intel.com> Reviewed-by: Andi Shy...
```diff diff --git a/drivers/gpu/drm/i915/gt/gen8_engine_cs.c b/drivers/gpu/drm/i915/gt/gen8_engine_cs.c index 67a6a13bf39b..7f50d02cd67f 100644 --- a/drivers/gpu/drm/i915/gt/gen8_engine_cs.c +++ b/drivers/gpu/drm/i915/gt/gen8_engine_cs.c @@ -226,8 +226,8 @@ u32 *gen12_emit_aux_table_inv(struct intel_engine_cs *engine,...
a419beac4a070aff63c520f36ebf7cb8a76a8ae5
Analyze and fix the following issue in the Linux kernel code: module/decompress: use vmalloc() for zstd decompression workspace
Problem Details: Using kmalloc() to allocate the decompression workspace for zstd may trigger the following warning when large modules are loaded (i.e., xfs): [ 2.961884] WARNING: CPU: 1 PID: 254 at mm/page_alloc.c:4453 __alloc_pages+0x2c3/0x350 ... [ 2.989033] Call Trace: [ 2.989841] <TASK> [ 2.990614] ...
```diff diff --git a/kernel/module/decompress.c b/kernel/module/decompress.c index 8a5d6d63b06c..87440f714c0c 100644 --- a/kernel/module/decompress.c +++ b/kernel/module/decompress.c @@ -241,7 +241,7 @@ static ssize_t module_zstd_decompress(struct load_info *info, } wksp_size = zstd_dstream_workspace_bound(header...
358040e3807754944dbddf948a23c6d914297ed7
Analyze and fix the following issue in the Linux kernel code: ALSA: pcm: Fix missing fixup call in compat hw_refine ioctl
Problem Details: The update of rate_num/den and msbits were factored out to fixup_unreferenced_params() function to be called explicitly after the hw_refine or hw_params procedure. It's called from snd_pcm_hw_refine_user(), but it's forgotten in the PCM compat ioctl. This ended up with the incomplete rate_num/den and ...
```diff diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index 42c2ada8e888..c96483091f30 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c @@ -253,10 +253,14 @@ static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream, goto error; } - if (refine) + if (refine)...
2429742e506a2b5939a62c629c4a46d91df0ada8
Analyze and fix the following issue in the Linux kernel code: kbuild: do not run depmod for 'make modules_sign'
Problem Details: Commit 961ab4a3cd66 ("kbuild: merge scripts/Makefile.modsign to scripts/Makefile.modinst") started to run depmod at the end of 'make modules_sign'. Move the depmod rule to scripts/Makefile.modinst and run it only when $(modules_sign_only) is empty. Fixes: 961ab4a3cd66 ("kbuild: merge scripts/Makefile...
```diff diff --git a/Makefile b/Makefile index 64c114e9ce5f..9075ad851b46 100644 --- a/Makefile +++ b/Makefile @@ -1877,7 +1877,9 @@ quiet_cmd_depmod = DEPMOD $(MODLIB) modules_install: $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst +ifndef modules_sign_only $(call cmd,depmod) +endif else # CONFIG_MODULE...
f73016b63b09edec8adf7e182600c52465c56ee7
Analyze and fix the following issue in the Linux kernel code: fuse: conditionally fill kstat in fuse_do_statx()
Problem Details: The code path fuse_update_attributes fuse_update_get_attr fuse_do_statx has the risk to use a NULL pointer for struct kstat *stat, although current callers of fuse_update_attributes() only set request_mask to values that will trigger the call of fuse_do_getattr(), which already handles th...
```diff diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index e190d09f220d..04a1c62342dc 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1219,11 +1219,14 @@ static int fuse_do_statx(struct inode *inode, struct file *file, fuse_change_attributes(inode, &attr, &outarg.stat, ATTR_TIMEOUT(&outarg), attr_versio...
823de40c94d680ec8d57a660ac96a653acadb0a5
Analyze and fix the following issue in the Linux kernel code: PCI: qcom-ep: Treat unknown IRQ events as an error
Problem Details: Sometimes, the Qcom PCIe EP controller can receive some interrupts unknown to the driver, like safety interrupts in newer SoCs. In those cases, if the driver doesn't clear the interrupts, it will end up in an interrupt storm. However, the users will not know about it because the log is treated as a deb...
```diff diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c index 0fe7f06f2102..86929a7a104e 100644 --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c @@ -593,7 +593,7 @@ static irqreturn_t qcom_pcie_ep_global_irq_thread(int irq...
9e07f8bfd959d2d09823430eab35d12182446dcf
Analyze and fix the following issue in the Linux kernel code: ASoC: cs42l43: Fix missing error code in cs42l43_codec_probe()
Problem Details: When clk_get_optional() fails, the error handling code does a 'goto err_pm' with ret = 0, which is resturning success on a failure path. Fix this by assigning the PTR_ERR(priv-mclk) to ret variable. Fixes: fc918cbe874e ("ASoC: cs42l43: Add support for the cs42l43") Signed-off-by: Harshit Mogalapalli ...
```diff diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c index 24e718e51174..1a95c370fc4c 100644 --- a/sound/soc/codecs/cs42l43.c +++ b/sound/soc/codecs/cs42l43.c @@ -2205,7 +2205,8 @@ static int cs42l43_codec_probe(struct platform_device *pdev) // Don't use devm as we need to get against the MFD ...
a47f7bf97c9836ff312b421fe392f13401c60c7b
Analyze and fix the following issue in the Linux kernel code: ASoC: cs35l45: Fix "Dead assigment" warning
Problem Details: Value stored to 'ret' is never read. Remove it. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com Link: https://lore.kernel.org/r/20230828170525.335671-2-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org
```diff diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c index aa5a54e960b0..3daec251a42d 100644 --- a/sound/soc/codecs/cs35l45.c +++ b/sound/soc/codecs/cs35l45.c @@ -969,7 +969,7 @@ static irqreturn_t cs35l45_dsp_virt2_mbox_cb(int irq, void *data) ret = regmap_read(cs35l45->regmap, CS35L45_DSP_...
524240b231ea3da914fecfff15660c4fcbfc0e8e
Analyze and fix the following issue in the Linux kernel code: drm/i915/hdcp: Propagate aux info in DP HDCP functions
Problem Details: We were propagating dig_port info to dp hdcp2 specific functions. Let us clean that up and send intel_connector in the following functions: intel_dp_hdcp2_wait_for_msg, get_receiver_id_list_rx_info, intel_dp_hdcp2_read_rx_status. This optimises mst scenarios where aux ends up being remote and not store...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c index 6cd42363837a..59ef77476cb9 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c @@ -331,10 +331,11 @@ static const struct hdcp2_dp_msg_data hdcp2...
dc3216b1416056b04712e53431f6e9aefdc83177
Analyze and fix the following issue in the Linux kernel code: super: ensure valid info
Problem Details: For keyed filesystems that recycle superblocks based on s_fs_info or information contained therein s_fs_info must be kept as long as the superblock is on the filesystem type super list. This isn't guaranteed as s_fs_info will be freed latest in sb->kill_sb(). The fix is simply to perform notification ...
```diff diff --git a/fs/super.c b/fs/super.c index 779247eb219c..ad7ac3a24d38 100644 --- a/fs/super.c +++ b/fs/super.c @@ -434,6 +434,33 @@ void put_super(struct super_block *sb) spin_unlock(&sb_lock); } +static void kill_super_notify(struct super_block *sb) +{ + lockdep_assert_not_held(&sb->s_umount); + + /* alre...
345a5c4a0b635fa3fc658e6e0cd7fd2217c667cd
Analyze and fix the following issue in the Linux kernel code: super: move lockdep assert
Problem Details: Fix braino and move the lockdep assertion after put_super() otherwise we risk a use-after-free. Fixes: 2c18a63b760a ("super: wait until we passed kill super") Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Christoph Hellwig <hch@lst.de> Message-Id: <20230828-vfs-super-fixes-v1-1-b37a4a04a88f@kernel...
```diff diff --git a/fs/super.c b/fs/super.c index ef87103e2a51..779247eb219c 100644 --- a/fs/super.c +++ b/fs/super.c @@ -570,8 +570,8 @@ static bool grab_super_dead(struct super_block *sb) return true; } wait_var_event(&sb->s_flags, wait_dead(sb)); - put_super(sb); lockdep_assert_not_held(&sb->s_umount); + p...
50011c2a245792993f2756e5b5b571512bfa409e
Analyze and fix the following issue in the Linux kernel code: KVM: VMX: Refresh available regs and IDT vectoring info before NMI handling
Problem Details: Reset the mask of available "registers" and refresh the IDT vectoring info snapshot in vmx_vcpu_enter_exit(), before KVM potentially handles a an NMI VM-Exit. One of the "registers" that KVM VMX lazily loads is the vmcs.VM_EXIT_INTR_INFO field, which is holds the vector+type on "exception or NMI" VM-E...
```diff diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index b0093b8a72d2..7625d74c056a 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -7209,13 +7209,20 @@ static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu, flags); vcpu->arch.cr2 = native_read_cr2(); + vcpu->ar...
a568d217f3d44b1b46756ab560221a823c37f2a1
Analyze and fix the following issue in the Linux kernel code: dt-bindings: vendor-prefixes: document Saef Technology
Problem Details: Document Saef Technology (https://www.saefdisplay.com/). Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230828181941.1609894-2-macroalpha82@gmail.com Signed-off-by: Rob Herring <robh@kernel.org>
```diff diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index af60bf1a6664..dda90f9d264b 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1151,6 +1151,8 @@ pat...
c63594f2d66690805eb78b75e4b8e8dc9f2672bf
Analyze and fix the following issue in the Linux kernel code: Docu: genericirq.rst: fix irq-example
Problem Details: A code example was missing the pointer to dereference a variable. Signed-off-by: Philipp Stanner <pstanner@redhat.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20230824110109.18844-1-pstanner@redhat.com
```diff diff --git a/Documentation/core-api/genericirq.rst b/Documentation/core-api/genericirq.rst index f959c9b53f61..4a460639ab1c 100644 --- a/Documentation/core-api/genericirq.rst +++ b/Documentation/core-api/genericirq.rst @@ -264,7 +264,7 @@ The following control flow is implemented (simplified excerpt):: ...
ac6804fbf425a161840c0c99737cb87ff88692a6
Analyze and fix the following issue in the Linux kernel code: Documentation: serial-console: Fix literal block marker
Problem Details: Make rendered text readable by fixing literal block marker, changing ":" to "::". Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20230825091626.354352-1-Andrei.Emeltchenko.news@gmail.com
```diff diff --git a/Documentation/admin-guide/serial-console.rst b/Documentation/admin-guide/serial-console.rst index 8c8b94e54e26..a3dfc2c66e01 100644 --- a/Documentation/admin-guide/serial-console.rst +++ b/Documentation/admin-guide/serial-console.rst @@ -59,7 +59,7 @@ times. In this case, there are the following tw...
090a7f1009b8447565a03b649189e6ff83e8e5e7
Analyze and fix the following issue in the Linux kernel code: docs/mm: remove references to hmm_mirror ops and clean typos
Problem Details: Clean typos and remove the reference to the sync_cpu_device_pagetables() callback since all hmm_mirror ops have been removed. Fixes: a22dd506400d ("mm/hmm: remove hmm_mirror and related") Signed-off-by: Marco Pagani <marpagan@redhat.com> Reviewed-by: Mika Penttilä <mpenttil@redhat.com> Reviewed-by: Ja...
```diff diff --git a/Documentation/mm/hmm.rst b/Documentation/mm/hmm.rst index fec21e6f2284..0595098a74d9 100644 --- a/Documentation/mm/hmm.rst +++ b/Documentation/mm/hmm.rst @@ -163,16 +163,7 @@ use:: It will trigger a page fault on missing or read-only entries if write access is requested (see below). Page faults...
77e0ddf097d6d4ceaf898e088b133b99e0a97fa0
Analyze and fix the following issue in the Linux kernel code: parisc: ccio-dma: Create private runway procfs root entry
Problem Details: Create an own procfs "runway" root entry for the CCIO driver. No need to share it with the sba_iommu driver, as only one of those busses can be active in one machine anyway. Signed-off-by: Helge Deller <deller@gmx.de> Reported-by: kernel test robot <lkp@intel.com> Fixes: 547259580dfa ("parisc: Move pr...
```diff diff --git a/arch/parisc/include/asm/runway.h b/arch/parisc/include/asm/runway.h index 5cf061376ddb..2837f0223d6d 100644 --- a/arch/parisc/include/asm/runway.h +++ b/arch/parisc/include/asm/runway.h @@ -2,9 +2,6 @@ #ifndef ASM_PARISC_RUNWAY_H #define ASM_PARISC_RUNWAY_H -/* declared in arch/parisc/kernel/se...
c7e151a7100eb298bb03c83c1a7372112fce2571
Analyze and fix the following issue in the Linux kernel code: dt-bindings: thermal: lmh: update maintainer address
Problem Details: The old email is no longer functioning. Fixes: 17b1362d4919 ("MAINTAINERS: Update email address") Signed-off-by: David Heidelberg <david@ixit.cz> Link: https://lore.kernel.org/r/20230823223622.91789-1-david@ixit.cz Signed-off-by: Rob Herring <robh@kernel.org>
```diff diff --git a/Documentation/devicetree/bindings/thermal/qcom-lmh.yaml b/Documentation/devicetree/bindings/thermal/qcom-lmh.yaml index 92762efc2120..5ff72ce5c887 100644 --- a/Documentation/devicetree/bindings/thermal/qcom-lmh.yaml +++ b/Documentation/devicetree/bindings/thermal/qcom-lmh.yaml @@ -8,7 +8,7 @@ $sche...
5a7319b967b66969e3fff7b91bdfbcd9acd969ac
Analyze and fix the following issue in the Linux kernel code: of: unittest: Fix of_unittest_pci_node() kconfig dependencies
Problem Details: of_unittest_pci_node test depends on both CONFIG_PCI_DYNAMIC_OF_NODES and CONFIG_OF_OVERLAY. Move the test into the existing CONFIG_OF_OVERLAY ifdef and rework the CONFIG_PCI_DYNAMIC_OF_NODES dependency to use IS_ENABLED() instead. This reduces the combinations to build. Reported-by: kernel test robot...
```diff diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 9c0f352cb241..ad2b7879cc67 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -3799,14 +3799,6 @@ err_unlock: mutex_unlock(&of_mutex); } -#else - -static inline __init void of_unittest_overlay_high_level(void) {} - -#endif - -#...
8d2a0cdf52299d1f83a7707c5ca6b0c811339aba
Analyze and fix the following issue in the Linux kernel code: ASoC: dwc: i2s: Fix unused functions
Problem Details: A few newly added functions aren't built unless CONFIG_OF is set, which result in the build failure due to defined-but-not-used errors. Put "#ifdef CONFIG_OF" around those functions to suppress the build error. Fixes: 52ea7c0543f8 ("ASoC: dwc: i2s: Add StarFive JH7110 SoC support") Link: https://lore...
```diff diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index 5ab1b3eb2d28..22c004179214 100644 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -729,6 +729,7 @@ static int dw_configure_dai_by_dt(struct dw_i2s_dev *dev, } +#ifdef CONFIG_OF /* clocks initialization with master mode on ...
11b0b802f8e38d48ca74d520028add81263f003e
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: wcd93xx: fix object added to multiple drivers
Problem Details: Three Qualcomm audio codecs (WCD9355, WCD934x and WCD938x) use the same object file wcd-clsh-v2.o leading to warnings: Makefile: wcd-clsh-v2.o is added to multiple modules: snd-soc-wcd9335 snd-soc-wcd934x snd-soc-wcd938x Convert the wcd-clsh-v2.o to a module to solve it. Signed-off-by: Krzysztof K...
```diff diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 95b5bd883215..f1e1dbc509f6 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -1968,11 +1968,15 @@ config SND_SOC_UDA1380 tristate depends on I2C +config SND_SOC_WCD_CLASSH + tristate + config SND_SOC_WCD9335 tr...
4c33bf147249ebbf3dded016996a8a24c5737254
Analyze and fix the following issue in the Linux kernel code: powerpc/mm/book3s64: Use 256M as the upper limit with coherent device memory attached
Problem Details: Commit 4d15721177d5 ("powerpc/mm: Cleanup memory block size probing") used 256MB as the memory block size when we have ibm,coherent-device-memory device tree node present. Instead of returning with 256MB memory block size, continue to check the rest of the memory regions and make sure we can still map ...
```diff diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index 9f76e109f96a..70f8e9ce412e 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c @@ -569,8 +569,12 @@ static int __init probe_memory_block_size(unsigned long node, const char *uname, */ compatible = of_get_flat_dt_p...
f1424755db913c5971686537381588261cdfd1ee
Analyze and fix the following issue in the Linux kernel code: powerpc/mm/book3s64: Fix build error with SPARSEMEM disabled
Problem Details: With CONFIG_SPARSEMEM disabled the below kernel build error is observed. arch/powerpc/mm/init_64.c:477:38: error: use of undeclared identifier 'SECTION_SIZE_BITS' CONFIG_MEMORY_HOTPLUG depends on CONFIG_SPARSEMEM and it is more clear to describe the code dependency in terms of MEMORY_HOTPLUG. Outsid...
```diff diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index d74d4a441616..9f76e109f96a 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c @@ -472,12 +472,23 @@ static int __init dt_scan_mmu_pid_width(unsigned long node, return 1; } +/* + * Outside hotplug the kernel uses th...
de0e85b29edfc68046d587c7d67bbd2bdc31b73f
Analyze and fix the following issue in the Linux kernel code: cpufreq: tegra194: remove opp table in exit hook
Problem Details: Add exit hook and remove OPP table when the device gets unregistered. This will fix the error messages when the CPU FREQ driver module is removed and then re-inserted. It also fixes these messages while onlining the first CPU from a policy whose all CPU's were previously offlined. debugfs: File 'cpu5...
```diff diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-cpufreq.c index 88df7e5a0573..88ef5e57ccd0 100644 --- a/drivers/cpufreq/tegra194-cpufreq.c +++ b/drivers/cpufreq/tegra194-cpufreq.c @@ -520,6 +520,17 @@ static int tegra194_cpufreq_offline(struct cpufreq_policy *policy) * Preserve pol...
8a1f00b753ecfdb117dc1a07e68c46d80e7923ea
Analyze and fix the following issue in the Linux kernel code: ata: pata_falcon: fix IO base selection for Q40
Problem Details: With commit 44b1fbc0f5f3 ("m68k/q40: Replace q40ide driver with pata_falcon and falconide"), the Q40 IDE driver was replaced by pata_falcon.c. Both IO and memory resources were defined for the Q40 IDE platform device, but definition of the IDE register addresses was modeled after the Falcon case, both...
```diff diff --git a/drivers/ata/pata_falcon.c b/drivers/ata/pata_falcon.c index 0904232e5e0c..4818d42f9a9a 100644 --- a/drivers/ata/pata_falcon.c +++ b/drivers/ata/pata_falcon.c @@ -122,8 +122,8 @@ static int __init pata_falcon_init_one(struct platform_device *pdev) struct resource *base_res, *ctl_res, *irq_res; s...
8be6f88b9d3fe1f6724daec4a70d6023742c9df7
Analyze and fix the following issue in the Linux kernel code: inet: fix IP_TRANSPARENT error handling
Problem Details: My recent patch forgot to change error handling for IP_TRANSPARENT socket option. WARNING: bad unlock balance detected! 6.5.0-rc7-syzkaller-01717-g59da9885767a #0 Not tainted ------------------------------------- syz-executor151/5028 is trying to release lock (sk_lock-AF_INET) at: [<ffffffff88213983>]...
```diff diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 54ad0f0d5c2d..d1c73660b844 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -1007,12 +1007,10 @@ int do_ip_setsockopt(struct sock *sk, int level, int optname, return 0; case IP_TRANSPARENT: if (!!val && !sockopt_ns_cap...
fdbeb55ebdf1d83e610303f7e5c50a4d6904b7fa
Analyze and fix the following issue in the Linux kernel code: KVM: s390: interrupt: Fix single-stepping keyless mode exits
Problem Details: kvm_s390_skey_check_enable() does not emulate any instructions, rather, it clears CPUSTAT_KSS and arranges the instruction that caused the exit (e.g., ISKE, SSKE, RRBE or LPSWE with a keyed PSW) to run again. Therefore, skip the PER check and let the instruction execution happen. Otherwise, a debugger...
```diff diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c index db222c749e5e..9f64f27f086e 100644 --- a/arch/s390/kvm/intercept.c +++ b/arch/s390/kvm/intercept.c @@ -630,8 +630,8 @@ int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu) rc = handle_partial_execution(vcpu); break; case ICPT_KSS: - ...
1ad1fa820e6424ae75d3d9f59774e40c9c7ec1e5
Analyze and fix the following issue in the Linux kernel code: KVM: s390: interrupt: Fix single-stepping userspace-emulated instructions
Problem Details: Single-stepping a userspace-emulated instruction that generates an interrupt causes GDB to land on the instruction following it instead of the respective interrupt handler. The reason is that after arranging a KVM_EXIT_S390_SIEIC exit, kvm_handle_sie_intercept() calls kvm_s390_handle_per_ifetch_icpt()...
```diff diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 0c6333b108ba..e6511608280c 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -5383,6 +5383,7 @@ long kvm_arch_vcpu_async_ioctl(struct file *filp, { struct kvm_vcpu *vcpu = filp->private_data; void __user *argp = (v...
ba853a4e1c7addc631df55535bf0b04c62dc79d8
Analyze and fix the following issue in the Linux kernel code: KVM: s390: interrupt: Fix single-stepping kernel-emulated instructions
Problem Details: Single-stepping a kernel-emulated instruction that generates an interrupt causes GDB to land on the instruction following it instead of the respective interrupt handler. The reason is that kvm_handle_sie_intercept(), after injecting the interrupt, also processes the PER event and arranges a KVM_SINGLE...
```diff diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c index e54496740859..db222c749e5e 100644 --- a/arch/s390/kvm/intercept.c +++ b/arch/s390/kvm/intercept.c @@ -583,6 +583,19 @@ static int handle_pv_notification(struct kvm_vcpu *vcpu) return handle_instruction(vcpu); } +static bool should_han...
74a439ef7b67d89d29ec7485c3aeca20a64449c5
Analyze and fix the following issue in the Linux kernel code: KVM: s390: interrupt: Fix single-stepping into program interrupt handlers
Problem Details: Currently, after single-stepping an instruction that generates a specification exception, GDB ends up on the instruction immediately following it. The reason is that vcpu_post_run() injects the interrupt and sets KVM_GUESTDBG_EXIT_PENDING, causing a KVM_SINGLESTEP exit. The interrupt is not delivered,...
```diff diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c index 954d39adf85c..e54496740859 100644 --- a/arch/s390/kvm/intercept.c +++ b/arch/s390/kvm/intercept.c @@ -228,6 +228,21 @@ static int handle_itdb(struct kvm_vcpu *vcpu) #define per_event(vcpu) (vcpu->arch.sie_block->iprcc & PGM_PER) +stat...
16631c42e6ff4f5acf30998fda6c2ea09d1adbfe
Analyze and fix the following issue in the Linux kernel code: KVM: s390: interrupt: Fix single-stepping into interrupt handlers
Problem Details: After single-stepping an instruction that generates an interrupt, GDB ends up on the second instruction of the respective interrupt handler. The reason is that vcpu_pre_run() manually delivers the interrupt, and then __vcpu_run() runs the first handler instruction using the CPUSTAT_P flag. This causes...
```diff diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 9bd0a873f3b1..85e39f472bb4 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -1392,6 +1392,7 @@ int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu) { struct kvm_s390_local_interrupt *li = ...
90ca51e8c654699b672ba61aeaa418dfb3252e5e
Analyze and fix the following issue in the Linux kernel code: r8169: fix ASPM-related issues on a number of systems with NIC version from RTL8168h
Problem Details: This effectively reverts 4b5f82f6aaef. On a number of systems ASPM L1 causes tx timeouts with RTL8168h, see referenced bug report. Fixes: 4b5f82f6aaef ("r8169: enable ASPM L1/L1.1 from RTL8168h") Cc: stable@vger.kernel.org Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217814 Signed-off-by: Heine...
```diff diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 5eb50b265c0b..6351a2dc13bc 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -5239,13 +5239,9 @@ static int rtl_init_one(struct pci_dev *pdev, const st...
ec1b90886f3cd7e90d4c0381dffb418e2d3a1473
Analyze and fix the following issue in the Linux kernel code: ethernet: tg3: remove unreachable code
Problem Details: 'tp->irq_max' value is either 1 [L16336] or 5 [L16354], as indicated in tg3_get_invariants(). Therefore, 'i' can't exceed 4 in tg3_init_one() that makes (i <= 4) always true. Moreover, 'intmbx' value set at the last iteration is not used later in it's scope. Found by Linux Verification Center (linuxte...
```diff diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index cb2810f175cc..5408ed051772 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -17795,10 +17795,7 @@ static int tg3_init_one(struct pci_dev *pdev, tnapi->tx_pending = TG3_DEF...
28d18b673ffa2d13112ddb6e4c32c60d9b0cda50
Analyze and fix the following issue in the Linux kernel code: net: Fix skb consume leak in sch_handle_egress
Problem Details: Fix a memory leak for the tc egress path with TC_ACT_{STOLEN,QUEUED,TRAP}: [...] unreferenced object 0xffff88818bcb4f00 (size 232): comm "softirq", pid 0, jiffies 4299085078 (age 134.028s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 8...
```diff diff --git a/net/core/dev.c b/net/core/dev.c index 17e6281e408c..9f6ed6d97f89 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4061,6 +4061,7 @@ egress_verdict: case TC_ACT_STOLEN: case TC_ACT_QUEUED: case TC_ACT_TRAP: + consume_skb(skb); *ret = NET_XMIT_SUCCESS; return NULL; } ```
977ad86c2a1bcaf58f01ab98df5cc145083c489c
Analyze and fix the following issue in the Linux kernel code: dccp: Fix out of bounds access in DCCP error handler
Problem Details: There was a previous attempt to fix an out-of-bounds access in the DCCP error handlers, but that fix assumed that the error handlers only want to access the first 8 bytes of the DCCP header. Actually, they also look at the DCCP sequence number, which is stored beyond 8 bytes, so an explicit pskb_may_pu...
```diff diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index a545ad71201c..a5361fb7a415 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -255,12 +255,17 @@ static int dccp_v4_err(struct sk_buff *skb, u32 info) int err; struct net *net = dev_net(skb->dev); - /* Only need dccph_dport & dccph_sport which are th...
72dd7e427e16fca901daaa399e4b0893c3bb85c0
Analyze and fix the following issue in the Linux kernel code: dt-bindings: net: dsa: marvell: fix wrong model in compatibility list
Problem Details: Fix wrong switch name in compatibility list. 88E6163 switch does not exist and is in fact 88E6361 Fixes: 9229a9483d80 ("dt-bindings: net: dsa: marvell: add MV88E6361 switch to compatibility list") Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Acke...
```diff diff --git a/Documentation/devicetree/bindings/net/dsa/marvell.txt b/Documentation/devicetree/bindings/net/dsa/marvell.txt index 33726134f5c9..6ec0c181b6db 100644 --- a/Documentation/devicetree/bindings/net/dsa/marvell.txt +++ b/Documentation/devicetree/bindings/net/dsa/marvell.txt @@ -20,7 +20,7 @@ which is at...
5ee473bbf43086f23eb2cd1b5a50498438e296a6
Analyze and fix the following issue in the Linux kernel code: platform/x86/amd/pmc: Fix build error with randconfig
Problem Details: on x86_64: CONFIG_SUSPEND is not set CONFIG_PM is not set this leads to build failure of the AMD PMC driver. Add a 'depends on' in the Kconfig. Reported-by: Randy Dunlap <rdunlap@infradead.org> Closes: https://lore.kernel.org/lkml/5181685c-29d8-22a4-a2d7-682f26e2e031@infradead.org/ Signed-off-by: Sh...
```diff diff --git a/drivers/platform/x86/amd/pmc/Kconfig b/drivers/platform/x86/amd/pmc/Kconfig index 8db9e82de00b..883c0a95ac0c 100644 --- a/drivers/platform/x86/amd/pmc/Kconfig +++ b/drivers/platform/x86/amd/pmc/Kconfig @@ -6,6 +6,7 @@ config AMD_PMC tristate "AMD SoC PMC driver" depends on ACPI && PCI && RTC_C...