id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
cf007647475b5090819c5fe8da771073145c7334
Analyze and fix the following issue in the Linux kernel code: ARM: ptrace: Restore syscall restart tracing
Problem Details: Since commit 4e57a4ddf6b0 ("ARM: 9107/1: syscall: always store thread_info->abi_syscall"), the seccomp selftests "syscall_restart" has been broken. This was caused by the restart syscall not being stored to "abi_syscall" during restart setup before branching to the "local_restart" label. Tracers would ...
```diff diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index bcc4c9ec3aa4..5c31e9de7a60 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -90,6 +90,7 @@ slow_work_pending: cmp r0, #0 beq no_work_pending movlt scno, #(__NR_restart_syscall - __NR_SYSCA...
0fd23db0cc74cf6d28d26ce5e7802e982608d830
Analyze and fix the following issue in the Linux kernel code: net/mlx5: Fix mlx5_cmd_update_root_ft() error flow
Problem Details: The cited patch change mlx5_cmd_update_root_ft() to work with multiple peer devices. However, it didn't align the error flow as well. Hence, Fix the error code to work with multiple peer devices. Fixes: 222dd185833e ("{net/RDMA}/mlx5: introduce lag_for_each_peer") Signed-off-by: Shay Drory <shayd@nvid...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c index aab7059bf6e9..244cfd470903 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c @@ -245,12 +245,20 @@ static int mlx5_cmd_update_...
34a79876d9f77e971115236bcf7b5d14a8ecf542
Analyze and fix the following issue in the Linux kernel code: net/mlx5e: XDP, Fix fifo overrun on XDP_REDIRECT
Problem Details: Before this fix, running high rate traffic through XDP_REDIRECT with multibuf could overrun the fifo used to release the xdp frames after tx completion. This resulted in corrupted data being consumed on the free side. The culplirt was a miscalculation of the fifo size: the maximum ratio between fifo e...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h index 9e8e6184f9e4..ecfe93a479da 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h @@ -84,6 +84,8 @@ enum mlx5e_xdp_xmit_mode { * ...
c4d6b5438116c184027b2e911c0f2c7c406fb47c
Analyze and fix the following issue in the Linux kernel code: tracing/synthetic: Allocate one additional element for size
Problem Details: While debugging another issue I noticed that the stack trace contains one invalid entry at the end: <idle>-0 [008] d..4. 26.484201: wake_lat: pid=0 delta=2629976084 000000009cc24024 stack=STACK: => __schedule+0xac6/0x1a98 => schedule+0x126/0x2c0 => schedule_timeout+0x150/0x2c0 => kcompactd+0x...
```diff diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c index 80a2a832f857..9897d0bfcab7 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -528,7 +528,8 @@ static notrace void trace_event_raw_event_synth(void *__data, str_val = (char *)(long)...
887f92e09ef34a949745ad26ce82be69e2dabcf6
Analyze and fix the following issue in the Linux kernel code: tracing/synthetic: Skip first entry for stack traces
Problem Details: While debugging another issue I noticed that the stack trace output contains the number of entries on top: <idle>-0 [000] d..4. 203.322502: wake_lat: pid=0 delta=2268270616 stack=STACK: => 0x10 => __schedule+0xac6/0x1a98 => schedule+0x126/0x2c0 => schedule_timeout+0x242/0x2c0 => __wai...
```diff diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c index 7fff8235075f..80a2a832f857 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -350,7 +350,7 @@ static enum print_line_t print_synth_event(struct trace_iterator *iter, struct trace_se...
ddeea494a16f32522bce16ee65f191d05d4b8282
Analyze and fix the following issue in the Linux kernel code: tracing/synthetic: Use union instead of casts
Problem Details: The current code uses a lot of casts to access the fields member in struct synth_trace_events with different sizes. This makes the code hard to read, and had already introduced an endianness bug. Use a union and struct instead. Link: https://lkml.kernel.org/r/20230816154928.4171614-2-svens@linux.ibm....
```diff diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h index 3930e676436c..1e8bbdb8da90 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h @@ -59,6 +59,17 @@ int trace_raw_output_prep(struct trace_iterator *iter, extern __printf(2, 3) void trace_event_printf(struct ...
864bcaa38ee44ec6c0e43f79c2d2997b977e26b2
Analyze and fix the following issue in the Linux kernel code: x86/cpu/kvm: Provide UNTRAIN_RET_VM
Problem Details: Similar to how it doesn't make sense to have UNTRAIN_RET have two untrain calls, it also doesn't make sense for VMEXIT to have an extra IBPB call. This cures VMEXIT doing potentially unret+IBPB or double IBPB. Also, the (SEV) VMEXIT case seems to have been overlooked. Redefine the meaning of the synt...
```diff diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 5285c8e93dff..c55cc243592e 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -299,6 +299,17 @@ #endif .endm +.macro UNTRAIN_RET_VM +#if defined(CONFIG_CPU_UNRET_ENTRY)...
e7c25c441e9e0fa75b4c83e0b26306b702cfe90d
Analyze and fix the following issue in the Linux kernel code: x86/cpu: Cleanup the untrain mess
Problem Details: Since there can only be one active return_thunk, there only needs be one (matching) untrain_ret. It fundamentally doesn't make sense to allow multiple untrain_ret at the same time. Fold all the 3 different untrain methods into a single (temporary) helper stub. Fixes: fb3bd914b3ec ("x86/srso: Add a Sp...
```diff diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index f7c337515d1e..5285c8e93dff 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -272,9 +272,9 @@ .endm #ifdef CONFIG_CPU_UNRET_ENTRY -#define CALL_ZEN_UNTRAIN_RET "call r...
d43490d0ab824023e11d0b57d0aeec17a6e0ca13
Analyze and fix the following issue in the Linux kernel code: x86/cpu: Clean up SRSO return thunk mess
Problem Details: Use the existing configurable return thunk. There is absolute no justification for having created this __x86_return_thunk alternative. To clarify, the whole thing looks like: Zen3/4 does: srso_alias_untrain_ret: nop2 lfence jmp srso_alias_return_thunk int3 srso_alias_safe_ret: // al...
```diff diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index b3625cceb2f0..5ed78ad9f274 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -347,9 +347,14 @@ extern void __x86_return_thunk(void); static inline void __x86_return_thunk...
8d036427f0042a91136e6f19a39542eedec4e96c
Analyze and fix the following issue in the Linux kernel code: drm/amd/pm: Fix temperature unit of SMU v13.0.6
Problem Details: Temperature needs to be reported in millidegree Celsius. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Yang Wang <kevinyang.wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c index fe4ee2daa5d8..4fafcfbe3e5f 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c @@ -708,16 +708,19 @@ static int ...
6a92761a86817ad15c9a562e2a809386237fae3e
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/pm: fix throttle_status for other than MP1 11.0.7
Problem Details: Use the right metrics table version based on the firmware. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2720 Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Umio Yasuno <coelacanth_dream@protonmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.o...
```diff diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c index 0cda3b276f61..f0800c0c5168 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c @@ -588,7 +588,9 @@ e...
ebdfefc09c6de7897962769bd3e63a2ff443ebf5
Analyze and fix the following issue in the Linux kernel code: io_uring/sqpoll: fix io-wq affinity when IORING_SETUP_SQPOLL is used
Problem Details: If we setup the ring with SQPOLL, then that polling thread has its own io-wq setup. This means that if the application uses IORING_REGISTER_IOWQ_AFF to set the io-wq affinity, we should not be setting it for the invoking task, but rather the sqpoll task. Add an sqpoll helper that parks the thread and ...
```diff diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c index 2da0b1ba6a56..62f345587df5 100644 --- a/io_uring/io-wq.c +++ b/io_uring/io-wq.c @@ -1306,13 +1306,16 @@ static int io_wq_cpu_offline(unsigned int cpu, struct hlist_node *node) return __io_wq_cpu_online(wq, cpu, false); } -int io_wq_cpu_affinity(struct ...
5450be6befc63670f2c05aa6773a8e437b39a3fe
Analyze and fix the following issue in the Linux kernel code: selftests/ftrace: Add a basic testcase for snapshot
Problem Details: This testcase is constrived to reproduce a problem that the cpu buffers become unavailable which is due to 'record_disabled' of array_buffer and max_buffer being messed up. Local test result after bugfix: # ./ftracetest test.d/00basic/snapshot1.tc === Ftrace unit tests === [1] Snapshot and traci...
```diff diff --git a/tools/testing/selftests/ftrace/test.d/00basic/snapshot1.tc b/tools/testing/selftests/ftrace/test.d/00basic/snapshot1.tc new file mode 100644 index 000000000000..63b76cf2a360 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/00basic/snapshot1.tc @@ -0,0 +1,31 @@ +#!/bin/sh +# SPDX-License-Id...
b71645d6af10196c46cbe3732de2ea7d36b3ff6d
Analyze and fix the following issue in the Linux kernel code: tracing: Fix cpu buffers unavailable due to 'record_disabled' missed
Problem Details: Trace ring buffer can no longer record anything after executing following commands at the shell prompt: # cd /sys/kernel/tracing # cat tracing_cpumask fff # echo 0 > tracing_cpumask # echo 1 > snapshot # echo fff > tracing_cpumask # echo 1 > tracing_on # echo "hello world" > trace_mark...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index b8870078ef58..b0e8eb6ea8ac 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5277,11 +5277,17 @@ int tracing_set_cpumask(struct trace_array *tr, !cpumask_test_cpu(cpu, tracing_cpumask_new)) { atomic_inc(&per_cpu_ptr(tr->array...
cd24e2a60af633f157d7e59c0a6dba64f131c0b1
Analyze and fix the following issue in the Linux kernel code: vfio/type1: fix cap_migration information leak
Problem Details: Fix an information leak where an uninitialized hole in struct vfio_iommu_type1_info_cap_migration on the stack is exposed to userspace. The definition of struct vfio_iommu_type1_info_cap_migration contains a hole as shown in this pahole(1) output: struct vfio_iommu_type1_info_cap_migration { ...
```diff diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index ebe0ad31d0b0..d662aa9d1b4b 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -2732,7 +2732,7 @@ static int vfio_iommu_iova_build_caps(struct vfio_iommu *iommu, static int vfio_iommu_migratio...
207746550262e81b1e360d003a67f7ef7bacfbae
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix error checks of mptcp open_and_load
Problem Details: Return libbpf_get_error(), instead of -EIO, for the error from mptcp_sock__open_and_load(). Load success means prog_fd and map_fd are always valid. So drop these unneeded ASSERT_GE checks for them in mptcp run_test(). Acked-by: Yonghong Song <yonghong.song@linux.dev> Signed-off-by: Geliang Tang <geli...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index 76afb5191772..3d3999067e27 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -118,24 +118,14 @@ static int run_test(int cgroup_fd, ...
f7bb242601deae2bb62db40ce4edea9a6193d0d2
Analyze and fix the following issue in the Linux kernel code: drivers: base: test: Add missing MODULE_* macros to root device tests
Problem Details: Commit 06188bc80ccb ("drivers: base: Add basic devm tests for root devices") introduced a new set of tests for root devices that could be compiled as a module, but didn't have the usual module macros. Make sure they're there. Fixes: 06188bc80ccb ("drivers: base: Add basic devm tests for root devices"...
```diff diff --git a/drivers/base/test/root-device-test.c b/drivers/base/test/root-device-test.c index 780d07455f57..9aea23c9123e 100644 --- a/drivers/base/test/root-device-test.c +++ b/drivers/base/test/root-device-test.c @@ -106,3 +106,7 @@ static struct kunit_suite root_device_devm_test_suite = { }; kunit_test_s...
f71b144e3e7a490d9140045680b7025382fb33b5
Analyze and fix the following issue in the Linux kernel code: drivers: base: test: Add missing MODULE_* macros for platform devices tests
Problem Details: Commit b4cc44301b9d ("drivers: base: Add basic devm tests for platform devices") introduced a new set of tests for platform devices that could be compiled as a module, but didn't have the usual module macros. Make sure they're there. Fixes: b4cc44301b9d ("drivers: base: Add basic devm tests for platf...
```diff diff --git a/drivers/base/test/platform-device-test.c b/drivers/base/test/platform-device-test.c index 1ae5ce8bd366..ea05b8785743 100644 --- a/drivers/base/test/platform-device-test.c +++ b/drivers/base/test/platform-device-test.c @@ -218,3 +218,7 @@ static struct kunit_suite platform_device_devm_test_suite = {...
9a4087fab303e7923ab839a6fe35059659a54649
Analyze and fix the following issue in the Linux kernel code: vfio: Commonize combine_ranges for use in other VFIO drivers
Problem Details: Currently only Mellanox uses the combine_ranges function. The new pds_vfio driver also needs this function. So, move it to a common location for other vendor drivers to use. Also, fix RCT ordering while moving/renaming the function. Cc: Yishai Hadas <yishaih@nvidia.com> Signed-off-by: Brett Creeley <...
```diff diff --git a/drivers/vfio/pci/mlx5/cmd.c b/drivers/vfio/pci/mlx5/cmd.c index deed156e6165..7f6c51992a15 100644 --- a/drivers/vfio/pci/mlx5/cmd.c +++ b/drivers/vfio/pci/mlx5/cmd.c @@ -732,52 +732,6 @@ void mlx5fv_cmd_clean_migf_resources(struct mlx5_vf_migration_file *migf) mlx5vf_cmd_dealloc_pd(migf); } -s...
438cf3271ca116253cffb8edce8aba0191327682
Analyze and fix the following issue in the Linux kernel code: drm/panel: simple: Fix Innolux G156HCE-L01 LVDS clock
Problem Details: This panel has been implemented in commit eae7488814b5 ("drm/panel-simple: Add Innolux G156HCE-L01 panel entry") with a higher clock than the typical one mentioned on the documentation to avoid flickering on the unit tested. Testing on a different unit shows that the panel actually works with the inten...
```diff diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 72cef64441a6..1b50d17bebe0 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -2377,7 +2377,7 @@ static const struct panel_desc innolux_g121x1_l03 = { }; static const s...
fbf4dec702774286db409815ffb077711a96b824
Analyze and fix the following issue in the Linux kernel code: selftests/futex: Order calls to futex_lock_pi
Problem Details: Observed occassional failures in the futex_wait_timeout test: ok 1 futex_wait relative succeeds ok 2 futex_wait_bitset realtime succeeds ok 3 futex_wait_bitset monotonic succeeds ok 4 futex_wait_requeue_pi realtime succeeds ok 5 futex_wait_requeue_pi monotonic succeeds not ok 6 futex_lock_pi realtime ...
```diff diff --git a/tools/testing/selftests/futex/functional/futex_wait_timeout.c b/tools/testing/selftests/futex/functional/futex_wait_timeout.c index 3651ce17beeb..d183f878360b 100644 --- a/tools/testing/selftests/futex/functional/futex_wait_timeout.c +++ b/tools/testing/selftests/futex/functional/futex_wait_timeout...
b0654e64dbaf62f565b5f2b4fbd92202e88dcba3
Analyze and fix the following issue in the Linux kernel code: virtchnl: fix fake 1-elem arrays for structures allocated as `nents`
Problem Details: Finally, fix 3 structures which are allocated technically correctly, i.e. the calculated size equals to the one that struct_size() would return, except for sizeof(). For &virtchnl_vlan_filter_list_v2, use the same approach when there are no enough space as taken previously for &virtchnl_vlan_filter_lis...
```diff diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index a6983c2d7c30..8ea1a238dcef 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -506,6 +506,7 @@ i40e_config_rdma_qvli...
ebce9f6623a7856c422093430f919d1c7374c608
Analyze and fix the following issue in the Linux kernel code: dt-bindings: PCI: dwc: rockchip: Fix interrupt-names issue
Problem Details: The RK356x (and RK3588) have 5 ganged interrupts. For example the "legacy" interrupt combines "inta/intb/intc/intd" with a register providing the details, which specific interrupt triggered. The interrupts from the second level are part of the Synopsys DW PCIe System Information Interface (SII). Some o...
```diff diff --git a/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml b/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml index a4f61ced5e88..7836b9a5547c 100644 --- a/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml @@ -1...
5e7f59fa07f86f554c301c7a383bba54d5ef9819
Analyze and fix the following issue in the Linux kernel code: virtchnl: fix fake 1-elem arrays in structures allocated as `nents + 1`
Problem Details: There are five virtchnl structures, which are allocated and checked in the code as `nents + 1`, meaning that they always have memory for one excessive element regardless of their actual number. This comes from that their sizeof() includes space for 1 element and then they get allocated via struct_size(...
```diff diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index 98aca9f8b602..a6983c2d7c30 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -2103,7 +2103,7 @@ static int i40e_vc_...
dd2e84bb3804103ad1c26a21deb4b35b0e166746
Analyze and fix the following issue in the Linux kernel code: virtchnl: fix fake 1-elem arrays in structs allocated as `nents + 1` - 1
Problem Details: The two most problematic virtchnl structures are virtchnl_rss_key and virtchnl_rss_lut. Their "flex" arrays have the type of u8, thus, when allocating / checking, the actual size is calculated as `sizeof + nents - 1 byte`. But their sizeof() is not 1 byte larger than the size of such structure with pro...
```diff diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c index be3c007ce90a..10f03054a603 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c @@ -1085,8 +1085,7 @@ void iavf_set_rss_key(struct ia...
9bc6fc3304d89f19c028cb4a8d6af94f9e5faeb0
Analyze and fix the following issue in the Linux kernel code: ext2: dump current reservation window info
Problem Details: There's report BUG in 'ext2_try_to_allocate_with_rsv()', although there's now dump of all reservation windows information. But there's unknown which window is being processed.So this is not helpful for locating the issue. To better analyze the problem, dump the information about reservation window that...
```diff diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index dd74c77a4ac1..424b277f31ff 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -1133,8 +1133,13 @@ ext2_try_to_allocate_with_rsv(struct super_block *sb, unsigned int group, if ((my_rsv->rsv_start > group_last_block) || (my_rsv->rsv_end < group...
83f99de1b7c0dcfa42b211e5e40334b7ad786b36
Analyze and fix the following issue in the Linux kernel code: ext2: fix race between setxattr and write back
Problem Details: There's an issue when allocating xattrs as follows: Block Allocation Reservation Windows Map (ext2_try_to_allocate_with_rsv): reservation window 0x000000006f105382 start: 0, end: 0 reservation window 0x000000008fd1a555 start: 1044, end: 1059 Window map complete. kernel BUG at fs/ext2/balloc.c:1158! inv...
```diff diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index a9648c3137db..dd74c77a4ac1 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -1244,15 +1244,15 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal, es = EXT2_SB(sb)->s_es; ext2_debug("goal=%lu.\n", goal); /* - * Allocate a bl...
f4283bc7e38ac89d0c6c0ae188464d3769bec098
Analyze and fix the following issue in the Linux kernel code: drivers/rnbd: restore sysfs interface to rnbd-client
Problem Details: Commit 137380c0ec40 renamed 'rnbd-client' to 'rnbd_client', this changed sysfs interface to /sys/devices/virtual/rnbd_client/ctl/map_device from /sys/devices/virtual/rnbd-client/ctl/map_device. CC: Ivan Orlov <ivan.orlov0322@gmail.com> CC: "Md. Haris Iqbal" <haris.iqbal@ionos.com> CC: Jack Wang <jinpu...
```diff diff --git a/drivers/block/rnbd/rnbd-clt-sysfs.c b/drivers/block/rnbd/rnbd-clt-sysfs.c index c36d8b1ceeed..39887556cf95 100644 --- a/drivers/block/rnbd/rnbd-clt-sysfs.c +++ b/drivers/block/rnbd/rnbd-clt-sysfs.c @@ -25,7 +25,7 @@ static struct device *rnbd_dev; static const struct class rnbd_dev_class = { - ...
2f2beb8874cb0844e84ad26e990f05f4f13ff63f
Analyze and fix the following issue in the Linux kernel code: i40e: fix misleading debug logs
Problem Details: Change "write" into the actual "read" word. Change parameters description. Fixes: 7073f46e443e ("i40e: Add AQ commands for NVM Update for X722") Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Andrii Staikov <andrii.staikov@intel.com> Signed-off-by: Tony Nguyen <antho...
```diff diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c index 9da0c87f0328..f99c1f7fec40 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c +++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c @@ -210,11 +210,11 @@ read_nvm_exit: * @hw: pointer to the HW structure...
751969e5b1196821ef78f0aa664a8a97c92c9057
Analyze and fix the following issue in the Linux kernel code: iavf: fix FDIR rule fields masks validation
Problem Details: Return an error if a field's mask is neither full nor empty. When a mask is only partial the field is not being used for rule programming but it gives a wrong impression it is used. Fix by returning an error on any partial mask to make it clear they are not supported. The ip_ver assignment is moved ear...
```diff diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c index 460ca561819a..a34303ad057d 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c @@ -1289,6 +1289,7 @@ iavf_add_fdir_fltr_info(struct iavf...
3e00123a13d824d63072b1824c9da59cd78356d9
Analyze and fix the following issue in the Linux kernel code: printk: export symbols for debug modules
Problem Details: the module is out-of-tree, it saves kernel logs when panic Signed-off-by: Enlin Mu <enlin.mu@unisoc.com> Acked-by: Petr Mladek <pmladek@suse.com> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20230815020711.2604...
```diff diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 9644f6e5bf15..accfd326e7a1 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -536,12 +536,14 @@ char *log_buf_addr_get(void) { return log_buf; } +EXPORT_SYMBOL_GPL(log_buf_addr_get); /* Return log buffer size */ u32 log...
0aa35162d2a1ed7ae5303b8d91f7290d3b8b9219
Analyze and fix the following issue in the Linux kernel code: bpf: Fix uninitialized symbol in bpf_perf_link_fill_kprobe()
Problem Details: The commit 1b715e1b0ec5 ("bpf: Support ->fill_link_info for perf_event") leads to the following Smatch static checker warning: kernel/bpf/syscall.c:3416 bpf_perf_link_fill_kprobe() error: uninitialized symbol 'type'. That can happens when uname is NULL. So fix it by verifying the uname when w...
```diff diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 7f4e8c357a6a..cb658543bdb4 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -3378,14 +3378,13 @@ static int bpf_perf_link_fill_common(const struct perf_event *event, if (!ulen ^ !uname) return -EINVAL; - if (!uname) - return 0...
ca09f772cccaeec4cd05a21528c37a260aa2dd2c
Analyze and fix the following issue in the Linux kernel code: riscv: Handle zicsr/zifencei issue between gcc and binutils
Problem Details: Binutils-2.38 and GCC-12.1.0 bumped[0][1] the default ISA spec to the newer 20191213 version which moves some instructions from the I extension to the Zicsr and Zifencei extensions. So if one of the binutils and GCC exceeds that version, we should explicitly specifying Zicsr and Zifencei via -march to ...
```diff diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 4c07b9189c86..10e7a7ad175a 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -570,24 +570,30 @@ config TOOLCHAIN_HAS_ZIHINTPAUSE config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI def_bool y # https://sourceware.org/git/?p=binutils-gdb.git;a=...
4b05b993900dd3eba0fc83ef5c5ddc7d65d786c6
Analyze and fix the following issue in the Linux kernel code: riscv: uaccess: Return the number of bytes effectively not copied
Problem Details: It was reported that the riscv kernel hangs while executing the test in [1]. Indeed, the test hangs when trying to write a buffer to a file. The problem is that the riscv implementation of raw_copy_from_user() does not return the correct number of bytes not written when an exception happens and is fix...
```diff diff --git a/arch/riscv/lib/uaccess.S b/arch/riscv/lib/uaccess.S index ec486e5369d9..09b47ebacf2e 100644 --- a/arch/riscv/lib/uaccess.S +++ b/arch/riscv/lib/uaccess.S @@ -17,8 +17,11 @@ ENTRY(__asm_copy_from_user) li t6, SR_SUM csrs CSR_STATUS, t6 - /* Save for return value */ - mv t5, a2 + /* + * Save t...
f117ae55b0198dd6fc36ce521e06d8b44a4bb203
Analyze and fix the following issue in the Linux kernel code: include: riscv: Fix wrong include guard in riscv_pmu.h
Problem Details: The current include guard prevents the inclusion of asm/perf_event.h which uses the same include guard: fix the one in riscv_pmu.h so that it matches the file name. Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Andrew Jones ...
```diff diff --git a/include/linux/perf/riscv_pmu.h b/include/linux/perf/riscv_pmu.h index 43fc892aa7d9..9f70d94942e0 100644 --- a/include/linux/perf/riscv_pmu.h +++ b/include/linux/perf/riscv_pmu.h @@ -6,8 +6,8 @@ * */ -#ifndef _ASM_RISCV_PERF_EVENT_H -#define _ASM_RISCV_PERF_EVENT_H +#ifndef _RISCV_PMU_H +#defi...
366d259ff597e81d90639ae21269b3f82cd4ebb7
Analyze and fix the following issue in the Linux kernel code: perf: Fix wrong comment about default event_idx
Problem Details: Since commit c719f56092ad ("perf: Fix and clean up initialization of pmu::event_idx"), event_idx default implementation has returned 0, not idx + 1, so fix the comment that can be misleading. Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Re...
```diff diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 2166a69e3bf2..1269c96bc3b6 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -445,7 +445,8 @@ struct pmu { /* * Will return the value for perf_event_mmap_page::index for this event, - * if no implementat...
ebc9cb03b21e263db607a7604134a195aa314ebb
Analyze and fix the following issue in the Linux kernel code: riscv: stack: Fixup independent softirq stack for CONFIG_FRAME_POINTER=n
Problem Details: The independent softirq stack uses s0 to save & restore sp, but s0 would be corrupted when CONFIG_FRAME_POINTER=n. So add s0 in the clobber list to fix the problem. Fixes: dd69d07a5a6c ("riscv: stack: Support HAVE_SOFTIRQ_ON_OWN_STACK") Cc: stable@vger.kernel.org Reported-by: Zhangjin Wu <falcon@tinyl...
```diff diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c index d0577cc6a081..a8efa053c4a5 100644 --- a/arch/riscv/kernel/irq.c +++ b/arch/riscv/kernel/irq.c @@ -84,6 +84,9 @@ void do_softirq_own_stack(void) : [sp] "r" (sp) : "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3"...
8d0be64154cf24660a947b84340e8d5bb1af855a
Analyze and fix the following issue in the Linux kernel code: riscv: stack: Fixup independent irq stack for CONFIG_FRAME_POINTER=n
Problem Details: The independent irq stack uses s0 to save & restore sp, but s0 would be corrupted when CONFIG_FRAME_POINTER=n. So add s0 in the clobber list to fix the problem. Fixes: 163e76cc6ef4 ("riscv: stack: Support HAVE_IRQ_EXIT_ON_IRQ_STACK") Cc: stable@vger.kernel.org Reported-by: Zhangjin Wu <falcon@tinylab....
```diff diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 729f79c97e2b..f798c853bede 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -372,6 +372,9 @@ asmlinkage void noinstr do_irq(struct pt_regs *regs) : [sp] "r" (sp), [regs] "r" (regs) : "a0", "a1", "a2", "a3", "...
79bc3f85c51fc352f8e684ba6b626f677a3aa230
Analyze and fix the following issue in the Linux kernel code: riscv: correct riscv_insn_is_c_jr() and riscv_insn_is_c_jalr()
Problem Details: The instructions c.jr and c.jalr must have rs1 != 0, but riscv_insn_is_c_jr() and riscv_insn_is_c_jalr() do not check for this. So, riscv_insn_is_c_jr() can match a reserved encoding, while riscv_insn_is_c_jalr() can match the c.ebreak instruction. Rewrite them with check for rs1 != 0. Signed-off-by:...
```diff diff --git a/arch/riscv/include/asm/insn.h b/arch/riscv/include/asm/insn.h index 4e1505cef8aa..fce00400c9bc 100644 --- a/arch/riscv/include/asm/insn.h +++ b/arch/riscv/include/asm/insn.h @@ -110,6 +110,7 @@ #define RVC_INSN_FUNCT4_OPOFF 12 #define RVC_INSN_FUNCT3_MASK GENMASK(15, 13) #define RVC_INSN_FUNCT3_...
52449c17bdd1540940e21511612b58acebc49c06
Analyze and fix the following issue in the Linux kernel code: riscv: entry: set a0 = -ENOSYS only when syscall != -1
Problem Details: When we test seccomp with 6.4 kernel, we found errno has wrong value. If we deny NETLINK_AUDIT with EAFNOSUPPORT, after f0bddf50586d, we will get ENOSYS instead. We got same result with commit 9c2598d43510 ("riscv: entry: Save a0 prior syscall_enter_from_user_mode()"). After analysing code, we think t...
```diff diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index f910dfccbf5d..729f79c97e2b 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -297,7 +297,7 @@ asmlinkage __visible __trap_section void do_trap_break(struct pt_regs *regs) asmlinkage __visible __trap_section void do...
e88076348425b7d0491c8c98d8732a7df8de7aa3
Analyze and fix the following issue in the Linux kernel code: ext2: fix datatype of block number in ext2_xattr_set2()
Problem Details: I run a small server that uses external hard drives for backups. The backup software I use uses ext2 filesystems with 4KiB block size and the server is running SELinux and therefore relies on xattr. I recently upgraded the hard drives from 4TB to 12TB models. I noticed that after transferring some TBs ...
```diff diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index 8906ba479aaf..89517937d36c 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c @@ -742,10 +742,10 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh, /* We need to allocate a new block */ ext2_fsblk_t goal = ext2_group_first_block_no(sb...
e21ac64e669e960688e79bf5babeed63132dac8a
Analyze and fix the following issue in the Linux kernel code: regulator: raa215300: Fix resource leak in case of error
Problem Details: The clk_register_clkdev() allocates memory by calling vclkdev_alloc() and this memory is not freed in the error path. Similarly, resources allocated by clk_register_fixed_rate() are not freed in the error path. Fix these issues by using devm_clk_hw_register_fixed_rate() and devm_clk_hw_register_clkdev...
```diff diff --git a/drivers/regulator/raa215300.c b/drivers/regulator/raa215300.c index 848a03a2fbd4..898f53cac02c 100644 --- a/drivers/regulator/raa215300.c +++ b/drivers/regulator/raa215300.c @@ -38,8 +38,6 @@ #define RAA215300_REG_BLOCK_EN_RTC_EN BIT(6) #define RAA215300_RTC_DEFAULT_ADDR 0x6f -static struct clk...
9a32584bc108c8fe4d02fa33b16caf686e4a788a
Analyze and fix the following issue in the Linux kernel code: powerpc/ptrace: Split gpr32_set_common
Problem Details: objtool reports the following warning: arch/powerpc/kernel/ptrace/ptrace-view.o: warning: objtool: gpr32_set_common+0x23c (.text+0x860): redundant UACCESS disable gpr32_set_common() conditionally opens and closes UACCESS based on whether kbuf pointer is NULL or not. This is wackelig. Split gpr...
```diff diff --git a/arch/powerpc/kernel/ptrace/ptrace-view.c b/arch/powerpc/kernel/ptrace/ptrace-view.c index 3910cd7bb2d9..584cf5c3df50 100644 --- a/arch/powerpc/kernel/ptrace/ptrace-view.c +++ b/arch/powerpc/kernel/ptrace/ptrace-view.c @@ -716,69 +716,86 @@ int gpr32_get_common(struct task_struct *target, return m...
0e216fa576e1cdea3913fe82b7283fdfb58c5c07
Analyze and fix the following issue in the Linux kernel code: Documentation/powerpc: Fix ptrace request names
Problem Details: The documented ptrace request names are currently wrong/incomplete. Fix this to improve correctness and searchability. Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230725005841.28854-2-bgray@linux.ibm.com
```diff diff --git a/Documentation/powerpc/ptrace.rst b/Documentation/powerpc/ptrace.rst index 77725d69eb4a..5629edf4d56e 100644 --- a/Documentation/powerpc/ptrace.rst +++ b/Documentation/powerpc/ptrace.rst @@ -15,7 +15,7 @@ that's extendable and that covers both BookE and server processors, so that GDB doesn't need t...
1e60f3564bad09962646bf8c2af588ecf518d337
Analyze and fix the following issue in the Linux kernel code: powerpc/watchpoints: Track perf single step directly on the breakpoint
Problem Details: There is a bug in the current watchpoint tracking logic, where the teardown in arch_unregister_hw_breakpoint() uses bp->ctx->task, which it does not have a reference of and parallel threads may be in the process of destroying. This was partially addressed in commit fb822e6076d9 ("powerpc/hw_breakpoint:...
```diff diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h index 84d39fd42f71..66db0147d5b4 100644 --- a/arch/powerpc/include/asm/hw_breakpoint.h +++ b/arch/powerpc/include/asm/hw_breakpoint.h @@ -18,6 +18,7 @@ struct arch_hw_breakpoint { u16 len; /* length of the target...
58b6fed89ab0f602de0d143c617c29c3d4c67429
Analyze and fix the following issue in the Linux kernel code: powerpc: Make virt_to_pfn() a static inline
Problem Details: Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as a...
```diff diff --git a/arch/powerpc/include/asm/kfence.h b/arch/powerpc/include/asm/kfence.h index 6fd2b4d486c5..424ceef82ae6 100644 --- a/arch/powerpc/include/asm/kfence.h +++ b/arch/powerpc/include/asm/kfence.h @@ -23,7 +23,7 @@ static inline bool arch_kfence_init_pool(void) #ifdef CONFIG_PPC64 static inline bool kfe...
984b07b428994d9e83c6de9a5f1307948188fe71
Analyze and fix the following issue in the Linux kernel code: powerpc/xics: Remove unnecessary endian conversion
Problem Details: Remove an unnecessary piece of code that does an endianness conversion but does not use the result. The following warning was reported by Clang's static analyzer: arch/powerpc/sysdev/xics/ics-opal.c:114:2: warning: Value stored to 'server' is never read [deadcode.DeadStores] server = be16_to_cpu...
```diff diff --git a/arch/powerpc/sysdev/xics/ics-opal.c b/arch/powerpc/sysdev/xics/ics-opal.c index 6cfbb4fac7fb..5fe73dabab79 100644 --- a/arch/powerpc/sysdev/xics/ics-opal.c +++ b/arch/powerpc/sysdev/xics/ics-opal.c @@ -111,7 +111,6 @@ static int ics_opal_set_affinity(struct irq_data *d, __func__, d->irq, ...
afda85b963c12947e298ad85d757e333aa40fd74
Analyze and fix the following issue in the Linux kernel code: powerpc/pseries: fix possible memory leak in ibmebus_bus_init()
Problem Details: If device_register() returns error in ibmebus_bus_init(), name of kobject which is allocated in dev_set_name() called in device_add() is leaked. As comment of device_add() says, it should call put_device() to drop the reference count that was set in device_initialize() when it fails, so the name can b...
```diff diff --git a/arch/powerpc/platforms/pseries/ibmebus.c b/arch/powerpc/platforms/pseries/ibmebus.c index 183aa8de48e7..998e3aff2457 100644 --- a/arch/powerpc/platforms/pseries/ibmebus.c +++ b/arch/powerpc/platforms/pseries/ibmebus.c @@ -461,6 +461,7 @@ static int __init ibmebus_bus_init(void) if (err) { prin...
34e7bf1acc33da5b45ded94f459a6e30d4c6acdc
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: mediatek,mt8188-mt6359: use common sound card
Problem Details: The mediatek,mt8188-mt6359 Linux sound machine driver requires the "model" property, so binding was incomplete. Reference the common sound card properties to fix that which also allows to remove duplicated property definitions. Leave the relevant parts of "audio-routing" description. Reviewed-by: Ro...
```diff diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml index 05e532b5d50a..43b3b67bdf3b 100644 --- a/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml +++ b/Documentation/devicetree/bindings/sound/m...
a06ce12efb63bad77bd4a6cedc180f181a651920
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: Add common sound card properties
Problem Details: Almost every board machine / sound cards has "audio-routing" and "model" properties, so move them to common schema to have only one definition of these properties. For amlogic,gx-sound-card, drop the minItems: 2 from the "audio-routing", because any limit here - lower or upper- is rather meaningless. ...
```diff diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml b/Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml index bf1234550343..5db718e4d0e7 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml +++ b/Documentation/devicetree/bindings/sound/a...
2d218b45848b92b03b220bf4d9bef29f058f866f
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: ipc4-pcm: fix possible null pointer deference
Problem Details: The call to snd_sof_find_spcm_dai() could return NULL, add nullable check for the return value to avoid null pointer defenrece. Fixes: 7cb19007baba ("ASoC: SOF: ipc4-pcm: add hw_params") Signed-off-by: Chao Song <chao.song@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Revie...
```diff diff --git a/sound/soc/sof/ipc4-pcm.c b/sound/soc/sof/ipc4-pcm.c index 0c905bd0fab4..027416eb2f50 100644 --- a/sound/soc/sof/ipc4-pcm.c +++ b/sound/soc/sof/ipc4-pcm.c @@ -708,6 +708,9 @@ static int sof_ipc4_pcm_hw_params(struct snd_soc_component *component, struct snd_sof_pcm *spcm; spcm = snd_sof_find_sp...
3a91388002afb03521b03c0cc1b7f371e3b1151a
Analyze and fix the following issue in the Linux kernel code: Documentation: ABI: sysfs-bus-counter: Fix indentation
Problem Details: Fix the indentation of the KernelVersion, Contact, and Description in external_input_phase_clock_select_available block by replacing spaces with tabs similar to other blocks. Reported-by: Pavel Machek <pavel@denx.de> Closes: https://lore.kernel.org/r/ZH8D3lCobUJP2T4K@duo.ucw.cz/ Signed-off-by: Biju Da...
```diff diff --git a/Documentation/ABI/testing/sysfs-bus-counter b/Documentation/ABI/testing/sysfs-bus-counter index dc3b3a5c876b..73ac84c0bca7 100644 --- a/Documentation/ABI/testing/sysfs-bus-counter +++ b/Documentation/ABI/testing/sysfs-bus-counter @@ -22,11 +22,11 @@ Description: phase clock. What: /sys/bus/...
f4e2bd91ddf5e8543cbe7ad80b3fba3d2dc63fa3
Analyze and fix the following issue in the Linux kernel code: perf/imx_ddr: don't enable counter0 if none of 4 counters are used
Problem Details: In current driver, counter0 will be enabled after ddr_perf_pmu_enable() is called even though none of the 4 counters are used. This will cause counter0 continue to count until ddr_perf_pmu_disabled() is called. If pmu is not disabled all the time, the pmu interrupt will be asserted from time to time du...
```diff diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c index 7d4e49565738..92611c98120f 100644 --- a/drivers/perf/fsl_imx8_ddr_perf.c +++ b/drivers/perf/fsl_imx8_ddr_perf.c @@ -104,6 +104,7 @@ struct ddr_pmu { const struct fsl_ddr_devtype_data *devtype_data; int irq; int id; + in...
e89ecd8368860bf05437eabd07d292c316221cfc
Analyze and fix the following issue in the Linux kernel code: perf/imx_ddr: speed up overflow frequency of cycle
Problem Details: For i.MX8MP, we cannot ensure that cycle counter overflow occurs at least 4 times as often as other events. Due to byte counters will count for any event configured, it will overflow more often. And if byte counters overflow that related counters would stop since they share the COUNTER_CNTL. We can spe...
```diff diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c index 1cb3861ab0e0..7d4e49565738 100644 --- a/drivers/perf/fsl_imx8_ddr_perf.c +++ b/drivers/perf/fsl_imx8_ddr_perf.c @@ -27,6 +27,8 @@ #define CNTL_CLEAR_MASK 0xFFFFFFFD #define CNTL_OVER_MASK 0xFFFFFFFE +#define CNTL_CP_SHI...
c4444d8749f696384947192b602718fa310c1caf
Analyze and fix the following issue in the Linux kernel code: HID: apple: Add "Hailuck" to the list of non-apple keyboards
Problem Details: Powzan keyboards KB750 and KB770 identify as "Hailuck Co.,Ltd USB Keyboard". Adding "Hailuck" to the list of non-apple keyboards fixes function keys for these models. Signed-off-by: Nils Tonnaett <ntonnatt@ccrma.stanford.edu> Reviewed-by: Rahul Rameshbabu <sergeantsagara@protonmail.com Signed-off-by: ...
```diff diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index d7b932925730..3ca45975c686 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c @@ -343,7 +343,8 @@ static const struct apple_non_apple_keyboard non_apple_keyboards[] = { { "SONiX USB DEVICE" }, { "Keychron" }, { "AONE" }, ...
46862da15e37efedb7d2d21e167f506c0b533772
Analyze and fix the following issue in the Linux kernel code: kselftest/arm64: fix a memleak in zt_regs_run()
Problem Details: If memcmp() does not return 0, "zeros" need to be freed to prevent memleak Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20230815074915.245528-1-dingxiang@cmss.chinamobile.com Signed-off-by: Will Deacon <will@kernel.org>
```diff diff --git a/tools/testing/selftests/arm64/signal/testcases/zt_regs.c b/tools/testing/selftests/arm64/signal/testcases/zt_regs.c index e1eb4d5c027a..2e384d731618 100644 --- a/tools/testing/selftests/arm64/signal/testcases/zt_regs.c +++ b/tools/testing/selftests/arm64/signal/testcases/zt_regs.c @@ -65,6 +65,7 @@...
4c1d2f56d685406fc6b452ca5f797bda62a06609
Analyze and fix the following issue in the Linux kernel code: perf/arm-dmc620: Fix dmc620_pmu_irqs_lock/cpu_hotplug_lock circular lock dependency
Problem Details: The following circular locking dependency was reported when running cpus online/offline test on an arm64 system. [ 84.195923] Chain exists of: dmc620_pmu_irqs_lock --> cpu_hotplug_lock --> cpuhp_state-down [ 84.207305] Possible unsafe locking scenario: [ 84.213212] CPU...
```diff diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c index 9d0f01c4455a..30cea6859574 100644 --- a/drivers/perf/arm_dmc620_pmu.c +++ b/drivers/perf/arm_dmc620_pmu.c @@ -66,8 +66,13 @@ #define DMC620_PMU_COUNTERn_OFFSET(n) \ (DMC620_PMU_COUNTERS_BASE + 0x28 * (n)) -static LIST_HEAD(dmc...
ea5717cb13468323a7c3dd394748301802991f39
Analyze and fix the following issue in the Linux kernel code: s390/ipl: add missing secure/has_secure file to ipl type 'unknown'
Problem Details: OS installers are relying on /sys/firmware/ipl/has_secure to be present on machines supporting secure boot. This file is present for all IPL types, but not the unknown type, which prevents a secure installation when an LPAR is booted in HMC via FTP(s), because this is an unknown IPL type in linux. Whil...
```diff diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index 85a00d97a314..dfcb2b563e2b 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c @@ -640,6 +640,8 @@ static struct attribute_group ipl_ccw_attr_group_lpar = { static struct attribute *ipl_unknown_attrs[] = { &sys_ipl_type_attr.at...
c8f40a0bccefd613748d080147469a4652d6e74c
Analyze and fix the following issue in the Linux kernel code: s390/dcssblk: fix kernel crash with list_add corruption
Problem Details: Commit fb08a1908cb1 ("dax: simplify the dax_device <-> gendisk association") introduced new logic for gendisk association, requiring drivers to explicitly call dax_add_host() and dax_remove_host(). For dcssblk driver, some dax_remove_host() calls were missing, e.g. in device remove path. The commit al...
```diff diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 6eafd0a34483..06bcb6c78909 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -412,6 +412,7 @@ removeseg: } list_del(&dev_info->lh); + dax_remove_host(dev_info->gd); kill_dax(dev_info->dax_dev); ...
2d1494fb31405df0dfb6006fdb2b24e7880258cd
Analyze and fix the following issue in the Linux kernel code: s390/mm: make virt_to_pfn() a static inline
Problem Details: Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as a...
```diff diff --git a/arch/s390/include/asm/kfence.h b/arch/s390/include/asm/kfence.h index d55ba878378b..e47fd8cbe701 100644 --- a/arch/s390/include/asm/kfence.h +++ b/arch/s390/include/asm/kfence.h @@ -35,7 +35,7 @@ static __always_inline void kfence_split_mapping(void) static inline bool kfence_protect_page(unsign...
5cfdff02e97a46f90b3ba408af62ad3dcb0dc586
Analyze and fix the following issue in the Linux kernel code: s390/boot: fix multi-line comments style
Problem Details: Make multi-line comment style consistent across the source. Acked-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/boot/startup.c b/arch/s390/boot/startup.c index a81f92563037..b9681cb22753 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -195,8 +195,9 @@ static unsigned long setup_kernel_memory_layout(void) asce_limit = _REGION2_SIZE; rte_size = _REGION3_SIZE; } + /* ...
09cd4ffafb2fbb1a18a88890b13520c501409d99
Analyze and fix the following issue in the Linux kernel code: s390/boot: account Real Memory Copy and Lowcore areas
Problem Details: Real Memory Copy and (absolute) Lowcore areas are not accounted when virtual memory layout is set up. Fixes: 4df29d2b9024 ("s390/smp: rework absolute lowcore access") Fixes: 2f0e8aae26a2 ("s390/mm: rework memcpy_real() to avoid DAT-off mode") Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by:...
```diff diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index d61428190cdd..a81f92563037 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -185,7 +185,8 @@ static unsigned long setup_kernel_memory_layout(void) vmemmap_size = SECTION_ALIGN_UP(pages) * sizeof(struct page); /* ...
8ddccc8a7d06f7ea4d8579970c95609d1b1de77b
Analyze and fix the following issue in the Linux kernel code: s390/boot: cleanup number of page table levels setup
Problem Details: The separate vmalloc area size check against _REGION2_SIZE is needed in case user provided insanely large value using vmalloc= kernel command line parameter. That could lead to overflow and selecting 3 page table levels instead of 4. Use size_add() for the overflow check and get rid of the extra vmall...
```diff diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index a1f792fcc710..b058e2a575c1 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -177,6 +177,7 @@ static unsigned long setup_kernel_memory_layout(void) unsigned long asce_limit; unsigned long rte_size; unsigned long p...
46cdff2369cbdf8d78081a22526e77bd1323f563
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/realtek - Remodified 3k pull low procedure
Problem Details: Set spec->en_3kpull_low default to true. Then fillback ALC236 and ALC257 to false. Additional note: this addresses a regression caused by the previous fix 69ea4c9d02b7 ("ALSA: hda/realtek - remove 3k pull low procedure"). The previous workaround was applied too widely without necessity, which resulted...
```diff diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 48e798d9de28..dc7b7a407638 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -10643,6 +10643,7 @@ static int patch_alc269(struct hda_codec *codec) spec = codec->spec; spec->gen.shared_mic_vref_pi...
edd65d2bc55fb84d7b80c2ffe3b74d9b11ac4e2f
Analyze and fix the following issue in the Linux kernel code: perf vendor events: Update metric event names for power10 platform
Problem Details: Update metric event name for some of the JSON/metric events for power10 platform. Fixes: 3ca3af7d1f230d1f ("perf vendor events power10: Add metric events JSON file for power10 platform") Signed-off-by: Kajol Jain <kjain@linux.ibm.com> Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Cc: Disha Goel <dis...
```diff diff --git a/tools/perf/pmu-events/arch/powerpc/power10/metrics.json b/tools/perf/pmu-events/arch/powerpc/power10/metrics.json index e3087eb1ccff..182369076d95 100644 --- a/tools/perf/pmu-events/arch/powerpc/power10/metrics.json +++ b/tools/perf/pmu-events/arch/powerpc/power10/metrics.json @@ -16,133 +16,133 @@...
4836b9a85ef148c7c9779b66fab3f7279e488d90
Analyze and fix the following issue in the Linux kernel code: perf vendor events: Drop STORES_PER_INST metric event for power10 platform
Problem Details: Drop STORES_PER_INST metric event for the power10 platform, as the metric expression of STORES_PER_INST metric event using dropped event PM_ST_FIN. Fixes: 3ca3af7d1f230d1f ("perf vendor events power10: Add metric events JSON file for power10 platform") Signed-off-by: Kajol Jain <kjain@linux.ibm.com> C...
```diff diff --git a/tools/perf/pmu-events/arch/powerpc/power10/metrics.json b/tools/perf/pmu-events/arch/powerpc/power10/metrics.json index 6f53583a0c62..e3087eb1ccff 100644 --- a/tools/perf/pmu-events/arch/powerpc/power10/metrics.json +++ b/tools/perf/pmu-events/arch/powerpc/power10/metrics.json @@ -453,12 +453,6 @@ ...
e104df97b8dcfbab2e42de634b99bf03f0805d85
Analyze and fix the following issue in the Linux kernel code: perf vendor events: Drop some of the JSON/events for power10 platform
Problem Details: Drop some of the JSON/events for power10 platform due to counter data mismatch. Fixes: 32daa5d7899e0343 ("perf vendor events: Initial JSON/events list for power10 platform") Signed-off-by: Kajol Jain <kjain@linux.ibm.com> Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Cc: Disha Goel <disgoel@linux.ib...
```diff diff --git a/tools/perf/pmu-events/arch/powerpc/power10/floating_point.json b/tools/perf/pmu-events/arch/powerpc/power10/floating_point.json deleted file mode 100644 index 54acb55e2c8c..000000000000 --- a/tools/perf/pmu-events/arch/powerpc/power10/floating_point.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { - "...
3286f88f31da060ac2789cee247153961ba57e49
Analyze and fix the following issue in the Linux kernel code: perf vendor events: Update the JSON/events descriptions for power10 platform
Problem Details: Update the description for some of the JSON/events for power10 platform. Fixes: 32daa5d7899e0343 ("perf vendor events: Initial JSON/events list for power10 platform") Signed-off-by: Kajol Jain <kjain@linux.ibm.com> Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Cc: Disha Goel <disgoel@linux.ibm.com> ...
```diff diff --git a/tools/perf/pmu-events/arch/powerpc/power10/cache.json b/tools/perf/pmu-events/arch/powerpc/power10/cache.json index 605be14f441c..9cb929bb64af 100644 --- a/tools/perf/pmu-events/arch/powerpc/power10/cache.json +++ b/tools/perf/pmu-events/arch/powerpc/power10/cache.json @@ -17,7 +17,7 @@ { "...
a1ef3aaf6ada374818ebcf978c175e65a4cd60ab
Analyze and fix the following issue in the Linux kernel code: perf docs: Fix format of unordered lists
Problem Details: Fix the format of unordered lists so the can wrap properly. Signed-off-by: Changbin Du <changbin.du@huawei.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri ...
```diff diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf/Documentation/perf-ftrace.txt index df4595563801..d780b93fcf87 100644 --- a/tools/perf/Documentation/perf-ftrace.txt +++ b/tools/perf/Documentation/perf-ftrace.txt @@ -96,8 +96,9 @@ OPTIONS for 'perf ftrace trace' --func-opts:: List of opti...
3386fb86ecdef0d39ee3306aea8ec290e61b934f
Analyze and fix the following issue in the Linux kernel code: gpiolib: fix reference leaks when removing GPIO chips still in use
Problem Details: After we remove a GPIO chip that still has some requested descriptors, gpiod_free_commit() will fail and we will never put the references to the GPIO device and the owning module in gpiod_free(). Rework this function to: - not warn on desc == NULL as this is a use-case on which most free functions s...
```diff diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 251c875b5c34..76e0c38026c3 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -2167,12 +2167,18 @@ static bool gpiod_free_commit(struct gpio_desc *desc) void gpiod_free(struct gpio_desc *desc) { - if (desc && desc->gdev && g...
20d9b3b5f2749673e1b5e9c8b0846ff6deff4032
Analyze and fix the following issue in the Linux kernel code: gpiolib: sysfs: Do unexport GPIO when user asks for it
Problem Details: It seems that sysfs interface implicitly relied on the gpiod_free() to unexport the line. This is logically incorrect as core gpiolib should not deal with sysfs so instead of restoring it, let's call gpiod_unexport() from sysfs code. Fixes: b0ce9ce408b6 ("gpiolib: Do not unexport GPIO on freeing") Rep...
```diff diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 530dfd19d7b5..50503a4525eb 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -515,8 +515,9 @@ static ssize_t unexport_store(const struct class *class, * they may be undone on its behalf too. */ i...
ac8a52962164a50e693fa021d3564d7745b83a7f
Analyze and fix the following issue in the Linux kernel code: net-memcg: Fix scope of sockmem pressure indicators
Problem Details: Now there are two indicators of socket memory pressure sit inside struct mem_cgroup, socket_pressure and tcpmem_pressure, indicating memory reclaim pressure in memcg->memory and ->tcpmem respectively. When in legacy mode (cgroupv1), the socket memory is charged into ->tcpmem which is independent of ->...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 5818af8eca5a..dbf26bc89dd4 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -284,6 +284,11 @@ struct mem_cgroup { atomic_long_t memory_events[MEMCG_NR_MEMORY_EVENTS]; atomic_long_t memory_events_local[MEM...
1892f9f01cd0cf163d2a2ee182d60d61e9d95be0
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/samsung: Fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'soc' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: exynos_tmu.c:890:14: error: cast to smaller integer type 'enum soc_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Daniel...
```diff diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 58f4d8f7a3fd..e5bc2c82010f 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -887,7 +887,7 @@ static int exynos_map_dt_data(struct platform_device *pdev) return -EADDRN...
b09bde5c3554d58cb711dac55a10ecc56d436966
Analyze and fix the following issue in the Linux kernel code: inet: move inet->mc_loop to inet->inet_frags
Problem Details: IP_MULTICAST_LOOP socket option can now be set/read without locking the socket. v3: fix build bot error reported in ipvs set_mcast_loop() Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: D...
```diff diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index ad1895e32e7d..6c4eeca59f60 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h @@ -231,7 +231,6 @@ struct inet_sock { __u8 mc_ttl; __u8 pmtudisc; __u8 is_icsk:1, - mc_loop:1, transparent:1, mc_all:1, ...
92382d744176f230101d54f5c017bccd62770f01
Analyze and fix the following issue in the Linux kernel code: lib: test_scanf: Add explicit type cast to result initialization in test_number_prefix()
Problem Details: A recent change in clang allows it to consider more expressions as compile time constants, which causes it to point out an implicit conversion in the scanf tests: lib/test_scanf.c:661:2: warning: implicit conversion from 'int' to 'unsigned char' changes value from -168 to 88 [-Wconstant-conversion] ...
```diff diff --git a/lib/test_scanf.c b/lib/test_scanf.c index b620cf7de503..a2707af2951a 100644 --- a/lib/test_scanf.c +++ b/lib/test_scanf.c @@ -606,7 +606,7 @@ static void __init numbers_slice(void) #define test_number_prefix(T, str, scan_fmt, expect0, expect1, n_args, fn) \ do { \ const T expect[2] = {...
b35c968363c036e93f95cb233182f2d1c44605c2
Analyze and fix the following issue in the Linux kernel code: ipv6: fix indentation of a config attribute
Problem Details: Fix indentation of a type attribute of IPV6_VTI config entry. Signed-off-by: Prasad Pandit <pjp@fedoraproject.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig index 658bfed1df8b..08d4b7132d4c 100644 --- a/net/ipv6/Kconfig +++ b/net/ipv6/Kconfig @@ -152,7 +152,7 @@ config INET6_TUNNEL default n config IPV6_VTI -tristate "Virtual (secure) IPv6: tunneling" + tristate "Virtual (secure) IPv6: tunneling" select IPV6_T...
36122201eeaefd78547def9681aa5d83b5a00b6a
Analyze and fix the following issue in the Linux kernel code: net: hns3: fix wrong rpu tln reg issue
Problem Details: In the original RPU query command, the status register values of multiple RPU tunnels are accumulated by default, which is unreasonable. This patch Fix it by querying the specified tunnel ID. The tunnel number of the device can be obtained from firmware during initialization. Fixes: ddb54554fa51 ("net...
```diff diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index 514a20bce4f4..a4b43bcd2f0c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -382,6 +382,7 @@ struct hnae3_dev_specs { u16 umv_size; u16 mc...
02cf5bcbd0a0283ecc13cceceeb43de45d79c85e
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/tsens: Make tsens_xxxx_nvmem static
Problem Details: This patch fixes the following sparse warnings: drivers/thermal/qcom/tsens-v1.c:24:40: sparse: warning: symbol 'tsens_qcs404_nvmem' was not declared. Should it be static? drivers/thermal/qcom/tsens-v0_1.c:26:40: sparse: warning: symbol 'tsens_8916_nvmem' was not declared. Should it be static? drivers/...
```diff diff --git a/drivers/thermal/qcom/tsens-v0_1.c b/drivers/thermal/qcom/tsens-v0_1.c index a941b4241b0a..87c09f62ee81 100644 --- a/drivers/thermal/qcom/tsens-v0_1.c +++ b/drivers/thermal/qcom/tsens-v0_1.c @@ -23,7 +23,7 @@ #define BIT_APPEND 0x3 -struct tsens_legacy_calibration_format tsens_8916_nvmem = { +...
4afcb58ea47e66c025d2b0a5f091dce5aaf95b0f
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/imx8mm: Suppress log message on probe deferral
Problem Details: nvmem_cell_read_u32() may return -EPROBE_DEFER if NVMEM supplier has not yet been probed. Future reprobe may succeed, so printing: i.mx8mm_thermal 30260000.tmu: Failed to read OCOTP nvmem cell (-517). to the log is confusing. Fix this by using dev_err_probe. This also elevates the message from warn...
```diff diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c index e89b11b3f2b9..14111ccf6e4c 100644 --- a/drivers/thermal/imx8mm_thermal.c +++ b/drivers/thermal/imx8mm_thermal.c @@ -178,10 +178,8 @@ static int imx8mm_tmu_probe_set_calib_v1(struct platform_device *pdev, int ret; ret = ...
19ad9f29751ca385262c63f513f75610962c40a0
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/mediatek/lvts: Fix parameter check in lvts_debugfs_init()
Problem Details: The documentation says "If an error occurs, ERR_PTR(-ERROR) will be returned" but the current code checks against a NULL pointer returned. Fix this by checking if IS_ERR(). Signed-off-by: Minjie Du <duminjie@vivo.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel...
```diff diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index 61c3de44c40b..bc726ac0a672 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -201,7 +201,7 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_doma...
2bba1acf7a4cbe62abbb4c686e0414209ec5943b
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/mediatek/lvts_thermal: Manage threshold between sensors
Problem Details: Each LVTS thermal controller can have up to four sensors, each capable of triggering its own interrupt when its measured temperature crosses the configured threshold. The threshold for each sensor is handled separately by the thermal framework, since each one is registered with its own thermal zone and...
```diff diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index 1ad93a778c9d..61c3de44c40b 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -67,6 +67,11 @@ #define LVTS_CALSCALE_CONF 0x300 #define LVTS_MONINT_CONF 0x...
77354eaef8218bc40d6b37e783b0b8dcca22a7d9
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/mediatek/lvts_thermal: Don't leave threshold zeroed
Problem Details: The thermal framework might leave the low threshold unset if there aren't any lower trip points. This leaves the register zeroed, which translates to a very high temperature for the low threshold. The interrupt for this threshold is then immediately triggered, and the state machine gets stuck, preventi...
```diff diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index 72c848f9de4c..1ad93a778c9d 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -83,6 +83,8 @@ #define LVTS_HW_SHUTDOWN_MT8195 105000 +#define LVTS_MINIMUM_...
487bf099e85b724c824f5fafaf93c6749c4d2120
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/mediatek/lvts_thermal: Disable undesired interrupts
Problem Details: Out of the many interrupts supported by the hardware, the only ones of interest to the driver currently are: * The temperature went over the high offset threshold, for any of the sensors * The temperature went below the low offset threshold, for any of the sensors * The temperature went over the st...
```diff diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index 978316a45060..72c848f9de4c 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -65,7 +65,7 @@ #define LVTS_HW_FILTER 0x2 #define LVTS_TSSEL_CONF 0x131211...
f79e996c7ed27bb196facbcd1c69ee33631d7051
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/mediatek/lvts_thermal: Use offset threshold for IRQ
Problem Details: There are two kinds of temperature monitoring interrupts available: * High Offset, Low Offset * Hot, Hot to normal, Cold The code currently uses the hot/h2n/cold interrupts, however in a way that doesn't work: the cold threshold is left uninitialized, which prevents the other thresholds from ever trig...
```diff diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index 92f4784bb98c..978316a45060 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -298,9 +298,9 @@ static int lvts_set_trips(struct thermal_zone_device *tz, int low...
64de162e34e4cb2982a1d96e492f018026a61c1d
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/mediatek/lvts_thermal: Honor sensors in immediate mode
Problem Details: Each controller can be configured to operate on immediate or filtered mode. On filtered mode, the sensors are enabled by setting the corresponding bits in MONCTL0, while on immediate mode, by setting MSRCTL1. Previously, the code would set MSRCTL1 for all four sensors when configured to immediate mode...
```diff diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index 4ec09cb8f667..92f4784bb98c 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -896,24 +896,6 @@ static int lvts_ctrl_configure(struct device *dev, struct lvts_c...
cbd8c5aae2a988bafd4586bea710eeddc30a82ce
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/mediatek/lvts_thermal: Handle IRQ on all controllers
Problem Details: There is a single IRQ handler for each LVTS thermal domain, and it is supposed to check each of its underlying controllers for the origin of the interrupt and clear its status. However due to a typo, only the first controller was ever being handled, which resulted in the interrupt never being cleared w...
```diff diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index 054c965ae5e1..4ec09cb8f667 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -451,7 +451,7 @@ static irqreturn_t lvts_irq_handler(int irq, void *data) for ...
b8bd342d50cbf606666488488f9fea374aceb2d5
Analyze and fix the following issue in the Linux kernel code: fuse: nlookup missing decrement in fuse_direntplus_link
Problem Details: During our debugging of glusterfs, we found an Assertion failed error: inode_lookup >= nlookup, which was caused by the nlookup value in the kernel being greater than that in the FUSE file system. The issue was introduced by fuse_direntplus_link, where in the function, fuse_iget increments nlookup, an...
```diff diff --git a/fs/fuse/readdir.c b/fs/fuse/readdir.c index dc603479b30e..b3d498163f97 100644 --- a/fs/fuse/readdir.c +++ b/fs/fuse/readdir.c @@ -243,8 +243,16 @@ retry: dput(dentry); dentry = alias; } - if (IS_ERR(dentry)) + if (IS_ERR(dentry)) { + if (!IS_ERR(inode)) { + struct fuse_inode *fi =...
4ae68b26c3ab5a82aa271e6e9fc9b1a06e1d6b40
Analyze and fix the following issue in the Linux kernel code: objtool/x86: Fix SRSO mess
Problem Details: Objtool --rethunk does two things: - it collects all (tail) call's of __x86_return_thunk and places them into .return_sites. These are typically compiler generated, but RET also emits this same. - it fudges the validation of the __x86_return_thunk symbol; because this symbol is inside anot...
```diff diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index 2d51fa8da9e8..cba8a7be040e 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@ -824,8 +824,11 @@ bool arch_is_retpoline(struct symbol *sym) bool arch_is_rethunk(struct symbol *sym) { - retu...
af023ef335f13c8b579298fc432daeef609a9e60
Analyze and fix the following issue in the Linux kernel code: x86/cpu: Fix up srso_safe_ret() and __x86_return_thunk()
Problem Details: vmlinux.o: warning: objtool: srso_untrain_ret() falls through to next function __x86_return_skl() vmlinux.o: warning: objtool: __x86_return_thunk() falls through to next function __x86_return_skl() This is because these functions (can) end with CALL, which objtool does not consider a terminating ins...
```diff diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S index 9427480cfae9..a478eb5bbf62 100644 --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -258,7 +258,7 @@ SYM_INNER_LABEL(srso_safe_ret, SYM_L_GLOBAL) int3 lfence call srso_safe_ret - int3 + ud2 SYM_CODE_END(srso_safe_ret) ...
77f67119004296a9b2503b377d610e08b08afc2a
Analyze and fix the following issue in the Linux kernel code: x86/cpu: Fix __x86_return_thunk symbol type
Problem Details: Commit fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") reimplemented __x86_return_thunk with a mix of SYM_FUNC_START and SYM_CODE_END, this is not a sane combination. Since nothing should ever actually 'CALL' this, make it consistently CODE. Fixes: fb3bd914b3ec ("x86/srso: Ad...
```diff diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S index 8db74d811ce2..9427480cfae9 100644 --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -263,7 +263,9 @@ SYM_CODE_END(srso_safe_ret) SYM_FUNC_END(srso_untrain_ret) __EXPORT_THUNK(srso_untrain_ret) -SYM_FUNC_START(__x86_return_...
b93ec212bcaccf61313ddbf2527319a7585805ee
Analyze and fix the following issue in the Linux kernel code: doc: idmappings: fix an error and rephrase a paragraph
Problem Details: If the modified paragraph is referring to the idmapping mentioned in the previous paragraph (i.e. `u0:k10000:r10000`), then it is `u0` that the upper idmapset starts with, not `u1000`. Fix this error and rephrase this paragraph a bit to make this reference more explicit. Reported-by: Wang Lei <wangle...
```diff diff --git a/Documentation/filesystems/idmappings.rst b/Documentation/filesystems/idmappings.rst index f3d168c9f0b9..d095c5838f94 100644 --- a/Documentation/filesystems/idmappings.rst +++ b/Documentation/filesystems/idmappings.rst @@ -146,9 +146,10 @@ For the rest of this document we will prefix all userspace i...
409896794380c1dc0d596bbb9255e583a94d9a00
Analyze and fix the following issue in the Linux kernel code: ALSA: hda: cs35l41: Fix the loop check in cs35l41_add_dsd_properties
Problem Details: model->hid is a pointer, and should be rather NULL-checked in the loop of cs35l41_prop_model_table. Fixes: ef4ba63f12b0 ("ALSA: hda: cs35l41: Support systems with missing _DSD properties") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202308160506.8lCEeFD...
```diff diff --git a/sound/pci/hda/cs35l41_hda_property.c b/sound/pci/hda/cs35l41_hda_property.c index 673f23257a09..48dcc3f1ef88 100644 --- a/sound/pci/hda/cs35l41_hda_property.c +++ b/sound/pci/hda/cs35l41_hda_property.c @@ -61,7 +61,7 @@ int cs35l41_add_dsd_properties(struct cs35l41_hda *cs35l41, struct device *phys...
18ddaeb03bdb65b84fece11a8cac5bf583ae1b91
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx4: Copy union directly
Problem Details: Copy union directly instead of using memcpy(). Note that in this case, a direct assignment is more readable and consistent with the subsequent assignments. This addresses the following -Wstringop-overflow warning seen in s390 with defconfig: drivers/infiniband/hw/mlx4/main.c:296:33: warning: writing ...
```diff diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 216aacd72e4f..2d2cd17e02e6 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -293,8 +293,7 @@ static int mlx4_ib_add_gid(const struct ib_gid_attr *attr, void **context) ret = -EN...
295c95aa7e0310ad8a89e98f1632d066e8526bb2
Analyze and fix the following issue in the Linux kernel code: RDMA/irdma: Drop unused kernel push code
Problem Details: The driver has code blocks for kernel push WQEs but does not map the doorbell page rendering this mode non functional [1] Remove code associated with this feature from the kernel fast path as there is currently no plan of record to support this. This also address a sparse issue reported by lkp. driv...
```diff diff --git a/drivers/infiniband/hw/irdma/ctrl.c b/drivers/infiniband/hw/irdma/ctrl.c index b90abdc85057..b1fdddd2fa1a 100644 --- a/drivers/infiniband/hw/irdma/ctrl.c +++ b/drivers/infiniband/hw/irdma/ctrl.c @@ -1301,7 +1301,6 @@ int irdma_sc_mr_fast_register(struct irdma_sc_qp *qp, sq_info.wr_id = info->wr_...
270d73e6507f9c7fff43844d74f86365df000b36
Analyze and fix the following issue in the Linux kernel code: smb: client: fix null auth
Problem Details: Commit abdb1742a312 removed code that clears ctx->username when sec=none, so attempting to mount with '-o sec=none' now fails with -EACCES. Fix it by adding that logic to the parsing of the 'sec' option, as well as checking if the mount is using null auth before setting the username when parsing the '...
```diff diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index 4946a0c59600..67e16c2ac90e 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -231,6 +231,8 @@ cifs_parse_security_flavors(struct fs_context *fc, char *value, struct smb3_fs_c break; case Opt_sec_none: ct...
ded67d90815a412f327051d27eb6c6de57cd2c03
Analyze and fix the following issue in the Linux kernel code: netlink: specs: add ovs_vport new command
Problem Details: Add NEW to the spec, it was useful testing the fix for OvS input validation. Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://lore.kernel.org/r/20230814205627.2914583-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
```diff diff --git a/Documentation/netlink/specs/ovs_vport.yaml b/Documentation/netlink/specs/ovs_vport.yaml index 17336455bec1..ef298b001445 100644 --- a/Documentation/netlink/specs/ovs_vport.yaml +++ b/Documentation/netlink/specs/ovs_vport.yaml @@ -81,6 +81,10 @@ attribute-sets: name-prefix: ovs-vport-attr- ...
956db0a13b47df7f3d6d624394e602e8bf9b057e
Analyze and fix the following issue in the Linux kernel code: net: warn about attempts to register negative ifindex
Problem Details: Since the xarray changes we mix returning valid ifindex and negative errno in a single int returned from dev_index_reserve(). This depends on the fact that ifindexes can't be negative. Otherwise we may insert into the xarray and return a very large negative value. This in turn may break ERR_PTR(). OvS...
```diff diff --git a/net/core/dev.c b/net/core/dev.c index 636b41f0b32d..17e6281e408c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9589,6 +9589,11 @@ static int dev_index_reserve(struct net *net, u32 ifindex) { int err; + if (ifindex > INT_MAX) { + DEBUG_NET_WARN_ON_ONCE(1); + return -EINVAL; + } + if ...
a552bfa16bab4ce901ee721346a28c4e483f4066
Analyze and fix the following issue in the Linux kernel code: net: openvswitch: reject negative ifindex
Problem Details: Recent changes in net-next (commit 759ab1edb56c ("net: store netdevs in an xarray")) refactored the handling of pre-assigned ifindexes and let syzbot surface a latent problem in ovs. ovs does not validate ifindex, making it possible to create netdev ports with negative ifindex values. It's easy to repr...
```diff diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index a6d2a0b1aa21..3d7a91e64c88 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -1829,7 +1829,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) parms.port_no = OVSP_LOCAL; parms.upcall...
dafcbce07136d799edc4c67f04f9fd69ff1eac1f
Analyze and fix the following issue in the Linux kernel code: team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves
Problem Details: Similar to commit 01f4fd270870 ("bonding: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves"), we can trigger BUG_ON(!vlan_info) in unregister_vlan_dev() with the following testcase: # ip netns add ns1 # ip netns exec ns1 ip link add team1 type team # ip netns exec ns1 ip link add ...
```diff diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index d3dc22509ea5..382756c3fb83 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -2200,7 +2200,9 @@ static void team_setup(struct net_device *dev) dev->hw_features = TEAM_VLAN_FEATURES | NETIF_F_HW_VLAN_CTAG_RX | - ...
096516d092d54604d590827d05b1022c8f326639
Analyze and fix the following issue in the Linux kernel code: net: phy: broadcom: stub c45 read/write for 54810
Problem Details: The 54810 does not support c45. The mmd_phy_indirect accesses return arbirtary values leading to odd behavior like saying it supports EEE when it doesn't. We also see that reading/writing these non-existent MMD registers leads to phy instability in some cases. Fixes: b14995ac2527 ("net: phy: broadcom:...
```diff diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index 59cae0d808aa..04b2e6eeb195 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -542,6 +542,17 @@ static int bcm54xx_resume(struct phy_device *phydev) return bcm54xx_config_init(phydev); } +static int bcm54810...