id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
c8e1927e7f7d63721e32ec41d27ccb0eb1a1b0fc
Analyze and fix the following issue in the Linux kernel code: efi/libstub: Describe missing 'out' parameter in efi_load_initrd
Problem Details: The function efi_load_initrd() had a documentation warning due to the missing description for the 'out' parameter. Add the parameter description to the kernel-doc comment to resolve the warning and improve API documentation. Fixes the following compiler warning: drivers/firmware/efi/libstub/efi-stub-h...
```diff diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c index fd6dc790c5a8..7aa2f9ad2935 100644 --- a/drivers/firmware/efi/libstub/efi-stub-helper.c +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c @@ -601,6 +601,7 @@ efi_status_t efi_load_initrd_cmdline(...
6052f05254b4fe7b16bbd8224779af52fba98b71
Analyze and fix the following issue in the Linux kernel code: ASoc: SOF: topology: connect DAI to a single DAI link
Problem Details: The partial matching of DAI widget to link names, can cause problems if one of the widget names is a substring of another. E.g. with names "Foo1" and Foo10", it's not possible to correctly link up "Foo1". Modify the logic so that if multiple DAI links match the widget stream name, prioritize a full ma...
```diff diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index dc9cb8324067..14aa8ecc4bc4 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -1063,7 +1063,7 @@ static int sof_connect_dai_widget(struct snd_soc_component *scomp, struct snd_sof_dai *dai) { struct snd_soc_card...
4e7010826e96702d7fad13dbe85de4e94052f833
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: Intel: hda-bus: Use PIO mode on ACE2+ platforms
Problem Details: Keep using the PIO mode for commands on ACE2+ platforms, similarly how the legacy stack is configured. Fixes: 05cf17f1bf6d ("ASoC: SOF: Intel: hda-bus: Use PIO mode for Lunar Lake") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> ...
```diff diff --git a/sound/soc/sof/intel/hda-bus.c b/sound/soc/sof/intel/hda-bus.c index b1be03011d7e..6492e1cefbfb 100644 --- a/sound/soc/sof/intel/hda-bus.c +++ b/sound/soc/sof/intel/hda-bus.c @@ -76,7 +76,7 @@ void sof_hda_bus_init(struct snd_sof_dev *sdev, struct device *dev) snd_hdac_ext_bus_init(bus, dev, &bu...
98db16f314b3a0d6e5acd94708ea69751436467f
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: ipc4-pcm: Delay reporting is only supported for playback direction
Problem Details: The firmware does not provide any information for capture streams via the shared pipeline registers. To avoid reporting invalid delay value for capture streams to user space we need to disable it. Fixes: af74dbd0dbcf ("ASoC: SOF: ipc4-pcm: allocate time info for pcm delay feature") Cc: stable@vger.ke...
```diff diff --git a/sound/soc/sof/ipc4-pcm.c b/sound/soc/sof/ipc4-pcm.c index 1a2841899ff5..c09b424ab863 100644 --- a/sound/soc/sof/ipc4-pcm.c +++ b/sound/soc/sof/ipc4-pcm.c @@ -798,7 +798,8 @@ static int sof_ipc4_pcm_setup(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm spcm->stream[stream].private = stream_p...
4d14b1069e9e672dbe1adab52594076da6f4a62d
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: ipc4-control: Use SOF_CTRL_CMD_BINARY as numid for bytes_ext
Problem Details: The header.numid is set to scontrol->comp_id in bytes_ext_get and it is ignored during bytes_ext_put. The use of comp_id is not quite great as it is kernel internal identification number. Set the header.numid to SOF_CTRL_CMD_BINARY during get and validate the numid during put to provide consistent and...
```diff diff --git a/sound/soc/sof/ipc4-control.c b/sound/soc/sof/ipc4-control.c index 576f407cd456..976a4794d610 100644 --- a/sound/soc/sof/ipc4-control.c +++ b/sound/soc/sof/ipc4-control.c @@ -531,6 +531,14 @@ static int sof_ipc4_bytes_ext_put(struct snd_sof_control *scontrol, return -EINVAL; } + /* Check head...
243bf99e2fe75edf8df1711c1377b6fc020b806c
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix the gem shrinker name
Problem Details: The xe buffer object shrinker name is visible in the <debugfs>/shrinker directory and most if not all other shinkers follow a naming convention that looks like <subsystem>-<driver>_<objects>:<unique> Follow the same convention for xe, changing the name to drm-xe_gem:<unique>. Other shrinkers typically...
```diff diff --git a/drivers/gpu/drm/xe/xe_shrinker.c b/drivers/gpu/drm/xe/xe_shrinker.c index 8184390f9c7b..86d47aaf0358 100644 --- a/drivers/gpu/drm/xe/xe_shrinker.c +++ b/drivers/gpu/drm/xe/xe_shrinker.c @@ -227,7 +227,7 @@ struct xe_shrinker *xe_shrinker_create(struct xe_device *xe) if (!shrinker) return ERR_P...
bbb67d4f85fd00a216fca4ca048e15f8ff6a2195
Analyze and fix the following issue in the Linux kernel code: configfs: Correct error value returned by API config_item_set_name()
Problem Details: kvasprintf() failure is often caused by memory allocation which has error code -ENOMEM, but config_item_set_name() returns -EFAULT for the failure. Fix by returning -ENOMEM instead of -EFAULT for the failure. Reviewed-by: Joel Becker <jlbec@evilplan.org> Reviewed-by: Breno Leitao <leitao@debian.org> ...
```diff diff --git a/fs/configfs/item.c b/fs/configfs/item.c index 254170a82aa3..c378b5cbf87d 100644 --- a/fs/configfs/item.c +++ b/fs/configfs/item.c @@ -66,7 +66,7 @@ int config_item_set_name(struct config_item *item, const char *fmt, ...) name = kvasprintf(GFP_KERNEL, fmt, args); va_end(args); if (!name) - ...
f830edbae247b89228c3e09294151b21e0dc849c
Analyze and fix the following issue in the Linux kernel code: configfs: Do not override creating attribute file failure in populate_attrs()
Problem Details: populate_attrs() may override failure for creating attribute files by success for creating subsequent bin attribute files, and have wrong return value. Fix by creating bin attribute files under successfully creating attribute files. Fixes: 03607ace807b ("configfs: implement binary attributes") Cc: st...
```diff diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 6d4a1190f694..ebf32822e29b 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -619,7 +619,7 @@ static int populate_attrs(struct config_item *item) break; } } - if (t->ct_bin_attrs) { + if (!error && t->ct_bin_attrs) { for (i = 0; (bin_...
d78aa60cfa7ece7477a4089a3a4b520ec7beba1b
Analyze and fix the following issue in the Linux kernel code: configfs: Delete semicolon from macro type_print() definition
Problem Details: Macro type_print() definition ends with semicolon, so will cause the subsequent macro invocations end with two semicolons. Fix by deleting the semicolon from the macro definition. Reviewed-by: Joel Becker <jlbec@evilplan.org> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Link: https://lore.kernel...
```diff diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 5568cb74b322..6d4a1190f694 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -970,7 +970,7 @@ static void configfs_dump_one(struct configfs_dirent *sd, int level) { pr_info("%*s\"%s\":\n", level, " ", configfs_get_name(sd)); -#define type_pri...
732b87a409667a370b87955c518e5d004de740b5
Analyze and fix the following issue in the Linux kernel code: drm/i915/dp: Fix determining SST/MST mode during MTP TU state computation
Problem Details: Determining the SST/MST mode during state computation must be done based on the output type stored in the CRTC state, which in turn is set once based on the modeset connector's SST vs. MST type and will not change as long as the connector is using the CRTC. OTOH the MST mode indicated by the given conn...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index 02f95108c637..6dc2d31ccb5a 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -242,7 +242,7 @@ int intel_dp_mtp_tu_compute_config(struct intel_d...
da8bf5daa5e55a6af2b285ecda460d6454712ff4
Analyze and fix the following issue in the Linux kernel code: memblock: Accept allocated memory before use in memblock_double_array()
Problem Details: When increasing the array size in memblock_double_array() and the slab is not yet available, a call to memblock_find_in_range() is used to reserve/allocate memory. However, the range returned may not have been accepted, which can result in a crash when booting an SNP guest: RIP: 0010:memcpy_orig+0x6...
```diff diff --git a/mm/memblock.c b/mm/memblock.c index d3509414b8c3..0e9ebb8aa7fe 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -457,7 +457,14 @@ static int __init_memblock memblock_double_array(struct memblock_type *type, min(new_area_start, memblock.current_limit), new_alloc_size, PAGE_SIZE); - new...
6b3ab7f2cbfaeb6580709cd8ef4d72cfd01bfde4
Analyze and fix the following issue in the Linux kernel code: net: qede: Initialize qede_ll_ops with designated initializer
Problem Details: After a recent change [1] in clang's randstruct implementation to randomize structures that only contain function pointers, there is an error because qede_ll_ops get randomized but does not use a designated initializer for the first member: drivers/net/ethernet/qlogic/qede/qede_main.c:206:2: error: ...
```diff diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c index 99df00c30b8c..b5d744d2586f 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_main.c +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c @@ -203,7 +203,7 @@ static struct pci_driver qede_pci_driver = { ...
f6953f1f9ec4ad68651d7c677f0c065cb4c1edf7
Analyze and fix the following issue in the Linux kernel code: tsm-mr: Add tsm-mr sample code
Problem Details: This sample kernel module demonstrates how to make MRs accessible to user mode through the tsm-mr library. Once loaded, this module registers a `miscdevice` that host a set of emulated measurement registers as shown in the directory tree below. /sys/class/misc/tsm_mr_sample └── measurements ├── c...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index 5d36823d26b2..8bf8a818bce5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -24651,6 +24651,7 @@ F: Documentation/ABI/testing/configfs-tsm F: Documentation/driver-api/coco/ F: drivers/virt/coco/tsm*.c F: include/linux/tsm*.h +F: samples/tsm/ TRUSTED SERVICES TEE D...
b9e22b35d4598aefed642928ed2856a9900e5b37
Analyze and fix the following issue in the Linux kernel code: tsm-mr: Add TVM Measurement Register support
Problem Details: Introduce new TSM Measurement helper library (tsm-mr) for TVM guest drivers to expose MRs (Measurement Registers) as sysfs attributes, with Crypto Agility support. Add the following new APIs (see include/linux/tsm-mr.h for details): - tsm_mr_create_attribute_group(): Take on input a `struct tsm_mea...
```diff diff --git a/Documentation/driver-api/coco/index.rst b/Documentation/driver-api/coco/index.rst new file mode 100644 index 000000000000..af9f08ca0cfd --- /dev/null +++ b/Documentation/driver-api/coco/index.rst @@ -0,0 +1,12 @@ +.. SPDX-License-Identifier: GPL-2.0 + +====================== +Confidential Computing...
1f389a648a3be07400819c431ee30b74129a8a6e
Analyze and fix the following issue in the Linux kernel code: selftests: netfilter: fix conntrack stress test failures on debug kernels
Problem Details: Jakub reports test failures on debug kernel: FAIL: proc inconsistency after uniq filter for ... This is because entries are expiring while validation is happening. Increase the timeout of ctnetlink injected entries and the icmp (ping) timeout to 1h to avoid this. To reduce run-time, add less entries...
```diff diff --git a/tools/testing/selftests/net/netfilter/conntrack_resize.sh b/tools/testing/selftests/net/netfilter/conntrack_resize.sh index aabc7c51181e..9e033e80219e 100755 --- a/tools/testing/selftests/net/netfilter/conntrack_resize.sh +++ b/tools/testing/selftests/net/netfilter/conntrack_resize.sh @@ -9,8 +9,13...
63a9a727d373fa5b8ce509eef50dbc45e0f745b9
Analyze and fix the following issue in the Linux kernel code: wireless: purelifi: plfxlc: fix memory leak in plfxlc_usb_wreq_asyn()
Problem Details: Add usb_free_urb() in the error path to prevent memory leak. Signed-off-by: Salah Triki <salah.triki@gmail.com> Link: https://patch.msgid.link/aA3_maPlEJzO7wrL@pc [fix subject] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
```diff diff --git a/drivers/net/wireless/purelifi/plfxlc/usb.c b/drivers/net/wireless/purelifi/plfxlc/usb.c index 10d2e2124ff8..c2a1234b59db 100644 --- a/drivers/net/wireless/purelifi/plfxlc/usb.c +++ b/drivers/net/wireless/purelifi/plfxlc/usb.c @@ -503,8 +503,10 @@ int plfxlc_usb_wreq_async(struct plfxlc_usb *usb, co...
39c88e5b2f076ebfe8ad631a523fe497e87c1629
Analyze and fix the following issue in the Linux kernel code: wifi: brcmfmac: Fix structure size for WPA3 external SAE
Problem Details: Add pmkid parameter in "brcmf_auth_req_status_le" structure to align the buffer size defined in firmware "wl_auth_req_status" structure. Signed-off-by: Ting-Ying Li <tingying.li@infineon.com> [arend: adapted path to apply to per-vendor variant] [arend: added kerneldoc for new struct field] Tested-by: ...
```diff diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/fwil_types.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/fwil_types.h index a3243b940f10..08c69142495a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/fwil_types.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfma...
dfb25484bd73c8590954ead6fd58a1587ba3bbc5
Analyze and fix the following issue in the Linux kernel code: arm64: tegra: Add uartd serial alias for Jetson TX1 module
Problem Details: If a serial-tegra interface does not have an alias, the driver fails to probe with an error: serial-tegra 70006300.serial: failed to get alias id, errno -19 This prevents the bluetooth device from being accessible. Fixes: 6eba6471bbb7 ("arm64: tegra: Wire up Bluetooth on Jetson TX1 module") Signed-off...
```diff diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi index c57bd1356381..e07aeeee3586 100644 --- a/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi @@ -11,6 +11,7 @@ rtc0 = "/i2c@7000d000/pmic@3c"; r...
3e14c7207a975eefcda1929b2134a9f4119dde45
Analyze and fix the following issue in the Linux kernel code: clk: s2mps11: initialise clk_hw_onecell_data::num before accessing ::hws[] in probe()
Problem Details: With UBSAN enabled, we're getting the following trace: UBSAN: array-index-out-of-bounds in .../drivers/clk/clk-s2mps11.c:186:3 index 0 is out of range for type 'struct clk_hw *[] __counted_by(num)' (aka 'struct clk_hw *[]') This is because commit f316cdff8d67 ("clk: Annotate struct clk_hw_one...
```diff diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c index 014db6386624..8ddf3a9a53df 100644 --- a/drivers/clk/clk-s2mps11.c +++ b/drivers/clk/clk-s2mps11.c @@ -137,6 +137,8 @@ static int s2mps11_clk_probe(struct platform_device *pdev) if (!clk_data) return -ENOMEM; + clk_data->num = S2MPS1...
39e1cbf57e3034bff1272b83b9e606a0bc2c3dc3
Analyze and fix the following issue in the Linux kernel code: arm64: tegra: Add DMA properties for Tegra186 and Tegra194 UARTs
Problem Details: Adding the missing dmas and dma-names properties which are required for uart when using with the Tegra HSUART driver. Signed-off-by: Aaron Kling <webgeek1234@gmail.com> Link: https://lore.kernel.org/r/20250428-tegra-serial-fixes-v1-2-4f47c5d85bf6@gmail.com Signed-off-by: Thierry Reding <treding@nvidia...
```diff diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi index e2d6857a3709..51ced62cd42b 100644 --- a/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi @@ -61,6 +61,8 @@ }; serial@3100000 { + /delete-pr...
4cd763297c2203c6ba587d7d4a9105f96597b998
Analyze and fix the following issue in the Linux kernel code: arm64: tegra: Drop remaining serial clock-names and reset-names
Problem Details: The referenced commit only removed some of the names, missing all that weren't in use at the time. The commit removes the rest. Fixes: 71de0a054d0e ("arm64: tegra: Drop serial clock-names and reset-names") Signed-off-by: Aaron Kling <webgeek1234@gmail.com> Link: https://lore.kernel.org/r/20250428-tegr...
```diff diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi index 2b3bb5d0af17..f0b7949df92c 100644 --- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi @@ -621,9 +621,7 @@ reg-shift = <2>; interrupts = <GIC_SPI 113 IRQ_TYPE_LEV...
564467e9d06c6352fac9100e8957d40a1a50234c
Analyze and fix the following issue in the Linux kernel code: drm/xe: Add config control for svm flush work
Problem Details: Without CONFIG_DRM_XE_GPUSVM set, GPU SVM is not initialized thus below warning pops. Refine the flush work code to be controlled by the config to avoid below warning: " [ 453.132028] ------------[ cut here ]------------ [ 453.132527] WARNING: CPU: 9 PID: 4491 at kernel/workqueue.c:4205 __flush_work+...
```diff diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c index 0b6547c06961..24c578e1170e 100644 --- a/drivers/gpu/drm/xe/xe_svm.c +++ b/drivers/gpu/drm/xe/xe_svm.c @@ -947,3 +947,15 @@ int xe_devm_add(struct xe_tile *tile, struct xe_vram_region *vr) return 0; } #endif + +/** + * xe_svm_flush(...
781411f0ee0d93d624300472ec18e11ff9ca1f3d
Analyze and fix the following issue in the Linux kernel code: pinctrl: at91: drop unneeded dependency on OF_GPIO
Problem Details: This driver does not use any symbols from gpiolib-of.c. There's no reason for it to select OF_GPIO directly. This addresses a kismet issue reported by the build bot. Fixes: 8e86af65f39d ("pinctrl: at91: allow building the module with COMPILE_TEST=y") Reported-by: kernel test robot <lkp@intel.com> Clos...
```diff diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index db84d80b7e7d..33db9104df17 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -107,7 +107,6 @@ config PINCTRL_AT91 select PINMUX select PINCONF select GPIOLIB - select OF_GPIO select GPIOLIB_IRQCHIP help Say Y ...
30d20fb1f84ad5c92706fe2c6cbb2d4cc293e671
Analyze and fix the following issue in the Linux kernel code: perf trace: Fix leaks of 'struct thread' in set_filter_loop_pids()
Problem Details: I've found some leaks from 'perf trace -a'. It seems there are more leaks but this is what I can find for now. Fixes: 082ab9a18e532864 ("perf trace: Filter out 'sshd' in the tracer ancestry in syswide tracing") Reviewed-by: Howard Chu <howardchu95@gmail.com> Signed-off-by: Namhyung Kim <namhyung@kern...
```diff diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index e7d5327123ba..edab0ff60b3c 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -4128,10 +4128,13 @@ static int trace__set_filter_loop_pids(struct trace *trace) if (!strcmp(thread__comm_str(parent), "sshd") || ...
bb3de7fa988c1b315ab8e87dc74e0d088284f142
Analyze and fix the following issue in the Linux kernel code: perf trace: Fix leaks of 'struct thread' in fprintf_sys_enter()
Problem Details: I've found some leaks from 'perf trace -a'. It seems there are more leaks but this is what I can find for now. Fixes: 70351029b55677eb ("perf thread: Add support for reading the e_machine type for a thread") Reviewed-by: Howard Chu <howardchu95@gmail.com> Signed-off-by: Namhyung Kim <namhyung@kernel....
```diff diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index c39b7f8ff846..e7d5327123ba 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2842,7 +2842,7 @@ static int trace__fprintf_sys_enter(struct trace *trace, struct evsel *evsel, e_machine = thread__e_machine(threa...
c533c0a2acb1194d3353d46377ca1206305465bc
Analyze and fix the following issue in the Linux kernel code: ARM: tegra: Rename the apbdma nodename to match with common dma-controller binding
Problem Details: Rename the apbdma nodename from "dma@" to "dma-controller@" to align with linux common dma-controller binding. Signed-off-by: Charan Pedumuru <charan.pedumuru@gmail.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Link: https://lore....
```diff diff --git a/arch/arm/boot/dts/nvidia/tegra20.dtsi b/arch/arm/boot/dts/nvidia/tegra20.dtsi index 8da75ccc4402..882adb7f2f26 100644 --- a/arch/arm/boot/dts/nvidia/tegra20.dtsi +++ b/arch/arm/boot/dts/nvidia/tegra20.dtsi @@ -284,7 +284,7 @@ reg = <0x60007000 0x1000>; }; - apbdma: dma@6000a000 { + apbdma: d...
881097c0549f3818f5aa31af8ccb49213bd99bed
Analyze and fix the following issue in the Linux kernel code: perf: Fix confusing aux iteration
Problem Details: While an event tears down all links to it as an aux, the iteration happens on the event's group leader instead of the group itself. If the event is a group leader, it has no effect because the event is also its own group leader. But otherwise there would be a risk to detach all the siblings events fro...
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index e0ca4a88beb5..b8461074600b 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -2171,7 +2171,7 @@ static void perf_put_aux_event(struct perf_event *event) * If the event is an aux_event, tear down all links to * it from other event...
d20eb2d5fe8f8818abcfdadf5ac5109938f1318e
Analyze and fix the following issue in the Linux kernel code: perf: Fix irq work dereferencing garbage
Problem Details: The following commit: da916e96e2de ("perf: Make perf_pmu_unregister() useable") has introduced two significant event's parent lifecycle changes: 1) An event that has exited now has EVENT_TOMBSTONE as a parent. This can result in a situation where the delayed wakeup irq_work can accidentally d...
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index 882db7bca782..e0ca4a88beb5 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -208,7 +208,6 @@ static void perf_ctx_unlock(struct perf_cpu_context *cpuctx, } #define TASK_TOMBSTONE ((void *)-1L) -#define EVENT_TOMBSTONE ((void *)-1L...
22d38babb3adcb1227ecfb91d9423008a46548fe
Analyze and fix the following issue in the Linux kernel code: perf: Fix failing inherit_event() doing extra refcount decrement on parent
Problem Details: When inherit_event() fails after the child allocation but before the parent refcount has been incremented, calling put_event() wrongly decrements the reference to the parent, risking to free it too early. Also pmu_get_event() can't be holding a reference to the child concurrently at this point since i...
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index 05136e835042..882db7bca782 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -5627,6 +5627,22 @@ static void _free_event(struct perf_event *event) __free_event(event); } +/* + * Used to free events which have a known refcount of 1...
9d271a4f5ba52520e448ab223b1a91c6e35f17c7
Analyze and fix the following issue in the Linux kernel code: drm/xe: Release force wake first then runtime power
Problem Details: xe_force_wake_get() is dependent on xe_pm_runtime_get(), so for the release path, xe_force_wake_put() should be called first then xe_pm_runtime_put(). Combine the error path and normal path together with goto. Fixes: 85d547608ef5 ("drm/xe/xe_gt_debugfs: Update handling of xe_force_wake_get return") Cc...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt_debugfs.c b/drivers/gpu/drm/xe/xe_gt_debugfs.c index 2d63a69cbfa3..f7005a3643e6 100644 --- a/drivers/gpu/drm/xe/xe_gt_debugfs.c +++ b/drivers/gpu/drm/xe/xe_gt_debugfs.c @@ -92,22 +92,23 @@ static int hw_engines(struct xe_gt *gt, struct drm_printer *p) struct xe_hw_engine ...
03552d8ac0afcc080c339faa0b726e2c0e9361cb
Analyze and fix the following issue in the Linux kernel code: drm/xe/gsc: do not flush the GSC worker from the reset path
Problem Details: The workqueue used for the reset worker is marked as WQ_MEM_RECLAIM, while the GSC one isn't (and can't be as we need to do memory allocations in the gsc worker). Therefore, we can't flush the latter from the former. The reason why we had such a flush was to avoid interrupting either the GSC FW load o...
```diff diff --git a/drivers/gpu/drm/xe/xe_gsc.c b/drivers/gpu/drm/xe/xe_gsc.c index fd41113f8572..0bcf97063ff6 100644 --- a/drivers/gpu/drm/xe/xe_gsc.c +++ b/drivers/gpu/drm/xe/xe_gsc.c @@ -555,6 +555,28 @@ void xe_gsc_wait_for_worker_completion(struct xe_gsc *gsc) flush_work(&gsc->work); } +void xe_gsc_stop_pre...
51c0ee84e4dc339287b2d7335f2b54d747794c83
Analyze and fix the following issue in the Linux kernel code: drm/xe/tests/mocs: Hold XE_FORCEWAKE_ALL for LNCF regs
Problem Details: LNCF registers report wrong values when XE_FORCEWAKE_GT only is held. Holding XE_FORCEWAKE_ALL ensures correct operations on LNCF regs. V2(Himal): - Use xe_force_wake_ref_has_domain Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1999 Fixes: a6a4ea6d7d37 ("drm/xe: Add mocs kunit") Revi...
```diff diff --git a/drivers/gpu/drm/xe/tests/xe_mocs.c b/drivers/gpu/drm/xe/tests/xe_mocs.c index ef1e5256c56a..0e502feaca81 100644 --- a/drivers/gpu/drm/xe/tests/xe_mocs.c +++ b/drivers/gpu/drm/xe/tests/xe_mocs.c @@ -46,8 +46,11 @@ static void read_l3cc_table(struct xe_gt *gt, unsigned int fw_ref, i; u32 reg_val;...
391008f34e711253c5983b0bf52277cc43723127
Analyze and fix the following issue in the Linux kernel code: drm/xe: Add page queue multiplier
Problem Details: For an unknown reason the math to determine the PF queue size does is not correct - compute UMD applications are overflowing the PF queue which is fatal. A multippier of 8 fixes the problem. Fixes: 3338e4f90c14 ("drm/xe: Use topology to determine page fault queue size") Cc: stable@vger.kernel.org Sign...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c index c5ad9a0a89c2..0c22b3a36655 100644 --- a/drivers/gpu/drm/xe/xe_gt_pagefault.c +++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c @@ -435,9 +435,16 @@ static int xe_alloc_pf_queue(struct xe_gt *gt, struct pf_queue *pf_queue) ...
b69d4413aa1961930fbf9ffad8376d577378daf9
Analyze and fix the following issue in the Linux kernel code: bpftool: Fix cgroup command to only show cgroup bpf programs
Problem Details: The netkit program is not a cgroup bpf program and should not be shown in the output of the "bpftool cgroup show" command. However, if the netkit device happens to have ifindex 3, the "bpftool cgroup show" command will output the netkit bpf program as well: > ip -d link show dev nk1 3: nk1@if2: ... ...
```diff diff --git a/tools/bpf/bpftool/cgroup.c b/tools/bpf/bpftool/cgroup.c index 3f1d6be51215..944ebe21a216 100644 --- a/tools/bpf/bpftool/cgroup.c +++ b/tools/bpf/bpftool/cgroup.c @@ -318,11 +318,11 @@ static int show_bpf_progs(int cgroup_fd, enum bpf_attach_type type, static int do_show(int argc, char **argv) {...
01475aedfdfa33a5ee3219079426f5743367c624
Analyze and fix the following issue in the Linux kernel code: futex: Fix outdated comment in struct restart_block
Problem Details: Since commit 2070887fdeac ("futex: fix restart in wait_requeue_pi"), futex_wait_requeue_pi() no longer uses restart_block. Update the comment accordingly. Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250428193445....
```diff diff --git a/include/linux/restart_block.h b/include/linux/restart_block.h index 13f17676c5f4..7e50bbc94e47 100644 --- a/include/linux/restart_block.h +++ b/include/linux/restart_block.h @@ -26,7 +26,7 @@ struct restart_block { unsigned long arch_data; long (*fn)(struct restart_block *); union { - /* For...
897adaf536ab01f130ce0b53a635a592733c0f24
Analyze and fix the following issue in the Linux kernel code: clk: rockchip: rk3036: fix implementation of usb480m clock mux
Problem Details: Contrary to how it is implemented right now, this mux is controllable via a bit in CRU_MUSC_CON (same bit as on rk3128 even) and allows switching between xin24m and the 480m output of the usb2phy. So drop the hard-coded fixed-factor clock and implement the correct mux instead. Signed-off-by: Heiko St...
```diff diff --git a/drivers/clk/rockchip/clk-rk3036.c b/drivers/clk/rockchip/clk-rk3036.c index d341ce0708aa..41c71bb25171 100644 --- a/drivers/clk/rockchip/clk-rk3036.c +++ b/drivers/clk/rockchip/clk-rk3036.c @@ -123,6 +123,7 @@ PNAME(mux_timer_p) = { "xin24m", "pclk_peri_src" }; PNAME(mux_pll_src_apll_dpll_gpll_us...
73ed6faed58e5611abfb54c2f703eec091781d63
Analyze and fix the following issue in the Linux kernel code: comedi: drivers: adl_pci9118.c: Edit file so that checkpatch.pl has 0 typo errors
Problem Details: Fix errors produced by checkpath.pl about typos. Signed-off-by: Heikki Huttu <heissendo88@gmail.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Link: https://lore.kernel.org/r/aBzfbvF6YdaYDDYk@Lappari.v6.elisa-laajakaista.fi Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/comedi/drivers/adl_pci9118.c b/drivers/comedi/drivers/adl_pci9118.c index a76e2666d583..67c663892e48 100644 --- a/drivers/comedi/drivers/adl_pci9118.c +++ b/drivers/comedi/drivers/adl_pci9118.c @@ -32,7 +32,7 @@ * ranges). * * There are some hardware limitations: - * a) You cann't use...
8ffec7d62c6956199f442dac3b2d5d02231c3977
Analyze and fix the following issue in the Linux kernel code: arm64: dts: renesas: white-hawk-single: Improve Ethernet TSN description
Problem Details: - Add the missing "ethernet3" alias for the Ethernet TSN port, so U-Boot will fill its local-mac-address property based on the "eth3addr" environment variable (if set), avoiding a random MAC address being assigned by the OS, - Rename the numerical Ethernet PHY label to "tsn0_phy", to avoi...
```diff diff --git a/arch/arm64/boot/dts/renesas/white-hawk-single.dtsi b/arch/arm64/boot/dts/renesas/white-hawk-single.dtsi index 20e8232f2f32..976a3ab44e5a 100644 --- a/arch/arm64/boot/dts/renesas/white-hawk-single.dtsi +++ b/arch/arm64/boot/dts/renesas/white-hawk-single.dtsi @@ -11,6 +11,10 @@ / { model = "Renesa...
adfab6b39202481bb43286fff94def4953793fdb
Analyze and fix the following issue in the Linux kernel code: ACPI: PPTT: Fix processor subtable walk
Problem Details: The original PPTT code had a bug where the processor subtable length was not correctly validated when encountering a truncated acpi_pptt_processor node. Commit 7ab4f0e37a0f4 ("ACPI PPTT: Fix coding mistakes in a couple of sizeof() calls") attempted to fix this by validating the size is as large as the...
```diff diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c index f73ce6e13065..54676e3d82dd 100644 --- a/drivers/acpi/pptt.c +++ b/drivers/acpi/pptt.c @@ -231,16 +231,18 @@ static int acpi_pptt_leaf_node(struct acpi_table_header *table_hdr, sizeof(struct acpi_table_pptt)); proc_sz = sizeof(struct acpi_pp...
8eca9e979a1efbcc3d090f6eb3f4da621e7c87e0
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: Update eMMC for NanoPi R5 series
Problem Details: Add the 3.3v and 1.8v regulators that are connected to the eMMC on the R5 series devices, as well as adding the eMMC data strobe, and enable eMMC HS200 mode as the Foresee FEMDNN0xxG-A3A55 modules support it. Fixes: c8ec73b05a95d ("arm64: dts: rockchip: create common dtsi for NanoPi R5 series") Signed...
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi index 00c479aa1871..a28b4af10d13 100644 --- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dtsi @@ -486,9 +486,12 @@ &sdhci { bus-...
f6bff7827a48e59cff1ef98aae72452d65174e0c
Analyze and fix the following issue in the Linux kernel code: riscv: uaccess: use 'asm_goto_output' for get_user()
Problem Details: With 'asm goto' we don't need to test the error etc, the exception just jumps to the error handling directly. Unlike put_user(), get_user() must work around GCC bugs [1] when using output clobbers in an asm goto statement. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921 # 1 Signed-off-by: ...
```diff diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uaccess.h index 719c9179a751..87d01168f80a 100644 --- a/arch/riscv/include/asm/uaccess.h +++ b/arch/riscv/include/asm/uaccess.h @@ -96,27 +96,58 @@ static inline unsigned long __untagged_addr_remote(struct mm_struct *mm, unsigne * call. ...
cdf647e817143c9762c5bdf724ca2821a171f011
Analyze and fix the following issue in the Linux kernel code: riscv: uaccess: use 'asm goto' for put_user()
Problem Details: With 'asm goto' we don't need to test the error etc, the exception just jumps to the error handling directly. Because there are no output clobbers which could trigger gcc bugs [1] the use of asm_goto_output() macro is not necessary here. Not using asm_goto_output() is desirable as the generated output...
```diff diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uaccess.h index da36057847f0..719c9179a751 100644 --- a/arch/riscv/include/asm/uaccess.h +++ b/arch/riscv/include/asm/uaccess.h @@ -214,61 +214,66 @@ do { \ ((x) = (__force __typeof__(x))0, -EFAULT); \ }) -#define __put_user_asm...
62135bf660b2c3887e22f33d3adbefedb4dc9c7a
Analyze and fix the following issue in the Linux kernel code: riscv: uaccess: use input constraints for ptr of __put_user()
Problem Details: Putting ptr in the inputs as opposed to output may seem incorrect but this is done for a few reasons: - Not having it in the output permits the use of asm goto in a subsequent patch. There are bugs in gcc [1] which would otherwise prevent it. - Since the output memory is userspace there isn't any r...
```diff diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uaccess.h index c9a461467bf4..da36057847f0 100644 --- a/arch/riscv/include/asm/uaccess.h +++ b/arch/riscv/include/asm/uaccess.h @@ -219,11 +219,11 @@ do { \ __typeof__(*(ptr)) __x = x; \ __asm__ __volatile__ ( \ "1:\n" ...
788aa64c01f1262310b4c1fb827a36df170d86ea
Analyze and fix the following issue in the Linux kernel code: riscv: save the SR_SUM status over switches
Problem Details: When threads/tasks are switched we need to ensure the old execution's SR_SUM state is saved and the new thread has the old SR_SUM state restored. The issue was seen under heavy load especially with the syz-stress tool running, with crashes as follows in schedule_tail: Unable to handle kernel access t...
```diff diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h index 5f56eb9d114a..58fd11c89fe9 100644 --- a/arch/riscv/include/asm/processor.h +++ b/arch/riscv/include/asm/processor.h @@ -103,6 +103,7 @@ struct thread_struct { struct __riscv_d_ext_state fstate; unsigned long bad_cause...
f55aef7e0cc7583062cbda9becaa3b2ba3255fa3
Analyze and fix the following issue in the Linux kernel code: lib/tests: randstruct: Add deep function pointer layout test
Problem Details: The recent fix in commit c2ea09b193d2 ("randstruct: gcc-plugin: Remove bogus void member") has fixed another issue: it was not always detecting composite structures made only of function pointers and structures of function pointers. Add a test for this case, and break out the layout tests since this is...
```diff diff --git a/lib/tests/randstruct_kunit.c b/lib/tests/randstruct_kunit.c index c796c8fae263..f3a2d63c4cfb 100644 --- a/lib/tests/randstruct_kunit.c +++ b/lib/tests/randstruct_kunit.c @@ -56,7 +56,6 @@ struct randstruct_funcs_untouched { struct randstruct_funcs_shuffled { DO_MANY_MEMBERS(func_member) }; -#un...
e136a4062174a9a8d1c1447ca040ea81accfa6a8
Analyze and fix the following issue in the Linux kernel code: randstruct: gcc-plugin: Remove bogus void member
Problem Details: When building the randomized replacement tree of struct members, the randstruct GCC plugin would insert, as the first member, a 0-sized void member. This appears as though it was done to catch non-designated ("unnamed") static initializers, which wouldn't be stable since they depend on the original str...
```diff diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index 5694df3da2e9..971a1908a8cc 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c @@ -344,29 +344,13 @@ static int relayout_struct(tree type) ...
960013ec5b5e86c2c096e79ce6e08bce970650b3
Analyze and fix the following issue in the Linux kernel code: net: qede: Initialize qede_ll_ops with designated initializer
Problem Details: After a recent change [1] in clang's randstruct implementation to randomize structures that only contain function pointers, there is an error because qede_ll_ops get randomized but does not use a designated initializer for the first member: drivers/net/ethernet/qlogic/qede/qede_main.c:206:2: error: ...
```diff diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c index 99df00c30b8c..b5d744d2586f 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_main.c +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c @@ -203,7 +203,7 @@ static struct pci_driver qede_pci_driver = { ...
d8720235d5b5cad86c1f07f65117ef2a96f8bec7
Analyze and fix the following issue in the Linux kernel code: scsi: qedf: Use designated initializer for struct qed_fcoe_cb_ops
Problem Details: Recent fixes to the randstruct GCC plugin allowed it to notice that this structure is entirely function pointers and is therefore subject to randomization, but doing so requires that it always use designated initializers. Explicitly specify the "common" member as being initialized. Silences: drivers/s...
```diff diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 436bd29d5eba..6b1ebab36fa3 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -699,7 +699,7 @@ static u32 qedf_get_login_failures(void *cookie) } static struct qed_fcoe_cb_ops qedf_cb_ops = { - { ...
5e88c48cb4bcbd0ea683373a106268933bb4edd2
Analyze and fix the following issue in the Linux kernel code: kbuild: Switch from -Wvla to -Wvla-larger-than=1
Problem Details: Variable Length Arrays (VLAs) on the stack must not be used in the kernel. Function parameter VLAs[1] should be usable, but -Wvla will warn for those. For example, this will produce a warning but it is not using a stack VLA: int something(size_t n, int array[n]) { ... Clang has no way yet to dist...
```diff diff --git a/lib/Makefile b/lib/Makefile index f07b24ce1b3f..c38582f187dd 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -71,7 +71,6 @@ CFLAGS_test_bitops.o += -Werror obj-$(CONFIG_TEST_SYSCTL) += test_sysctl.o obj-$(CONFIG_TEST_IDA) += test_ida.o obj-$(CONFIG_TEST_UBSAN) += test_ubsan.o -CFLAGS_test_ubsan....
47e36ed7840661a9f7fb53554a1b04a5f8daffea
Analyze and fix the following issue in the Linux kernel code: overflow: Fix direct struct member initialization in _DEFINE_FLEX()
Problem Details: Currently, to statically initialize the struct members of the `type` object created by _DEFINE_FLEX(), the internal `obj` member must be explicitly referenced at the call site. See: struct flex { int a; int b; struct foo flex_array[]; }; _DEFINE_FLEX(struct flex, instance, fle...
```diff diff --git a/include/linux/overflow.h b/include/linux/overflow.h index f33d74dac06f..7b7be27ca113 100644 --- a/include/linux/overflow.h +++ b/include/linux/overflow.h @@ -396,7 +396,7 @@ static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend) * @name: Name for a variable to define. * @...
6e6500e4e4a7f7431a6d7ab02a332ea5fca5c9fa
Analyze and fix the following issue in the Linux kernel code: kunit/overflow: Add tests for STACK_FLEX_ARRAY_SIZE() helper
Problem Details: Add a couple of tests for new STACK_FLEX_ARRAY_SIZE() helper. Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/c127631a03cdd7f59bfa091b9666a93bf69d0322.1745355442.git.gustavoars@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
```diff diff --git a/lib/tests/overflow_kunit.c b/lib/tests/overflow_kunit.c index 894691b4411a..19cb03b25dc5 100644 --- a/lib/tests/overflow_kunit.c +++ b/lib/tests/overflow_kunit.c @@ -1210,6 +1210,10 @@ static void DEFINE_FLEX_test(struct kunit *test) KUNIT_EXPECT_EQ(test, __struct_size(empty->array), 0); KUNIT_...
190faecf64c54bb5f9d8f0ea2a6628078d0f2c83
Analyze and fix the following issue in the Linux kernel code: overflow: Add STACK_FLEX_ARRAY_SIZE() helper
Problem Details: Add new STACK_FLEX_ARRAY_SIZE() helper to get the size of a flexible-array member defined using DEFINE_FLEX()/DEFINE_RAW_FLEX() at compile time. This is essentially the same as ARRAY_SIZE() but for on-stack flexible-array members. Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https...
```diff diff --git a/include/linux/overflow.h b/include/linux/overflow.h index 6ee67c20b575..f33d74dac06f 100644 --- a/include/linux/overflow.h +++ b/include/linux/overflow.h @@ -420,6 +420,8 @@ static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend) * flexible array member. * Use __struct_siz...
0f45696ddb2b901fbf15cb8d2e89767be481d59f
Analyze and fix the following issue in the Linux kernel code: drm/i915/dp: Fix determining SST/MST mode during MTP TU state computation
Problem Details: Determining the SST/MST mode during state computation must be done based on the output type stored in the CRTC state, which in turn is set once based on the modeset connector's SST vs. MST type and will not change as long as the connector is using the CRTC. OTOH the MST mode indicated by the given conn...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index aeda59f5fa7a..30f5636d18b7 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -253,7 +253,7 @@ int intel_dp_mtp_tu_compute_config(struct intel_d...
70e21ac8b0543def19c8bd1addeec4995fbc0ea9
Analyze and fix the following issue in the Linux kernel code: perf parse-events: Add debug dump of evlist if reordered
Problem Details: Add debug verbose output to show how evsels were reordered by parse_events__sort_events_and_fix_groups(). For example: ``` $ perf record -v -e '{instructions,cycles}' true Using CPUID GenuineIntel-6-B7-1 WARNING: events were regrouped to match PMUs evlist after sorting/fixing: '{cpu_atom/instructions/...
```diff diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 89708d1769c8..7297ca3a4eec 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -28,6 +28,7 @@ #include "util/evsel_config.h" #include "util/event.h" #include "util/bpf-filter.h" +#include "util/...
5a11a2767731139bf87e667331aa2209e33a1d19
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/hdp7: use memcfg register to post the write for HDP flush
Problem Details: Reading back the remapped HDP flush register seems to cause problems on some platforms. All we need is a read, so read back the memcfg register. Fixes: 689275140cb8 ("drm/amdgpu/hdp7.0: do a posting read when flushing HDP") Reported-by: Alexey Klimov <alexey.klimov@linaro.org> Link: https://lists.free...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/hdp_v7_0.c b/drivers/gpu/drm/amd/amdgpu/hdp_v7_0.c index 49f7eb4fbd11..2c9239a22f39 100644 --- a/drivers/gpu/drm/amd/amdgpu/hdp_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/hdp_v7_0.c @@ -32,7 +32,12 @@ static void hdp_v7_0_flush_hdp(struct amdgpu_device *adev, { if (!ring ...
ca28e80abe4219c8f1a2961ae05102d70af6dc87
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/hdp6: use memcfg register to post the write for HDP flush
Problem Details: Reading back the remapped HDP flush register seems to cause problems on some platforms. All we need is a read, so read back the memcfg register. Fixes: abe1cbaec6cf ("drm/amdgpu/hdp6.0: do a posting read when flushing HDP") Reported-by: Alexey Klimov <alexey.klimov@linaro.org> Link: https://lists.free...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c b/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c index a88d25a06c29..6ccd31c8bc69 100644 --- a/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c @@ -35,7 +35,12 @@ static void hdp_v6_0_flush_hdp(struct amdgpu_device *adev, { if (!ring ...
dbc988c689333faeeed44d5561f372ff20395304
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/hdp5.2: use memcfg register to post the write for HDP flush
Problem Details: Reading back the remapped HDP flush register seems to cause problems on some platforms. All we need is a read, so read back the memcfg register. Fixes: f756dbac1ce1 ("drm/amdgpu/hdp5.2: do a posting read when flushing HDP") Reported-by: Alexey Klimov <alexey.klimov@linaro.org> Link: https://lists.free...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/hdp_v5_2.c b/drivers/gpu/drm/amd/amdgpu/hdp_v5_2.c index fcb8dd2876bc..40940b4ab400 100644 --- a/drivers/gpu/drm/amd/amdgpu/hdp_v5_2.c +++ b/drivers/gpu/drm/amd/amdgpu/hdp_v5_2.c @@ -33,7 +33,17 @@ static void hdp_v5_2_flush_hdp(struct amdgpu_device *adev, if (!ring || ...
0e33e0f339b91eecd9558311449a3d1e728722d4
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/hdp5: use memcfg register to post the write for HDP flush
Problem Details: Reading back the remapped HDP flush register seems to cause problems on some platforms. All we need is a read, so read back the memcfg register. Fixes: cf424020e040 ("drm/amdgpu/hdp5.0: do a posting read when flushing HDP") Reported-by: Alexey Klimov <alexey.klimov@linaro.org> Link: https://lists.free...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c b/drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c index 43195c079748..086a647308df 100644 --- a/drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c +++ b/drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c @@ -32,7 +32,12 @@ static void hdp_v5_0_flush_hdp(struct amdgpu_device *adev, { if (!ring ...
43ba56a043b14426ca9ecac875ab357e32cb595e
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to return correct error number in f2fs_sync_node_pages()
Problem Details: If __write_node_folio() failed, it will return AOP_WRITEPAGE_ACTIVATE, the incorrect return value may be passed to userspace in below path, fix it. - sync_filesystem - sync_fs - f2fs_issue_checkpoint - block_operations - f2fs_sync_node_pages - __write_node_folio : return AOP_WRITEP...
```diff diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index ec74eb9982a5..69308523c34e 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2092,10 +2092,14 @@ write_node: ret = __write_node_folio(folio, false, &submitted, wbc, do_balance, io_type, NULL); - if (ret) + if (ret) { folio_unlock(folio)...
afc6053d4c4b0a6be500b9e643aa17221e93a57b
Analyze and fix the following issue in the Linux kernel code: Reapply: drm/amdgpu: Use generic hdp flush function
Problem Details: Except HDP v5.2 all use a common logic for HDP flush. Use a generic function. HDP v5.2 forces NO_KIQ logic, revisit it later. Reapply after fixing up an HDP regression. v2: merge the fix (Alex) Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Revie...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c index b6cf801939aa..6e02fb9ac2f6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c @@ -22,6 +22,7 @@ */ #include "amdgpu.h" #include "amdgpu_ras.h" +#include <uapi/...
dbc064adfcf9095e7d895bea87b2f75c1ab23236
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/hdp7: use memcfg register to post the write for HDP flush
Problem Details: Reading back the remapped HDP flush register seems to cause problems on some platforms. All we need is a read, so read back the memcfg register. Fixes: 689275140cb8 ("drm/amdgpu/hdp7.0: do a posting read when flushing HDP") Reported-by: Alexey Klimov <alexey.klimov@linaro.org> Link: https://lists.free...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/hdp_v7_0.c b/drivers/gpu/drm/amd/amdgpu/hdp_v7_0.c index 49f7eb4fbd11..2c9239a22f39 100644 --- a/drivers/gpu/drm/amd/amdgpu/hdp_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/hdp_v7_0.c @@ -32,7 +32,12 @@ static void hdp_v7_0_flush_hdp(struct amdgpu_device *adev, { if (!ring ...
84141ff615951359c9a99696fd79a36c465ed847
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/hdp6: use memcfg register to post the write for HDP flush
Problem Details: Reading back the remapped HDP flush register seems to cause problems on some platforms. All we need is a read, so read back the memcfg register. Fixes: abe1cbaec6cf ("drm/amdgpu/hdp6.0: do a posting read when flushing HDP") Reported-by: Alexey Klimov <alexey.klimov@linaro.org> Link: https://lists.free...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c b/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c index a88d25a06c29..6ccd31c8bc69 100644 --- a/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c @@ -35,7 +35,12 @@ static void hdp_v6_0_flush_hdp(struct amdgpu_device *adev, { if (!ring ...
4a89b7698e771914b4d5b571600c76e2fdcbe2a9
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/hdp5.2: use memcfg register to post the write for HDP flush
Problem Details: Reading back the remapped HDP flush register seems to cause problems on some platforms. All we need is a read, so read back the memcfg register. Fixes: f756dbac1ce1 ("drm/amdgpu/hdp5.2: do a posting read when flushing HDP") Reported-by: Alexey Klimov <alexey.klimov@linaro.org> Link: https://lists.free...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/hdp_v5_2.c b/drivers/gpu/drm/amd/amdgpu/hdp_v5_2.c index fcb8dd2876bc..40940b4ab400 100644 --- a/drivers/gpu/drm/amd/amdgpu/hdp_v5_2.c +++ b/drivers/gpu/drm/amd/amdgpu/hdp_v5_2.c @@ -33,7 +33,17 @@ static void hdp_v5_2_flush_hdp(struct amdgpu_device *adev, if (!ring || ...
a5cb344033c7598762e89255e8ff52827abb57a4
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/hdp5: use memcfg register to post the write for HDP flush
Problem Details: Reading back the remapped HDP flush register seems to cause problems on some platforms. All we need is a read, so read back the memcfg register. Fixes: cf424020e040 ("drm/amdgpu/hdp5.0: do a posting read when flushing HDP") Reported-by: Alexey Klimov <alexey.klimov@linaro.org> Link: https://lists.free...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c b/drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c index 43195c079748..086a647308df 100644 --- a/drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c +++ b/drivers/gpu/drm/amd/amdgpu/hdp_v5_0.c @@ -32,7 +32,12 @@ static void hdp_v5_0_flush_hdp(struct amdgpu_device *adev, { if (!ring ...
9761037d28327e0d4ee9586a8210ef6462c2c757
Analyze and fix the following issue in the Linux kernel code: mux: adgs1408: fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'chip_id' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: adgs1408.c:63:12: error: cast to smaller integer type 'enum adgs1408_chip_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/202505...
```diff diff --git a/drivers/mux/adgs1408.c b/drivers/mux/adgs1408.c index 5386cfedcb06..5eaf07d09ac9 100644 --- a/drivers/mux/adgs1408.c +++ b/drivers/mux/adgs1408.c @@ -59,7 +59,7 @@ static int adgs1408_probe(struct spi_device *spi) s32 idle_state; int ret; - chip_id = (enum adgs1408_chip_id)spi_get_device_matc...
824afb9b04648ea11531fc9047923ec07e7a943d
Analyze and fix the following issue in the Linux kernel code: block: move removing elevator after deleting disk->queue_kobj
Problem Details: When blk_unregister_queue() is called from add_disk() failure path, there is race in registering/unregistering elevator queue kobject from the two code paths, because commit 559dc11143eb ("block: move elv_register[unregister]_queue out of elevator_lock") moves elevator queue register/unregister out of ...
```diff diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 8be2390c3c19..b2b9b89d6967 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -948,9 +948,6 @@ void blk_unregister_queue(struct gendisk *disk) blk_mq_sysfs_unregister(disk); blk_crypto_sysfs_unregister(disk); - if (queue_is_mq(q)) - elevato...
8336d18c6b57a603aaa4db76bbf4f8cb08acfa5e
Analyze and fix the following issue in the Linux kernel code: block: don't quiesce queue for calling elevator_set_none()
Problem Details: blk_mq_freeze_queue() can't be called on quiesced queue, otherwise it may never return if there is any queued requests. Fix it by removing quiesce queue around elevator_set_none() because elevator_switch() does quiesce queue in case that we need to switch to none really. Fixes: 1e44bedbc921 ("block: ...
```diff diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 386374ff655b..8be2390c3c19 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -948,11 +948,8 @@ void blk_unregister_queue(struct gendisk *disk) blk_mq_sysfs_unregister(disk); blk_crypto_sysfs_unregister(disk); - if (queue_is_mq(q)) { - blk_...
864f3ddcd7153fdb3f2d3822e563985135d8eafa
Analyze and fix the following issue in the Linux kernel code: kselftest/arm64: fp-ptrace: Adjust to new inactive mode behaviour
Problem Details: In order to fix an ABI problem, we recently changed the way that reads of the NT_ARM_SVE and NT_ARM_SSVE regsets behave when their corresponding vector state is inactive. Update the fp-ptrace test for the new behaviour. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Catalin Marinas <catalin.m...
```diff diff --git a/tools/testing/selftests/arm64/fp/fp-ptrace.c b/tools/testing/selftests/arm64/fp/fp-ptrace.c index c2882a5a5cc0..191c47ca0ed8 100644 --- a/tools/testing/selftests/arm64/fp/fp-ptrace.c +++ b/tools/testing/selftests/arm64/fp/fp-ptrace.c @@ -439,10 +439,17 @@ static bool check_ptrace_values_sve(pid_t c...
031a2acaa1cdab3c89dfb810a8cb75ddfdf5a65c
Analyze and fix the following issue in the Linux kernel code: kselftest/arm64: fp-ptrace: Adjust to new VL change behaviour
Problem Details: In order to fix an ABI problem, we recently changed the way that changing the SVE/SME vector length affects PSTATE.SM. Historically, changing the SME vector length would clear PSTATE.SM. Now, changing the SME vector length preserves PSTATE.SM. Update the fp-ptrace test for the new behaviour. Signed-o...
```diff diff --git a/tools/testing/selftests/arm64/fp/fp-ptrace.c b/tools/testing/selftests/arm64/fp/fp-ptrace.c index 762048eb354f..c2882a5a5cc0 100644 --- a/tools/testing/selftests/arm64/fp/fp-ptrace.c +++ b/tools/testing/selftests/arm64/fp/fp-ptrace.c @@ -1183,18 +1183,8 @@ static void sve_write(pid_t child, struct ...
be45e63f79ecfea8373f18f50330838d77553a6b
Analyze and fix the following issue in the Linux kernel code: kselftest/arm64: tpidr2: Adjust to new clone() behaviour
Problem Details: In order to fix an ABI problem, we recently changed the way that a clone() syscall manipulates TPIDR2 and PSTATE.ZA. Historically the child would inherit the parent's TPIDR2 value unless CLONE_SETTLS was set, and now the child will inherit the parent's TPIDR2 value unless CLONE_VM is set. Update the t...
```diff diff --git a/tools/testing/selftests/arm64/abi/tpidr2.c b/tools/testing/selftests/arm64/abi/tpidr2.c index 285c47dd42f6..eb19dcc37a75 100644 --- a/tools/testing/selftests/arm64/abi/tpidr2.c +++ b/tools/testing/selftests/arm64/abi/tpidr2.c @@ -169,8 +169,10 @@ static int sys_clone(unsigned long clone_flags, unsi...
78b23877dbba7dbcda2b89383d17bed82ce8f663
Analyze and fix the following issue in the Linux kernel code: kselftest/arm64: fp-ptrace: Fix expected FPMR value when PSTATE.SM is changed
Problem Details: The fp-ptrace test suite expects that FPMR is set to zero when PSTATE.SM is changed via ptrace, but ptrace has never altered FPMR in this way, and the test logic erroneously relies upon (and has concealed) a bug where task_fpsimd_load() would unexpectedly and non-deterministically clobber FPMR. Using ...
```diff diff --git a/tools/testing/selftests/arm64/fp/fp-ptrace.c b/tools/testing/selftests/arm64/fp/fp-ptrace.c index 4930e03a7b99..762048eb354f 100644 --- a/tools/testing/selftests/arm64/fp/fp-ptrace.c +++ b/tools/testing/selftests/arm64/fp/fp-ptrace.c @@ -891,18 +891,11 @@ static void set_initial_values(struct test_...
07cb9b51076f452c286fb69f3af4c65e54affaa3
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: rt9123: Fix sparse cast warning
Problem Details: Use i2c block read/write API to fix casting warning. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202505072140.iHyLlDN6-lkp@intel.com/ Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Link: https://patch.msgid.link/185a5ffea22ebd20725fdc7739db6b6addfa...
```diff diff --git a/sound/soc/codecs/rt9123.c b/sound/soc/codecs/rt9123.c index d9a22fda3d26..242e8c975a62 100644 --- a/sound/soc/codecs/rt9123.c +++ b/sound/soc/codecs/rt9123.c @@ -399,17 +399,17 @@ static int rt9123_i2c_probe(struct i2c_client *i2c) dev_dbg(dev, "No 'enable' GPIO specified, treat it as default on...
9f8bf718f29230e38a048d08fc3063e316cd60c1
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: ptrace: Gracefully handle errors
Problem Details: Within sve_set_common() we do not handle error conditions correctly: * When writing to NT_ARM_SSVE, if sme_alloc() fails, the task will be left with task->thread.sme_state==NULL, but TIF_SME will be set and task->thread.fp_type==FP_STATE_SVE. This will result in a subsequent null pointer derefer...
```diff diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index cff72b420eab..a360e52db02f 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -892,13 +892,15 @@ static int sve_set_common(struct task_struct *target, unsigned long start, end; bool fpsimd; + fpsimd_flush_t...
f916dd32a943a7ab40497718aa7bcf3648d2bb39
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: ptrace: Mandate SVE payload for streaming-mode state
Problem Details: When a task has PSTATE.SM==1, reads of NT_ARM_SSVE are required to always present a header with SVE_PT_REGS_SVE, and register data in SVE format. Reads of NT_ARM_SSVE must never present register data in FPSIMD format. Within the kernel, we always expect streaming SVE data to be stored in SVE format. C...
```diff diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index a2075e1df27c..cff72b420eab 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -890,6 +890,7 @@ static int sve_set_common(struct task_struct *target, struct user_sve_header header; unsigned int vq; unsigned ...
b93e685ecff77e0b231c12802fb632ef36a62140
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: ptrace: Do not present register data for inactive mode
Problem Details: The SME ptrace ABI is written around the incorrect assumption that SVE_PT_REGS_FPSIMD and SVE_PT_REGS_SVE are independent bit flags, where it is possible for both to be clear. In reality they are different values for bit 0 of the header flags, where SVE_PT_REGS_FPSIMD is 0 and SVE_PT_REGS_SVE is 1. In ...
```diff diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 67f3843de51f..a2075e1df27c 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -775,6 +775,11 @@ static void sve_init_header_from_task(struct user_sve_header *header, task_type = ARM64_VEC_SVE; active = (task...
054d627c5554bdd38228174b275d62113124e3ad
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: ptrace: Save task state before generating SVE header
Problem Details: As sve_init_header_from_task() consumes the saved value of PSTATE.SM and the saved fp_type, both must be saved before the header is generated. When generating a coredump for the current task, sve_get_common() calls sve_init_header_from_task() before saving the task's state. Consequently the header may...
```diff diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index bdba106a4cf2..67f3843de51f 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -820,15 +820,15 @@ static int sve_get_common(struct task_struct *target, unsigned int vq; unsigned long start, end; + if (target...
b87c8c4aca1163ae4791507089007863e9c3ca1b
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: ptrace/prctl: Ensure VL changes leave task in a valid state
Problem Details: Currently, vec_set_vector_length() can manipulate a task into an invalid state as a result of a prctl/ptrace syscall which changes the SVE/SME vector length, resulting in several problems: (1) When changing the SVE vector length, if the task initially has PSTATE.ZA==1, and sve_alloc() fails to all...
```diff diff --git a/Documentation/arch/arm64/sme.rst b/Documentation/arch/arm64/sme.rst index 1c1e48d8bd1a..4cb38330e704 100644 --- a/Documentation/arch/arm64/sme.rst +++ b/Documentation/arch/arm64/sme.rst @@ -241,7 +241,7 @@ prctl(PR_SME_SET_VL, unsigned long arg) length, or calling PR_SME_SET_VL with the PR_S...
49ce484187f72a94c202348179a9a4e63a0f864b
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: ptrace/prctl: Ensure VL changes do not resurrect stale data
Problem Details: The SVE/SME vector lengths can be changed via prctl/ptrace syscalls. Changes to the SVE/SME vector lengths are documented as preserving the lower 128 bits of the Z registers (i.e. the bits shared with the FPSIMD V registers). To ensure this, vec_set_vector_length() explicitly copies register values fro...
```diff diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index fe96e018e18c..faeedaab0558 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -852,7 +852,7 @@ int vec_set_vector_length(struct task_struct *task, enum vec_type type, fpsimd_flush_task_state(task); if (test_a...
a6d066f705747124fb2d662df0acbb45ffe6c406
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: Clear PSTATE.SM during clone()
Problem Details: Currently arch_dup_task_struct() doesn't handle cases where the parent task has PSTATE.SM==1. Since syscall entry exits streaming mode, the parent will usually have PSTATE.SM==0, but this can be change by ptrace after syscall entry. When this happens, arch_dup_task_struct() will initialise the new task...
```diff diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 3bb7f65bf7b7..27a5b0c7ec60 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -355,16 +355,13 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) *dst = *src; /* - * Detach sr...
e0cb0f26594c644c71ee7f48ebaae6b26bf56a12
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: Consistently preserve FPSIMD state during clone()
Problem Details: In arch_dup_task_struct() we try to ensure that the child task inherits the FPSIMD state of its parent, but this depends on the parent task's saved state being in FPSIMD format, which is not always the case. Consequently the child task may inherit stale FPSIMD state in some cases. This can happen when...
```diff diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 885c1adcf54c..3bb7f65bf7b7 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -344,7 +344,14 @@ void arch_release_task_struct(struct task_struct *tsk) int arch_dup_task_struct(struct task_struct *dst, stru...
99560c9452bb9819334bdb9c6e9e27c0f45f8829
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: signal: Use SMSTOP behaviour in setup_return()
Problem Details: Historically the behaviour of setup_return() was nondeterministic, depending on whether the task's FSIMD/SVE/SME state happened to be live. We fixed most of that in commit: 929fa99b1215 ("arm64/fpsimd: signal: Always save+flush state early") ... but we didn't decide on how clearing PSTATE.SM should...
```diff diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index d42d83b45249..417140cd399b 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -1476,22 +1476,8 @@ static int setup_return(struct pt_regs *regs, struct ksignal *ksig, /* Signal handlers are invoked with ZA and...
316283f276ebd5596d2015e4653198bdc2e138d4
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: ptrace: Consistently handle partial writes to NT_ARM_(S)SVE
Problem Details: Partial writes to the NT_ARM_SVE and NT_ARM_SSVE regsets using an payload are handled inconsistently and non-deterministically. A comment within sve_set_common() indicates that we intended that a partial write would preserve any effective FPSIMD/SVE state which was not overwritten, but this has never w...
```diff diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h index 11b9c6a5e037..da1bd5b9a7e7 100644 --- a/arch/arm64/include/asm/fpsimd.h +++ b/arch/arm64/include/asm/fpsimd.h @@ -198,7 +198,6 @@ struct vl_info { extern void sve_alloc(struct task_struct *task, bool flush); extern void fps...
c82b6357a5465a3222780ac5d3edcdfb02208cc3
Analyze and fix the following issue in the Linux kernel code: Bluetooth: hci_event: Fix not using key encryption size when its known
Problem Details: This fixes the regression introduced by 50c1241e6a8a ("Bluetooth: l2cap: Check encryption key size on incoming connection") introduced a check for l2cap_check_enc_key_size which checks for hcon->enc_key_size which may not be initialized if HCI_OP_READ_ENC_KEY_SIZE is still pending. If the key encrypti...
```diff diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 522d837a23fa..54bfeeaa0995 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -1798,6 +1798,7 @@ struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list, void hci_uuids_c...
b465ace42620970e840c7aeb2c44a6e3b1002fec
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: signal: Mandate SVE payload for streaming-mode state
Problem Details: Non-streaming SVE state may be preserved without an SVE payload, in which case the SVE context only has a header with VL==0, and all state can be restored from the FPSIMD context. Streaming SVE state is always preserved with an SVE payload, where the SVE context header has VL!=0, and the SVE_SIG_FLAG_S...
```diff diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index fdce1b856f49..e898948a31b6 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -387,6 +387,7 @@ static int restore_sve_fpsimd_context(struct user_ctxs *user) unsigned int vl, vq; struct user_fpsimd_state fpsim...
1bf663a86a4505a97f08d06c373704de9441c891
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: signal: Clear PSTATE.SM when restoring FPSIMD frame only
Problem Details: On systems with SVE and/or SME, the kernel will always create SVE and FPSIMD signal frames when delivering a signal, but a user can manipulate signal frames such that a signal return only observes an FPSIMD signal frame. When this happens, restore_fpsimd_context() will restore state such that fp_type==...
```diff diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index 48d3c0129dad..fdce1b856f49 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -280,6 +280,7 @@ static int restore_fpsimd_context(struct user_ctxs *user) __get_user_error(fpsimd.fpcr, &(user->fpsimd->fpcr), err)...
398edaa12f9cf2be7902f306fc023c20e3ebd3e4
Analyze and fix the following issue in the Linux kernel code: arm64/fpsimd: Do not discard modified SVE state
Problem Details: Historically SVE state was discarded deterministically early in the syscall entry path, before ptrace is notified of syscall entry. This permitted ptrace to modify SVE state before and after the "real" syscall logic was executed, with the modified state being retained. This behaviour was changed by co...
```diff diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h index b7adb2c72204..11b9c6a5e037 100644 --- a/arch/arm64/include/asm/fpsimd.h +++ b/arch/arm64/include/asm/fpsimd.h @@ -6,6 +6,7 @@ #define __ASM_FP_H #include <asm/errno.h> +#include <asm/percpu.h> #include <asm/ptrace.h> #inc...
e3417ab75ab2e7dca6372a1bfa26b1be3ac5889e
Analyze and fix the following issue in the Linux kernel code: KVM: SVM: Set/clear SRSO's BP_SPEC_REDUCE on 0 <=> 1 VM count transitions
Problem Details: Set the magic BP_SPEC_REDUCE bit to mitigate SRSO when running VMs if and only if KVM has at least one active VM. Leaving the bit set at all times unfortunately degrades performance by a wee bit more than expected. Use a dedicated spinlock and counter instead of hooking virtualization enablement, as ...
```diff diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index c5470d842aed..a89c271a1951 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -607,9 +607,6 @@ static void svm_disable_virtualization_cpu(void) kvm_cpu_svm_disable(); amd_pmu_disable_virt(); - - if (cpu_feature_enabled(X86...
b7e3ec4e17e27420ebe976c7714881b64c28d63b
Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8188-mt6359: Depend on MT6359_ACCDET set or disabled
Problem Details: Commit 0116a7d84b32 ("ASoC: mediatek: mt6359: Add stub for mt6359_accdet_enable_jack_detect") added a stub for mt6359_accdet_enable_jack_detect() in order to allow the mt8188-mt6359 driver to be enabled without requiring the mt6359-accdet to also be enabled, since it is not always needed. However, in ...
```diff diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index e148d4d94160..90e367586493 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -228,8 +228,8 @@ config SND_SOC_MT8188 config SND_SOC_MT8188_MT6359 tristate "ASoC Audio driver for MT8188 with MT6359 and I2S code...
a54665ab7c20081cb6299d79dcab9960752bc741
Analyze and fix the following issue in the Linux kernel code: ftrace: Comment that ftrace_func_mapper is freed with free_ftrace_hash()
Problem Details: The structure ftrace_func_mapper only contains a single field and that is a ftrace_hash. It is used to abstract it out from a normal hash to control users of how it gets modified. The freeing of a ftrace_func_mapper structure is: free_ftrace_hash(&mapper->hash); Without context, this looks like a ...
```diff diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 014cd2cedae3..1af952cba48d 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -5208,8 +5208,12 @@ struct ftrace_func_map { void *data; }; +/* + * Note, ftrace_func_mapper is freed by free_ftrace_hash(&mapper->hash). + * The ...
47fe74098f3dadba2f9cc1e507d813a4aa93f5f3
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP2+: Fix l4ls clk domain handling in STANDBY
Problem Details: Don't put the l4ls clk domain to sleep in case of standby. Since CM3 PM FW[1](ti-v4.1.y) doesn't wake-up/enable the l4ls clk domain upon wake-up, CM3 PM FW fails to wake-up the MPU. [1] https://git.ti.com/cgit/processor-firmware/ti-amx3-cm3-pm-firmware/ Signed-off-by: Sukrut Bellary <sbellary@baylibr...
```diff diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h index c36fb2721261..86a2f9e5d0ef 100644 --- a/arch/arm/mach-omap2/clockdomain.h +++ b/arch/arm/mach-omap2/clockdomain.h @@ -48,6 +48,7 @@ #define CLKDM_NO_AUTODEPS (1 << 4) #define CLKDM_ACTIVE_WITH_MPU (1 << 5) #define CL...
aee5cf935cf94006307600015a3df44eda55c4b9
Analyze and fix the following issue in the Linux kernel code: platform/x86: alienware-wmi-wmax: Expose GPIO debug methods
Problem Details: Expose GPIO control methods present on the AWCC interface through DebugFS. These models come with an RGB lighting STM32 MCU, which usually has two GPIO pins with debug capabilities: - Pin 0: Device Firmware Update mode (DFU) - Pin 1: Negative Reset (NRST) Suggested-by: Gabriel Marcano <gabemarcano...
```diff diff --git a/Documentation/ABI/testing/debugfs-alienware-wmi b/Documentation/ABI/testing/debugfs-alienware-wmi index 48cfd4d0b002..c7f525d6baac 100644 --- a/Documentation/ABI/testing/debugfs-alienware-wmi +++ b/Documentation/ABI/testing/debugfs-alienware-wmi @@ -42,3 +42,23 @@ Description: details. RO +...
c5925f438429330e649cef67cb364af03f2175f7
Analyze and fix the following issue in the Linux kernel code: platform/x86: oxpec: Add a lower bounds check in oxp_psy_ext_set_prop()
Problem Details: The "val->intval" variable is an integer which comes from the user. This code has an upper bounds check but the lower bounds check was accidentally omitted. The write_to_ec() take a u8 value as a parameter so negative values would be truncated to positive values in the 0-255 range. Return -EINVAL if...
```diff diff --git a/drivers/platform/x86/oxpec.c b/drivers/platform/x86/oxpec.c index 4b48f4571b09..de70ca7e8493 100644 --- a/drivers/platform/x86/oxpec.c +++ b/drivers/platform/x86/oxpec.c @@ -582,7 +582,7 @@ static int oxp_psy_ext_set_prop(struct power_supply *psy, switch (psp) { case POWER_SUPPLY_PROP_CHARGE_...
59529bbe642de4eb2191a541d9b4bae7eb73862e
Analyze and fix the following issue in the Linux kernel code: firmware: SDEI: Allow sdei initialization without ACPI_APEI_GHES
Problem Details: SDEI usually initialize with the ACPI table, but on platforms where ACPI is not used, the SDEI feature can still be used to handle specific firmware calls or other customized purposes. Therefore, it is not necessary for ARM_SDE_INTERFACE to depend on ACPI_APEI_GHES. In commit dc4e8c07e9e2 ("ACPI: APEI...
```diff diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index 3cfe7e7475f2..070c07d68dfb 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig @@ -23,6 +23,7 @@ config ACPI_APEI_GHES select ACPI_HED select IRQ_WORK select GENERIC_ALLOCATOR + select ARM_SDE_INTERFACE if ARM64 ...
7f1c3de1370bc6a8ad5157336b258067dac0ae9c
Analyze and fix the following issue in the Linux kernel code: riscv: Disallow PR_GET_TAGGED_ADDR_CTRL without Supm
Problem Details: When the prctl() interface for pointer masking was added, it did not check that the pointer masking ISA extension was supported, only the individual submodes. Userspace could still attempt to disable pointer masking and query the pointer masking state. commit 81de1afb2dd1 ("riscv: Fix kernel crash due ...
```diff diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 3db2c0c07acd..15d8f75902f8 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -333,6 +333,9 @@ long get_tagged_addr_ctrl(struct task_struct *task) struct thread_info *ti = task_thread_info(task); long ret...
e9d86b8e17e725ee6088970981ab99f29abd1997
Analyze and fix the following issue in the Linux kernel code: scripts: Do not strip .rela.dyn section
Problem Details: The .rela.dyn section contains runtime relocations and is only emitted for a relocatable kernel. riscv uses this section to relocate the kernel at runtime but that section is stripped from vmlinux. That prevents kexec to successfully load vmlinux since it does not contain the relocations info needed. ...
```diff diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux index b0a6cd5b818c..85d60d986401 100644 --- a/scripts/Makefile.vmlinux +++ b/scripts/Makefile.vmlinux @@ -13,7 +13,7 @@ ifdef CONFIG_ARCH_VMLINUX_NEEDS_RELOCS vmlinux-final := vmlinux.unstripped quiet_cmd_strip_relocs = RSTRIP $@ - cmd_s...
ae08d55807c099357c047dba17624b09414635dd
Analyze and fix the following issue in the Linux kernel code: riscv: Fix kernel crash due to PR_SET_TAGGED_ADDR_CTRL
Problem Details: When userspace does PR_SET_TAGGED_ADDR_CTRL, but Supm extension is not available, the kernel crashes: Oops - illegal instruction [#1] [snip] epc : set_tagged_addr_ctrl+0x112/0x15a ra : set_tagged_addr_ctrl+0x74/0x15a epc : ffffffff80011ace ra : ffffffff80011a30 sp : ffffffc60039be10 [snip] st...
```diff diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 7c244de77180..3db2c0c07acd 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -275,6 +275,9 @@ long set_tagged_addr_ctrl(struct task_struct *task, unsigned long arg) unsigned long pmm; u8 pmlen; + if (!...
453805f0a28fc5091e46145e6560c776f7c7a611
Analyze and fix the following issue in the Linux kernel code: riscv: misaligned: enable IRQs while handling misaligned accesses
Problem Details: We can safely reenable IRQs if coming from userspace. This allows to access user memory that could potentially trigger a page fault. Fixes: b686ecdeacf6 ("riscv: misaligned: Restrict user access to kernel memory") Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Alexandre Ghiti <alexghi...
```diff diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index b1d991c78a23..9c83848797a7 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -220,19 +220,23 @@ static void do_trap_misaligned(struct pt_regs *regs, enum misaligned_access_type { irqentry_state_t state; - if (u...
0f5757667ec0aaf2456c3b76fcf0c6c3ea3591fe
Analyze and fix the following issue in the Linux kernel code: pmdomain: core: Fix error checking in genpd_dev_pm_attach_by_id()
Problem Details: The error checking for of_count_phandle_with_args() does not handle negative error codes correctly. The problem is that "index" is a u32 so in the condition "if (index >= num_domains)" negative error codes stored in "num_domains" are type promoted to very high positive values and "index" is always goi...
```diff diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index 9b2f28b34bb5..d6c1ddb807b2 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -3126,7 +3126,7 @@ struct device *genpd_dev_pm_attach_by_id(struct device *dev, /* Verify that the index is within a valid range. */ num_domai...
b3f737ae959a0d6386fcb54d4bf252fe88ab309c
Analyze and fix the following issue in the Linux kernel code: dma-buf/sw-sync: Remove unused debug code
Problem Details: sync_file_debug_add() and sync_file_debug_remove() have been unused since 2016's commit d4cab38e153d ("staging/android: prepare sync_file for de-staging") Remove them. Since sync_file_debug_add was the only thing to add to sync_file_list_head, the code that dumps it in part of sync_info_debugfs_show ...
```diff diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c index 270daae7d89a..67cd69551e42 100644 --- a/drivers/dma-buf/sync_debug.c +++ b/drivers/dma-buf/sync_debug.c @@ -12,8 +12,6 @@ static struct dentry *dbgfs; static LIST_HEAD(sync_timeline_list_head); static DEFINE_SPINLOCK(sync_timelin...
c855506257063f444044d0a85a2e9ad9ab1c7ecd
Analyze and fix the following issue in the Linux kernel code: genirq/cpuhotplug: Fix up lock guards conversion brainf..t
Problem Details: The lock guard conversion converted raw_spin_lock_irq() to scoped_guard(raw_spinlock), which is obviously bogus and makes lockdep mightily unhappy. Note to self: Copy and pasta without using brain is a patently bad idea. Fixes: 88a4df117ad6 ("genirq/cpuhotplug: Convert to lock guards") Reported-by: B...
```diff diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c index 7bd4c2a5cef4..e77ca6db5e11 100644 --- a/kernel/irq/cpuhotplug.c +++ b/kernel/irq/cpuhotplug.c @@ -243,7 +243,7 @@ int irq_affinity_online_cpu(unsigned int cpu) irq_lock_sparse(); for_each_active_irq(irq) { desc = irq_to_desc(irq); - sc...