id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
4a3754f73ef48518a98c3c3a5e0edb9b605740cf
Analyze and fix the following issue in the Linux kernel code: cpufreq: qcom-nvmem: add support for IPQ8064
Problem Details: IPQ8064 comes in 3 families: * IPQ8062 up to 1.0GHz * IPQ8064/IPQ8066/IPQ8068 up to 1.4GHz * IPQ8065/IPQ8069 up to 1.7Ghz So, in order to be able to support one OPP table, add support for IPQ8064 family based of SMEM SoC ID-s and correctly set the version so opp-supported-hw can be correctly used. Bi...
```diff diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c index ba6720351a4c..15367ac08b2b 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c @@ -30,6 +30,12 @@ #include <dt-bindings/arm/qcom,ids.h> +enum ipq806x_versions { + IPQ8062_...
4e6c38c38723a954b85aa9ee62603bb4a37acbb4
Analyze and fix the following issue in the Linux kernel code: drm/logicvc: Kconfig: select REGMAP and REGMAP_MMIO
Problem Details: drm/logicvc driver is depend on REGMAP and REGMAP_MMIO, should select this two kconfig option, otherwise the driver failed to compile on platform without REGMAP_MMIO selected: ERROR: modpost: "__devm_regmap_init_mmio_clk" [drivers/gpu/drm/logicvc/logicvc-drm.ko] undefined! make[1]: *** [scripts/Makefi...
```diff diff --git a/drivers/gpu/drm/logicvc/Kconfig b/drivers/gpu/drm/logicvc/Kconfig index fa7a88368809..1df22a852a23 100644 --- a/drivers/gpu/drm/logicvc/Kconfig +++ b/drivers/gpu/drm/logicvc/Kconfig @@ -5,5 +5,7 @@ config DRM_LOGICVC select DRM_KMS_HELPER select DRM_KMS_DMA_HELPER select DRM_GEM_DMA_HELPER + ...
6afc57ea315e0f660b1f870a681737bb7b71faef
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix htt mlo-offset event locking
Problem Details: The ath12k active pdevs are protected by RCU but the htt mlo-offset event handling code calling ath12k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Compile tested on...
```diff diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c index 54e0a09bf8dd..f5ee4c11096c 100644 --- a/drivers/net/wireless/ath/ath12k/dp_rx.c +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c @@ -1658,11 +1658,12 @@ static void ath12k_htt_mlo_offset_event_handler(struct ath12k...
69bd216e049349886405b1c87a55dce3d35d1ba7
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix dfs-radar and temperature event locking
Problem Details: The ath12k active pdevs are protected by RCU but the DFS-radar and temperature event handling code calling ath12k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as RCU read-side critical sections to avoid any potential use-after-free issues. Note tha...
```diff diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 0d46e97ffe56..0e5bf5ce8d4c 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -6515,6 +6515,8 @@ ath12k_wmi_pdev_dfs_radar_detected_event(struct ath12k_base *ab, struct...
1dea3c0720a146bd7193969f2847ccfed5be2221
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: fix gtk offload status event locking
Problem Details: The ath11k active pdevs are protected by RCU but the gtk offload status event handling code calling ath11k_mac_get_arvif_by_vdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Compile te...
```diff diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index eac800cebaf4..2845b4313d3a 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -8618,12 +8618,13 @@ static void ath11k_wmi_gtk_offload_status_event(struct ath11k_base *a...
3f77c7d605b29df277d77e9ee75d96e7ad145d2d
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: fix htt pktlog locking
Problem Details: The ath11k active pdevs are protected by RCU but the htt pktlog handling code calling ath11k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Compile tested only. Fixes...
```diff diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 96a60bfd1b16..7eac93ce7a1d 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -1618,14 +1618,20 @@ static void ath11k_htt_pktlog(struct ath11k_base *ab, struct ...
3b6c14833165f689cc5928574ebafe52bbce5f1e
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: fix dfs radar event locking
Problem Details: The ath11k active pdevs are protected by RCU but the DFS radar event handling code calling ath11k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Compile tested only. ...
```diff diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 4b966aea748a..eac800cebaf4 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -8336,6 +8336,8 @@ ath11k_wmi_pdev_dfs_radar_detected_event(struct ath11k_base *ab, struct...
1a5352a81b4720ba43d9c899974e3bddf7ce0ce8
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: fix temperature event locking
Problem Details: The ath11k active pdevs are protected by RCU but the temperature event handling code calling ath11k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section as reported by RCU lockdep: ============================= WARNING: suspicious RCU usage 6.6.0-rc6 #7 Not tainted --------------...
```diff diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 8fd946437858..4b966aea748a 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -8382,15 +8382,19 @@ ath11k_wmi_pdev_temperature_event(struct ath11k_base *ab, ath11k_db...
eba9ac7abab91c8f6d351460239108bef5e7a0b6
Analyze and fix the following issue in the Linux kernel code: platform/x86: wmi: Fix opening of char device
Problem Details: Since commit fa1f68db6ca7 ("drivers: misc: pass miscdevice pointer via file private data"), the miscdevice stores a pointer to itself inside filp->private_data, which means that private_data will not be NULL when wmi_char_open() is called. This might cause memory corruption should wmi_char_open() be un...
```diff diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index ab24ea9ffc9a..6b3b2fe464d2 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -958,21 +958,13 @@ static int wmi_dev_match(struct device *dev, struct device_driver *driver) } static int wmi_char_open(struct inod...
ed85891a276edaf7a867de0e9acd0837bc3008f2
Analyze and fix the following issue in the Linux kernel code: platform/x86: wmi: Fix probe failure when failing to register WMI devices
Problem Details: When a WMI device besides the first one somehow fails to register, retval is returned while still containing a negative error code. This causes the ACPI device fail to probe, leaving behind zombie WMI devices leading to various errors later. Handle the single error path separately and return 0 uncondi...
```diff diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index e3984801883a..ab24ea9ffc9a 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -1338,8 +1338,8 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev) struct wmi_block *wblock; union ...
7444f8347487df8d898fbc022249942806c80fc9
Analyze and fix the following issue in the Linux kernel code: platform/x86: wmi: Fix refcounting of WMI devices in legacy functions
Problem Details: Until now, legacy GUID-based functions where using find_guid() when searching for WMI devices, which did no refcounting on the returned WMI device. This meant that the WMI device could disappear at any moment, potentially leading to various errors. Fix this by using bus_find_device() which returns an a...
```diff diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 1dbef16acdeb..e3984801883a 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -109,33 +109,13 @@ static const char * const allow_duplicates[] = { NULL }; +#define dev_to_wblock(__dev) container_of_const(__de...
1711435e3e67e079d6a2bce54d96d1af21c7ef2c
Analyze and fix the following issue in the Linux kernel code: net: ipv6: fix typo in comments
Problem Details: The word "advertize" should be replaced by "advertise". Signed-off-by: Deming Wang <wangdeming@inspur.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index e023d29e919c..2cc1a45742d8 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -833,7 +833,7 @@ int esp6_input_done2(struct sk_buff *skb, int err) /* * 1) if the NAT-T peer's IP or port changed then - * advertize the change to the keying daemo...
197f9fba9663e765f8f3ae3b2375c6cc32b2e2b3
Analyze and fix the following issue in the Linux kernel code: net: ipv4: fix typo in comments
Problem Details: The word "advertize" should be replaced by "advertise". Signed-off-by: Deming Wang <wangdeming@inspur.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index d18f0f092fe7..4ccfc104f13a 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -786,7 +786,7 @@ int esp_input_done2(struct sk_buff *skb, int err) /* * 1) if the NAT-T peer's IP or port changed then - * advertize the change to the keying daemon...
a63b6622120cd03a304796dbccb80655b3a21798
Analyze and fix the following issue in the Linux kernel code: net/sched: act_ct: additional checks for outdated flows
Problem Details: Current nf_flow_is_outdated() implementation considers any flow table flow which state diverged from its underlying CT connection status for teardown which can be problematic in the following cases: - Flow has never been offloaded to hardware in the first place either because flow table has hardware o...
```diff diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 0d44da4e8c8e..fb52d6f9aff9 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -281,6 +281,8 @@ err_nat: static bool tcf_ct_flow_is_outdated(const struct flow_offload *flow) { return test_bit(IPS_SEEN_REPLY_BIT, &flow->ct->status) && + ...
735795f68b37e9bb49f642407a0d49b1631ea1c7
Analyze and fix the following issue in the Linux kernel code: netfilter: flowtable: GC pushes back packets to classic path
Problem Details: Since 41f2c7c342d3 ("net/sched: act_ct: Fix promotion of offloaded unreplied tuple"), flowtable GC pushes back flows with IPS_SEEN_REPLY back to classic path in every run, ie. every second. This is because of a new check for NF_FLOW_HW_ESTABLISHED which is specific of sched/act_ct. In Netfilter's flow...
```diff diff --git a/include/net/netfilter/nf_flow_table.h b/include/net/netfilter/nf_flow_table.h index d466e1a3b0b1..fe1507c1db82 100644 --- a/include/net/netfilter/nf_flow_table.h +++ b/include/net/netfilter/nf_flow_table.h @@ -53,6 +53,7 @@ struct nf_flowtable_type { struct list_head list; int family; int...
d0110443cf4a15267322f84210007943f5b01ae0
Analyze and fix the following issue in the Linux kernel code: amd/pds_core: core: No need for Null pointer check before kfree
Problem Details: kfree()/vfree() internally perform NULL check on the pointer handed to it and take no action if it indeed is NULL. Hence there is no need for a pre-check of the memory pointer before handing it to kfree()/vfree(). Issue reported by ifnullfree.cocci Coccinelle semantic patch script. Signed-off-by: Bra...
```diff diff --git a/drivers/net/ethernet/amd/pds_core/core.c b/drivers/net/ethernet/amd/pds_core/core.c index 2a8643e167e1..0d2091e9eb28 100644 --- a/drivers/net/ethernet/amd/pds_core/core.c +++ b/drivers/net/ethernet/amd/pds_core/core.c @@ -152,11 +152,8 @@ void pdsc_qcq_free(struct pdsc *pdsc, struct pdsc_qcq *qcq) ...
02a258ac3ebf8a530d340ec24a694c13ac9d25c0
Analyze and fix the following issue in the Linux kernel code: platform/x86/amd/hsmp: Fix iomem handling
Problem Details: Since the metrics table is marked as io memory, use memcpy_fromio() when copying its contents. Compile-tested only. Fixes: 5150542b8ec5 ("platform/x86/amd/hsmp: add support for metrics tbl") Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20231019135122.21774-1-W_Armin@gmx....
```diff diff --git a/drivers/platform/x86/amd/hsmp.c b/drivers/platform/x86/amd/hsmp.c index b056a5c8654a..b55d80e29139 100644 --- a/drivers/platform/x86/amd/hsmp.c +++ b/drivers/platform/x86/amd/hsmp.c @@ -362,7 +362,7 @@ static ssize_t hsmp_metric_tbl_read(struct file *filp, struct kobject *kobj, ret = hsmp_send_me...
605a5f5d406df0c01d92e36a7b5419ffaf62a4ce
Analyze and fix the following issue in the Linux kernel code: ARM64: dts: marvell: Fix some common switch mistakes
Problem Details: Fix some errors in the Marvell MV88E6xxx switch descriptions: - The top node had no address size or cells. - switch0@0 is not OK, should be ethernet-switch@0. - ports should be ethernet-ports - port@0 should be ethernet-port@0 - PHYs should be named ethernet-phy@ Reviewed-by: Andrew Lunn <andrew@lunn....
```diff diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts index f9abef8dcc94..870bb380a40a 100644 --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.d...
bfedd8423643825f37c06bd3cb87973d5206cc45
Analyze and fix the following issue in the Linux kernel code: ARM: dts: nxp: Fix some common switch mistakes
Problem Details: Fix some errors in the Marvell MV88E6xxx switch descriptions: - switch0@0 is not OK, should be ethernet-switch@0 - ports should be ethernet-ports - port should be ethernet-port - phy should be ethernet-phy Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Linus Walleij <linus.walleij@linaro.org...
```diff diff --git a/arch/arm/boot/dts/nxp/vf/vf610-zii-cfu1.dts b/arch/arm/boot/dts/nxp/vf/vf610-zii-cfu1.dts index 1a19aec8957b..7e72f860c3c5 100644 --- a/arch/arm/boot/dts/nxp/vf/vf610-zii-cfu1.dts +++ b/arch/arm/boot/dts/nxp/vf/vf610-zii-cfu1.dts @@ -162,7 +162,7 @@ suppress-preamble; status = "okay"; - sw...
2b83557a588f739fd0a63efe1c3bc851cdf3d5f6
Analyze and fix the following issue in the Linux kernel code: ARM: dts: marvell: Fix some common switch mistakes
Problem Details: Fix some errors in the Marvell MV88E6xxx switch descriptions: - The top node had no address size or cells. - switch0@0 is not OK, should be ethernet-switch@0. - The ports node should be named ethernet-ports - The ethernet-ports node should have port@0 etc children, no plural "ports" in the children. ...
```diff diff --git a/arch/arm/boot/dts/marvell/armada-370-rd.dts b/arch/arm/boot/dts/marvell/armada-370-rd.dts index b459a670f615..1b241da11e94 100644 --- a/arch/arm/boot/dts/marvell/armada-370-rd.dts +++ b/arch/arm/boot/dts/marvell/armada-370-rd.dts @@ -149,39 +149,37 @@ }; }; - switch: switch@10 { + switch: et...
ddae07ce9bb35a939318dfb22fa799f7cd6893ae
Analyze and fix the following issue in the Linux kernel code: dt-bindings: net: mvusb: Fix up DSA example
Problem Details: When adding a proper schema for the Marvell mx88e6xxx switch, the scripts start complaining about this embedded example: dtschema/dtc warnings/errors: net/marvell,mvusb.example.dtb: switch@0: ports: '#address-cells' is a required property from schema $id: http://devicetree.org/schemas/net/dsa/...
```diff diff --git a/Documentation/devicetree/bindings/net/marvell,mvusb.yaml b/Documentation/devicetree/bindings/net/marvell,mvusb.yaml index 3a3325168048..ab838c1ffeed 100644 --- a/Documentation/devicetree/bindings/net/marvell,mvusb.yaml +++ b/Documentation/devicetree/bindings/net/marvell,mvusb.yaml @@ -50,11 +50,14 ...
d4b2d165714c0ce8777d5131f6e0aad617b7adc4
Analyze and fix the following issue in the Linux kernel code: RDMA/hfi1: Workaround truncation compilation error
Problem Details: Increase name array to be large enough to overcome the following compilation error. drivers/infiniband/hw/hfi1/efivar.c: In function ‘read_hfi1_efi_var’: drivers/infiniband/hw/hfi1/efivar.c:124:44: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] ...
```diff diff --git a/drivers/infiniband/hw/hfi1/efivar.c b/drivers/infiniband/hw/hfi1/efivar.c index fb06e86da608..9ed05e10020e 100644 --- a/drivers/infiniband/hw/hfi1/efivar.c +++ b/drivers/infiniband/hw/hfi1/efivar.c @@ -112,7 +112,7 @@ int read_hfi1_efi_var(struct hfi1_devdata *dd, const char *kind, unsigne...
2f19c4b8395ccb6eb25ccafee883c8cfbe3fc193
Analyze and fix the following issue in the Linux kernel code: IB/hfi1: Fix potential deadlock on &irq_src_lock and &dd->uctxt_lock
Problem Details: handle_receive_interrupt_napi_sp() running inside interrupt handler could introduce inverse lock ordering between &dd->irq_src_lock and &dd->uctxt_lock, if read_mod_write() is preempted by the isr. [CPU0] | [CPU1] hfi1_ipoib_dev_open() ...
```diff diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c index b3bbe4278786..78f27f7b4203 100644 --- a/drivers/infiniband/hw/hfi1/chip.c +++ b/drivers/infiniband/hw/hfi1/chip.c @@ -13185,15 +13185,16 @@ static void read_mod_write(struct hfi1_devdata *dd, u16 src, u64 bits, { u64 reg...
99248c8902f505ec064cf2b0f74629016f2f4c82
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: add quirk flag to enable native DSD for McIntosh devices
Problem Details: McIntosh devices supporting native DSD require the feature to be explicitly exposed. Add a flag that fixes an issue where DSD audio was defaulting to DSD over PCM instead of delivering raw DSD data. Signed-off-by: Max McCarthy <mmccarthy@mcintoshlabs.com> Cc: <stable@vger.kernel.org> Link: https://lor...
```diff diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 4e64842245e1..ab2b938502eb 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -2220,6 +2220,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { QUIRK_FLAG_DSD_RAW), VENDOR_FLG(0x2ab6, /* T+A devices */ QUI...
264aeb994ea8db4a39a393d91b1f551b42309759
Analyze and fix the following issue in the Linux kernel code: ASoC: SOF: Make return of remove_late void, too
Problem Details: Like the change we've done for remove callback, the newly introduced remove_late callback should be changed to void return, too. Fixes: 17baaa1f950b ("ASoC: SOF: core: Add probe_early and remove_late callbacks") Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20231023153605.8...
```diff diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 8342fcf52f52..744c0dd5766d 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1382,13 +1382,11 @@ skip_disable_dsp: iounmap(sdev->bar[HDA_DSP_BAR]); } -int hda_dsp_remove_late(struct snd_sof_dev *sdev) +void h...
47b8def9358c5eb888e78b24b7e5b7f2e2e97b8e
Analyze and fix the following issue in the Linux kernel code: powerpc/mm: Avoid calling arch_enter/leave_lazy_mmu() in set_ptes
Problem Details: With commit 9fee28baa601 ("powerpc: implement the new page table range API") we added set_ptes to powerpc architecture. The implementation included calling arch_enter/leave_lazy_mmu() calls. The patch removes the usage of arch_enter/leave_lazy_mmu() because set_pte is not supposed to be used when upda...
```diff diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c index 3f86fd217690..c3e9fefbf4dd 100644 --- a/arch/powerpc/mm/pgtable.c +++ b/arch/powerpc/mm/pgtable.c @@ -104,6 +104,8 @@ static pte_t set_pte_filter_hash(pte_t pte) { return pte; } /* Embedded type MMU with HW exec support. This is a bit mor...
36e826b568e412f61d68fedc02a67b4d8b7583cc
Analyze and fix the following issue in the Linux kernel code: powerpc/vmcore: Add MMU information to vmcoreinfo
Problem Details: Since below commit, address mapping for vmemmap has changed for Radix MMU, where address mapping is stored in kernel page table itself, instead of earlier used 'vmemmap_list'. commit 368a0590d954 ("powerpc/book3s64/vmemmap: switch radix to use a different vmemmap handling function") Hence wit...
```diff diff --git a/arch/powerpc/kexec/core.c b/arch/powerpc/kexec/core.c index de64c7962991..005269ac3244 100644 --- a/arch/powerpc/kexec/core.c +++ b/arch/powerpc/kexec/core.c @@ -74,6 +74,9 @@ void arch_crash_save_vmcoreinfo(void) VMCOREINFO_STRUCT_SIZE(mmu_psize_def); VMCOREINFO_OFFSET(mmu_psize_def, shift); ...
a75a16c62a2540f11eeae4f2b50e95deefb652ea
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Leave space for '\0' in utf8 desc string
Problem Details: utf16s_to_utf8s does not NULL terminate the output string. For us to be able to add a NULL character when utf16s_to_utf8s returns, we need to make sure that there is space for such NULL character at the end of the output buffer. We can achieve this by passing an output buffer size to utf16s_to_utf8s th...
```diff diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 5c1be0a2638b..68d7da02944f 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -3728,7 +3728,7 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index, */ ret = utf16s_to_utf8s(uc_str->uc, ...
a5181c8955145431e809158ad370258f77c3b77f
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Fix race between force complete and ISR
Problem Details: While error handler force complete command (Thread A) and completion IRQ raising (Thread B) of the same command, it may cause race condition. Below is racing step (from 1 to 6): ufshcd_mcq_compl_pending_transfer (Thread A) 1 if (cmd && !test_bit(SCMD_STATE_COMPLETE, &cmd->state)) { 5 spin_lock_irqsa...
```diff diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 5c4f2643dde6..24aa7a2de9da 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -5615,13 +5615,13 @@ static void ufshcd_mcq_compl_pending_transfer(struct ufs_hba *hba, * For those cmds of which the cqes are not pr...
f2d79aa16aee19e8f4aea3c3a6f6724124060e65
Analyze and fix the following issue in the Linux kernel code: scsi: megaraid: Fix up debug message in megaraid_abort_and_reset()
Problem Details: Found by Smatch. Fixes: 5bcd3bfbda02 ("scsi: megaraid: Pass in NULL scb for host reset") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20231023073021.21954-1-hare@suse.de Signed-off-by: Martin K. Petersen <martin.pet...
```diff diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 329c3da88416..66a30a3e6cd5 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -1925,10 +1925,13 @@ megaraid_abort_and_reset(adapter_t *adapter, struct scsi_cmnd *cmd, int aor) struct list_head *pos, *next; scb_t *scb; ...
c7f4c5dec651090f99b0d2b946e028e1ea90d22a
Analyze and fix the following issue in the Linux kernel code: scsi: aic79xx: Fix up NULL command in ahd_done()
Problem Details: Found by smatch. Fixes: c67e63800446 ("scsi: aic79xx: Do not reference SCSI command when resetting device") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20231023073014.21438-1-hare@suse.de Signed-off-by: Martin K. P...
```diff diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index b3075a022d99..4202059815a0 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c @@ -1834,7 +1834,8 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) } else { ahd_set_transactio...
4b1c07913239b7a02592084d449c3938ce22b106
Analyze and fix the following issue in the Linux kernel code: scsi: message: fusion: Initialize return value in mptfc_bus_reset()
Problem Details: Detected by smatch. Fixes: 17865dc2eccc ("scsi: message: fusion: Open-code mptfc_block_error_handler() for bus reset") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20231023073005.20766-1-hare@suse.de Reviewed-by: Ch...
```diff diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index aa6bb764df3e..0581f855c72e 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -265,7 +265,7 @@ mptfc_bus_reset(struct scsi_cmnd *SCpnt) MPT_SCSI_HOST __maybe_unused *hd = shost_priv(shost); in...
3c978492c333f0c08248a8d51cecbe5eb5f617c9
Analyze and fix the following issue in the Linux kernel code: scsi: mpt3sas: Fix loop logic
Problem Details: The retry loop continues to iterate until the count reaches 30, even after receiving the correct value. Exit loop when a non-zero value is read. Fixes: 4ca10f3e3174 ("scsi: mpt3sas: Perform additional retries if doorbell read returns 0") Cc: stable@vger.kernel.org Signed-off-by: Ranjan Kumar <ranjan.k...
```diff diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 61a32bf00747..a75f670bf551 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -223,8 +223,8 @@ _base_readl_ext_retry(const void __iomem *addr) for (i = 0 ; i < 30 ; i++) { ...
0b1b4b04444fc3e8f2489cde43513dcddb9f3f60
Analyze and fix the following issue in the Linux kernel code: scsi: pmcraid: Add missing scsi_device_put() in pmcraid_eh_target_reset_handler()
Problem Details: When breaking out of an shost_for_each_device() loop one needs to do an explicit scsi_device_put(). Fixes: c2a14ab3b9b3 ("scsi: pmcraid: Select device in pmcraid_eh_target_reset_handler()") Signed-off-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20231023072957.20191-1-hare@suse.d...
```diff diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index af970cee53c9..e8bcc3a88732 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -3066,6 +3066,7 @@ static int pmcraid_eh_target_reset_handler(struct scsi_cmnd *scmd) { struct Scsi_Host *shost = scmd->device->host; struct scsi...
96f41cddbc7baf1a96a388693dcfac0051db070d
Analyze and fix the following issue in the Linux kernel code: scsi: target: core: Fix kernel-doc comment
Problem Details: Fix kernel-doc comment to silence the warnings: drivers/target/target_core_transport.c:1930: warning: Excess function parameter 'cmd' description in 'target_submit' drivers/target/target_core_transport.c:1930: warning: Function parameter or member 'se_cmd' not described in 'target_submit' Reported-by...
```diff diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index c81def3c96df..670cfb7bd426 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1921,7 +1921,7 @@ static void target_queue_submission(struct se_cmd *se_cmd) /** ...
9e1c911ecbbc92ebdae4aa69cf7691cf792ba32d
Analyze and fix the following issue in the Linux kernel code: scsi: pmcraid: Fix kernel-doc comment
Problem Details: Fix kernel-doc comment to silence the warnings: drivers/scsi/pmcraid.c:2697: warning: Excess function parameter 'scsi_cmd' description in 'pmcraid_reset_device' drivers/scsi/pmcraid.c:2697: warning: Function parameter or member 'scsi_dev' not described in 'pmcraid_reset_device' Reported-by: Abaci Rob...
```diff diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index a831b34c08a4..af970cee53c9 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -2679,7 +2679,7 @@ static int pmcraid_error_handler(struct pmcraid_cmd *cmd) /** * pmcraid_reset_device - device reset handler functions * - * @s...
04cf5465055442c15c37bbedb1febe2d8f3a47be
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Refine _EL2 system register list that require trap reinjection
Problem Details: Implement a fine grained approach in the _EL2 sysreg range instead of the current wide cast trap. This ensures that we don't mistakenly inject the wrong exception into the guest. [maz: commit message massaging, dropped secure and AArch32 registers from the list] Fixes: d0fc0a2519a6 ("KVM: arm64...
```diff diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c index 9ced1bf0c2b7..91cc851a6c75 100644 --- a/arch/arm64/kvm/emulate-nested.c +++ b/arch/arm64/kvm/emulate-nested.c @@ -648,15 +648,80 @@ static const struct encoding_to_trap_config encoding_to_cgt[] __initconst = { SR_TRAP(SYS_APG...
c35d7636991fe09175fb33287cbb4e02e25d2c53
Analyze and fix the following issue in the Linux kernel code: net: ethernet: mtk_wed: fix firmware loading for MT7986 SoC
Problem Details: The WED mcu firmware does not contain all the memory regions defined in the dts reserved_memory node (e.g. MT7986 WED firmware does not contain cpu-boot region). Reverse the mtk_wed_mcu_run_firmware() logic to check all the fw sections are defined in the dts reserved_memory node. Fixes: c6d961aeaa77 (...
```diff diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c index 65a78e274009..fee9c9d3a92f 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c +++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c @@ -258,16 +258,12 @@ mtk_wed_get_memory_region(struct mtk_wed_hw *hw...
77a8c982ff0d4c3a14022c6fe9e3dbfb327552ec
Analyze and fix the following issue in the Linux kernel code: i40e: Fix wrong check for I40E_TXR_FLAGS_WB_ON_ITR
Problem Details: The I40E_TXR_FLAGS_WB_ON_ITR is i40e_ring flag and not i40e_pf one. Fixes: 8e0764b4d6be42 ("i40e/i40evf: Add support for writeback on ITR feature for X722") Signed-off-by: Ivan Vecera <ivecera@redhat.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Int...
```diff diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 50c70a8e470a..b047c587629b 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -2854,7 +2854,7 @@ tx_only: return budget; } - if (vsi->bac...
9214c9d56c470b183f3d374c7aed7c8756f80fd9
Analyze and fix the following issue in the Linux kernel code: cxl/mbox: Remove useless cast in cxl_mem_create_range_info()
Problem Details: DEFINE_RES_MEM() is a wrapper around the DEFINE_RES_NAMED() macro which already has the (struct resource) for the compound literal. The user of the macro should not repeat the cast. Cleans up these sparse warnings: drivers/cxl/core/mbox.c:1184:18: warning: cast to non-scalar drivers/cxl/core/mbox.c:11...
```diff diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c index 4df4f614f490..f1fe689fc53f 100644 --- a/drivers/cxl/core/mbox.c +++ b/drivers/cxl/core/mbox.c @@ -1224,8 +1224,7 @@ int cxl_mem_create_range_info(struct cxl_memdev_state *mds) return 0; } - cxlds->dpa_res = - (struct resource)DEFINE_RE...
e1cc87206348f36fb78e417b5813f78f672a4aef
Analyze and fix the following issue in the Linux kernel code: KVM: selftests: aarch64: vPMU register test for unimplemented counters
Problem Details: Add a new test case to the vpmu_counter_access test to check if PMU registers or their bits for unimplemented counters are not accessible or are RAZ, as expected. Signed-off-by: Reiji Watanabe <reijiw@google.com> Signed-off-by: Raghavendra Rao Ananta <rananta@google.com> Signed-off-by: Marc Zyngier <m...
```diff diff --git a/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c b/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c index a579286b6f11..8694e89684bf 100644 --- a/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c +++ b/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c @@ -5,8 +5,9 ...
4d20debf9ca160720a0b01ba4f2dc3d62296c4d1
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: PMU: Set PMCR_EL0.N for vCPU based on the associated PMU
Problem Details: The number of PMU event counters is indicated in PMCR_EL0.N. For a vCPU with PMUv3 configured, the value is set to the same value as the current PE on every vCPU reset. Unless the vCPU is pinned to PEs that has the PMU associated to the guest from the initial vCPU reset, the value might be different f...
```diff diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index af06ccb7ee34..0fe9cc9dc836 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -257,6 +257,9 @@ struct kvm_arch { cpumask_var_t supported_cpus; + /* PMCR_EL0.N value for the guest...
8e37372ad0bea4c9b4712d9943f6ae96cff9491f
Analyze and fix the following issue in the Linux kernel code: PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common()
Problem Details: aspm_attr_store_common(), which handles sysfs control of ASPM, has the same problem as fb097dcd5a28 ("PCI/ASPM: Disable only ASPM_STATE_L1 when driver disables L1"): disabling L1 adds only ASPM_L1 (but not any of the L1.x substates) to the "aspm_disable" mask. Enabling one substate, e.g., L1.1, via sy...
```diff diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index dc203b8e5a63..99656d669f00 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -1255,6 +1255,8 @@ static ssize_t aspm_attr_store_common(struct device *dev, link->aspm_disable &= ~ASPM_STATE_L1; } else { link->aspm_di...
0718588c7aaa7a1510b4de972370535b61dddd0d
Analyze and fix the following issue in the Linux kernel code: cxl/region: Do not try to cleanup after cxl_region_setup_targets() fails
Problem Details: Commit 5e42bcbc3fef ("cxl/region: decrement ->nr_targets on error in cxl_region_attach()") tried to avoid 'eiw' initialization errors when ->nr_targets exceeded 16, by just decrementing ->nr_targets when cxl_region_setup_targets() failed. Commit 86987c766276 ("cxl/region: Cleanup target list on attach...
```diff diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index d74bf1b664b6..a3bc6424f175 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -1652,6 +1652,12 @@ static int cxl_region_attach(struct cxl_region *cxlr, return -ENXIO; } + if (p->nr_targets >= p->interleave_way...
293fbc28818135743f54d46c418ede3e4a20a742
Analyze and fix the following issue in the Linux kernel code: vfio/mtty: Overhaul mtty interrupt handling
Problem Details: The mtty driver does not currently conform to the vfio SET_IRQS uAPI. For example, it claims to support mask and unmask of INTx, but actually does nothing. It claims to support AUTOMASK for INTx, but doesn't. It fails to teardown eventfds under the full semantics specified by the SET_IRQS ioctl. It ...
```diff diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c index 5af00387c519..245db52bedf2 100644 --- a/samples/vfio-mdev/mtty.c +++ b/samples/vfio-mdev/mtty.c @@ -127,7 +127,6 @@ struct serial_port { /* State of each mdev device */ struct mdev_state { struct vfio_device vdev; - int irq_fd; struct ...
a60ec4485f1c72dfece365cf95e6de82bdd74300
Analyze and fix the following issue in the Linux kernel code: powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug()
Problem Details: Before the refactoring the pr_warn() only triggered when someone explicitly tried to write to a BIOS locked limit. After the refactoring the warning is also triggering during system resume. The user can't do anything about this so printing scary warnings doesn't make sense Keep the printk but make it ...
```diff diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index 40a2cc649c79..2feed036c1cd 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -892,7 +892,7 @@ static int rapl_write_pl_data(struct rapl_domain *rd, int pl, return -EINV...
00e984cb986b31e9313745e51daceaa1e1eb7351
Analyze and fix the following issue in the Linux kernel code: tsnep: Fix tsnep_request_irq() format-overflow warning
Problem Details: Compiler warns about a possible format-overflow in tsnep_request_irq(): drivers/net/ethernet/engleder/tsnep_main.c:884:55: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] sprintf(queue->name, "%s-rx-%d", name, ...
```diff diff --git a/drivers/net/ethernet/engleder/tsnep.h b/drivers/net/ethernet/engleder/tsnep.h index 6e14c918e3fb..f188fba021a6 100644 --- a/drivers/net/ethernet/engleder/tsnep.h +++ b/drivers/net/ethernet/engleder/tsnep.h @@ -143,7 +143,7 @@ struct tsnep_rx { struct tsnep_queue { struct tsnep_adapter *adapter...
ea167a7fc2426f7685c3735e104921c1a20a6d3f
Analyze and fix the following issue in the Linux kernel code: cpufreq: stats: Fix buffer overflow detection in trans_stats()
Problem Details: Commit 3c0897c180c6 ("cpufreq: Use scnprintf() for avoiding potential buffer overflow") switched from snprintf to the more secure scnprintf but never updated the exit condition for PAGE_SIZE. As the commit say and as scnprintf document, what scnprintf returns what is actually written not counting the ...
```diff diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index a33df3c66c88..40a9ff18da06 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -131,23 +131,23 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf) len += sysfs_emit_a...
728c15b4b5f3369cbde73d5e0f14701ab370f985
Analyze and fix the following issue in the Linux kernel code: drm/fourcc: Add NV20 and NV30 YUV formats
Problem Details: DRM_FORMAT_NV20 and DRM_FORMAT_NV30 formats is the 2x1 and non-subsampled variant of NV15, a 10-bit 2-plane YUV format that has no padding between components. Instead, luminance and chrominance samples are grouped into 4s so that each group is packed into an integer number of bytes: YYYY = UVUV = 4 * ...
```diff diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 0f17dfa8702b..193cf8ed7912 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -299,6 +299,14 @@ const struct drm_format_info *__drm_format_info(u32 format) .num_planes = 2, .char_per_block = { 5, 5, ...
48cf49d31994ff97b33c4044e618560ec84d35fb
Analyze and fix the following issue in the Linux kernel code: ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias()
Problem Details: snprintf() does not return negative values on error. To know if the buffer was too small, the returned value needs to be compared with the length of the passed buffer. If it is greater or equal, the output has been truncated, so add checks for the truncation to create_pnp_modalias() and create_of_moda...
```diff diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index b9bbf0746199..a34d8578b3da 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -158,8 +158,8 @@ static int create_pnp_modalias(const struct acpi_device *acpi_dev, char *modalia return 0; len = snprintf(...
01d5a75370a60c3a8d691347ae6ebb2a9f8dc44a
Analyze and fix the following issue in the Linux kernel code: drm/rockchip: vop2: remove the unsupported format of cluster window
Problem Details: The cluster window on vop2 doesn't support linear yuv format(NV12/16/24), it only support afbc based yuv format(DRM_FORMAT_YUV420_8BIT/10BIT), which will be added in next patch. Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Acked-by: Sascha Hau...
```diff diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 20cf224bd30f..96f2312ff2e3 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -342,10 +342,6 @@ static enum vop2_afbc_format vop2_convert_af...
45ad07c7053df0b67e13d8deb574920d11651fb2
Analyze and fix the following issue in the Linux kernel code: drm/rockchip: vop: fix format bpp calculation
Problem Details: We can't rely on cpp for bpp calculation as the cpp of some formats(DRM_FORMAT_YUV420_8BIT/10BIT, etc) is zero. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patc...
```diff diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index cce9183d750d..20cf224bd30f 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -282,6 +282,20 @@ static void vop2_win_disable(struct vop2_win...
8fa1c7cd1fe9cdfc426a603e1f1eecd3f463c487
Analyze and fix the following issue in the Linux kernel code: drm/i915/mcr: Hold GT forcewake during steering operations
Problem Details: The steering control and semaphore registers are inside an "always on" power domain with respect to RC6. However there are some issues if higher-level platform sleep states are entering/exiting at the same time these registers are accessed. Grabbing GT forcewake and holding it over the entire lock/st...
```diff diff --git a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c index 326c2ed1d99b..34913912d8ae 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_mcr.c +++ b/drivers/gpu/drm/i915/gt/intel_gt_mcr.c @@ -376,9 +376,26 @@ void intel_gt_mcr_lock(struct intel_gt *gt, unsigned long *flags) ...
93e82bb4de0196c4caeca1d8a6eef67863981d8f
Analyze and fix the following issue in the Linux kernel code: drm/bridge: synopsys: dw-mipi-dsi: Fix hcomponent lbcc for burst mode
Problem Details: In order to support burst mode, vendor drivers set lane_mbps higher than bandwidth through DPI interface. So, calculate horizontal component lane byte clock cycle(lbcc) based on lane_mbps instead of pixel clock rate for burst mode. Fixes: ac87d23694f4 ("drm/bridge: synopsys: dw-mipi-dsi: Use pixel cl...
```diff diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 8789eca26188..824fb3c65742 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -774,13 +774,19 @@ static u32 dw_mipi_dsi_get_hcomponent_l...
bd54ccc0f147019dac38e7841876a7415459b875
Analyze and fix the following issue in the Linux kernel code: clk: mediatek: fix double free in mtk_clk_register_pllfh()
Problem Details: The mtk_clk_register_pll_ops() currently frees the "pll" parameter. The function has two callers, mtk_clk_register_pll() and mtk_clk_register_pllfh(). The first one, the _pll() function relies on the free, but for the second _pllfh() function it causes a double free bug. Really the frees should be do...
```diff diff --git a/drivers/clk/mediatek/clk-pll.c b/drivers/clk/mediatek/clk-pll.c index a4eca5fd539c..513ab6b1b322 100644 --- a/drivers/clk/mediatek/clk-pll.c +++ b/drivers/clk/mediatek/clk-pll.c @@ -321,10 +321,8 @@ struct clk_hw *mtk_clk_register_pll_ops(struct mtk_clk_pll *pll, ret = clk_hw_register(NULL, &pl...
28926daf731f72d0537767fdbab2a3e06e31190a
Analyze and fix the following issue in the Linux kernel code: fpga: Fix memory leak for fpga_region_test_class_find()
Problem Details: fpga_region_class_find() in fpga_region_test_class_find() will call get_device() if the data is matched, which will increment refcount for dev->kobj, so it should call put_device() to decrement refcount for dev->kobj to free the region, because fpga_region_unregister() will call fpga_region_dev_release...
```diff diff --git a/drivers/fpga/tests/fpga-region-test.c b/drivers/fpga/tests/fpga-region-test.c index 9f9d50ee7871..baab07e3fc59 100644 --- a/drivers/fpga/tests/fpga-region-test.c +++ b/drivers/fpga/tests/fpga-region-test.c @@ -93,6 +93,8 @@ static void fpga_region_test_class_find(struct kunit *test) region = fp...
70c8dc9104275037a39ab0b2a4ed6eaacac39e32
Analyze and fix the following issue in the Linux kernel code: x86/defconfig: Enable CONFIG_DEBUG_ENTRY=y
Problem Details: A bug was recently found via CONFIG_DEBUG_ENTRY=y, and the x86 tree kinda is the main source of changes to the x86 entry code, so enable this debug option by default in our defconfigs. Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: linux-kernel@vger.kernel.org
```diff diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig index 1b411bbf3cb0..73abbbdd26f8 100644 --- a/arch/x86/configs/i386_defconfig +++ b/arch/x86/configs/i386_defconfig @@ -281,4 +281,5 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y CONFIG_EARLY_PRINTK_DBGP=y CONFIG_DEBUG_BOOT_PARAMS=y CONFI...
0548eb067ed664b93043e033295ca71e3e706245
Analyze and fix the following issue in the Linux kernel code: x86/percpu: Return correct variable from current_top_of_stack()
Problem Details: current_top_of_stack() should return variable from _seg_gs qualified named address space when CONFIG_USE_X86_SEG_SUPPORT=y is enbled. Fixes: ed2f752e0e0a ("x86/percpu: Introduce const-qualified const_pcpu_hot to micro-optimize code generation") Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off...
```diff diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index b47a9975233f..f20e87632669 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -519,7 +519,7 @@ static __always_inline unsigned long current_top_of_stack(void) * entry trampoline. */...
7a1c2abf9a2be7d969b25e8d65567933335ca88e
Analyze and fix the following issue in the Linux kernel code: RDMA/core: Remove NULL check before dev_{put, hold}
Problem Details: The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}, remove it to silence the warning: ./drivers/infiniband/core/nldev.c:375:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed. Reported-by: Abaci Robot <abaci@l...
```diff diff --git a/drivers/infiniband/core/lag.c b/drivers/infiniband/core/lag.c index c77d7d2559a1..eca6e37c72ba 100644 --- a/drivers/infiniband/core/lag.c +++ b/drivers/infiniband/core/lag.c @@ -102,8 +102,7 @@ static struct net_device *rdma_get_xmit_slave_udp(struct ib_device *device, void rdma_lag_put_ah_roce_...
d35686444fc80950c731e33a2f6ad4a55822be9b
Analyze and fix the following issue in the Linux kernel code: arm64: module: Fix PLT counting when CONFIG_RANDOMIZE_BASE=n
Problem Details: The counting of module PLTs has been broken when CONFIG_RANDOMIZE_BASE=n since commit: 3e35d303ab7d22c4 ("arm64: module: rework module VA range selection") Prior to that commit, when CONFIG_RANDOMIZE_BASE=n, the kernel image and all modules were placed within a 128M region, and no PLTs were necessa...
```diff diff --git a/arch/arm64/kernel/module-plts.c b/arch/arm64/kernel/module-plts.c index bd69a4e7cd60..79200f21e123 100644 --- a/arch/arm64/kernel/module-plts.c +++ b/arch/arm64/kernel/module-plts.c @@ -167,9 +167,6 @@ static unsigned int count_plts(Elf64_Sym *syms, Elf64_Rela *rela, int num, switch (ELF64_R_TYP...
02e7d139e5e24abb5fde91934fc9dc0344ac1926
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Change the key being sent for MPV device affiliation
Problem Details: Change the key that we send from IB driver to EN driver regarding the MPV device affiliation, since at that stage the IB device is not yet initialized, so its index would be zero for different IB devices and cause wrong associations between unrelated master and slave devices. Instead use a unique valu...
```diff diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 71597aa6c52a..ec7c45272764 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -3267,7 +3267,7 @@ static bool mlx5_ib_bind_slave_port(struct mlx5_ib_dev *ibdev, mlx5_ib_init_cong_de...
cba94bbcff08d209710dd7bdc139caad675a6f8d
Analyze and fix the following issue in the Linux kernel code: drm/i915/perf: Determine context valid in OA reports
Problem Details: When supporting OA for TGL, it was seen that the context valid bit in the report ID was not defined, however revisiting the spec seems to have this bit defined. The bit is used to determine if a context is valid on a context switch and is essential to determine active and idle periods for a context. Re...
```diff diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 04bc1f4a1115..59e1e21df271 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -482,8 +482,7 @@ static void oa_report_id_clear(struct i915_perf_stream *stream, u32 *report) static bool oa_...
ba48aa32388ac652256baa8d0a6092d350160da0
Analyze and fix the following issue in the Linux kernel code: x86/microcode: Clean up mc_cpu_down_prep()
Problem Details: This function has nothing to do with suspend. It's a hotplug callback. Remove the bogus comment. Drop the pointless debug printk. The hotplug core provides tracepoints which track the invocation of those callbacks. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov (AM...
```diff diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index 0ed96d273fee..e306feeb374f 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -498,16 +498,10 @@ static int mc_cpu_online(unsigned int cpu) static int mc_cpu_down_prep(u...
ecfd41089348fa4cc767dc588367e9fdf8cb6b9d
Analyze and fix the following issue in the Linux kernel code: x86/microcode/amd: Use correct per CPU ucode_cpu_info
Problem Details: find_blobs_in_containers() is invoked on every CPU but overwrites unconditionally ucode_cpu_info of CPU0. Fix this by using the proper CPU data and move the assignment into the call site apply_ucode_from_containers() so that the function can be reused. Signed-off-by: Thomas Gleixner <tglx@linutronix....
```diff diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index b827390a0aba..56d8bd6b9fe9 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -503,9 +503,6 @@ static void find_blobs_in_containers(unsigned int cpuid_1_eax, struct cpio_data ...
dd5e3e3ca6ac011582a9f3f987493bf6741568c0
Analyze and fix the following issue in the Linux kernel code: x86/microcode/intel: Simplify early loading
Problem Details: The early loading code is overly complicated: - It scans the builtin/initrd for microcode not only on the BSP, but also on all APs during early boot and then later in the boot process it scans again to duplicate and save the microcode before initrd goes away. That's a pointless exer...
```diff diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index a46df14475e9..de3eb97bc2b3 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -42,7 +42,7 @@ #define DRIVER_VERSION "2.2" static struct microcode_ops *microcode_ops; -s...
b805cafc604bfdb671fae7347a57f51154afa735
Analyze and fix the following issue in the Linux kernel code: perf: hisi: Fix use-after-free when register pmu fails
Problem Details: When we fail to register the uncore pmu, the pmu context may not been allocated. The error handing will call cpuhp_state_remove_instance() to call uncore pmu offline callback, which migrate the pmu context. Since that's liable to lead to some kind of use-after-free. Use cpuhp_state_remove_instance_noc...
```diff diff --git a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c index d941e746b424..797cf201996a 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c @@ -505,8 +505,8 @@ static int hisi_pa_pmu_probe(struct platform_devi...
d35381aa73f7e1e8b25f3ed5283287a64d9ddff5
Analyze and fix the following issue in the Linux kernel code: bpf: Fix unnecessary -EBUSY from htab_lock_bucket
Problem Details: htab_lock_bucket uses the following logic to avoid recursion: 1. preempt_disable(); 2. check percpu counter htab->map_locked[hash] for recursion; 2.1. if map_lock[hash] is already taken, return -BUSY; 3. raw_spin_lock_irqsave(); However, if an IRQ hits between 2 and 3, BPF programs attached to the...
```diff diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c index a8c7e1c5abfa..fd8d4b0addfc 100644 --- a/kernel/bpf/hashtab.c +++ b/kernel/bpf/hashtab.c @@ -155,13 +155,15 @@ static inline int htab_lock_bucket(const struct bpf_htab *htab, hash = hash & min_t(u32, HASHTAB_MAP_LOCK_MASK, htab->n_buckets - 1); ...
6d7d51e88e21c0af1ca96a3617afef334bfeffcf
Analyze and fix the following issue in the Linux kernel code: drivers/perf: hisi_pcie: Check the type first in pmu::event_init()
Problem Details: Check whether the event type matches the PMU type firstly in pmu::event_init() before touching the event. Otherwise we'll change the events of others and lead to incorrect results. Since in perf_init_event() we may call every pmu's event_init() in a certain case, we should not modify the event if it's ...
```diff diff --git a/drivers/perf/hisilicon/hisi_pcie_pmu.c b/drivers/perf/hisilicon/hisi_pcie_pmu.c index 5a00adb2de8c..051efffc44c8 100644 --- a/drivers/perf/hisilicon/hisi_pcie_pmu.c +++ b/drivers/perf/hisilicon/hisi_pcie_pmu.c @@ -353,6 +353,10 @@ static int hisi_pcie_pmu_event_init(struct perf_event *event) stru...
643d1260366424412e8269caead410d333e3263f
Analyze and fix the following issue in the Linux kernel code: netfilter: conntrack: switch connlabels to atomic_t
Problem Details: The spinlock is back from the day when connabels did not have a fixed size and reallocation had to be supported. Remove it. This change also allows to call the helpers from softirq or timers without deadlocks. Also add WARN()s to catch refcounting imbalances. Signed-off-by: Florian Westphal <fw@str...
```diff diff --git a/include/net/netfilter/nf_conntrack_labels.h b/include/net/netfilter/nf_conntrack_labels.h index fcb19a4e8f2b..6903f72bcc15 100644 --- a/include/net/netfilter/nf_conntrack_labels.h +++ b/include/net/netfilter/nf_conntrack_labels.h @@ -39,7 +39,7 @@ static inline struct nf_conn_labels *nf_ct_labels_e...
2e75396f1df61e1f1d26d0d703fc7292c4ae4371
Analyze and fix the following issue in the Linux kernel code: pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable
Problem Details: The commit c494a447c14e ("soc: bcm: bcm2835-power: Refactor ASB control") refactored the ASB control by using a general function to handle both the enable and disable. But this patch introduced a subtle regression: we need to check if !!(readl(base + reg) & ASB_ACK) == enable, not just check if (readl(...
```diff diff --git a/drivers/pmdomain/bcm/bcm2835-power.c b/drivers/pmdomain/bcm/bcm2835-power.c index 1a179d4e011c..d2f0233cb620 100644 --- a/drivers/pmdomain/bcm/bcm2835-power.c +++ b/drivers/pmdomain/bcm/bcm2835-power.c @@ -175,7 +175,7 @@ static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool ena...
a71ef31485bb51b846e8db8b3a35e432cc15afb5
Analyze and fix the following issue in the Linux kernel code: perf/core: Fix potential NULL deref
Problem Details: Smatch is awesome. Fixes: 32671e3799ca ("perf: Disallow mis-matched inherited group reads") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index d0663b9324e7..a2f2a9525d72 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -13372,7 +13372,8 @@ static int inherit_group(struct perf_event *parent_event, !perf_get_aux_event(child_ctr, leader)) return -EINVAL; } - leader...
4530e5b8e2dad63dcad2206232dd86e4b1489b6c
Analyze and fix the following issue in the Linux kernel code: gtp: fix fragmentation needed check with gso
Problem Details: Call skb_gso_validate_network_len() to check if packet is over PMTU. Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
```diff diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 144ec626230d..b22596b18ee8 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -872,8 +872,9 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, skb_dst_update_pmtu_no_confirm(skb, mtu); - if (!skb_is_gso(skb) && (iph-...
adc8df12d91a2b8350b0cd4c7fec3e8546c9d1f8
Analyze and fix the following issue in the Linux kernel code: gtp: uapi: fix GTPA_MAX
Problem Details: Subtract one to __GTPA_MAX, otherwise GTPA_MAX is off by 2. Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
```diff diff --git a/include/uapi/linux/gtp.h b/include/uapi/linux/gtp.h index 2f61298a7b77..3dcdb9e33cba 100644 --- a/include/uapi/linux/gtp.h +++ b/include/uapi/linux/gtp.h @@ -33,6 +33,6 @@ enum gtp_attrs { GTPA_PAD, __GTPA_MAX, }; -#define GTPA_MAX (__GTPA_MAX + 1) +#define GTPA_MAX (__GTPA_MAX - 1) #endif ...
6f699743aebf07538e506a46c5965eb8bdd2c716
Analyze and fix the following issue in the Linux kernel code: serial: core: Fix runtime PM handling for pending tx
Problem Details: Richard reported that a serial port may end up sometimes with tx data pending in the buffer for long periods of time. Turns out we bail out early on any errors from pm_runtime_get(), including -EINPROGRESS. To fix the issue, we need to ignore -EINPROGRESS as we only care about the runtime PM usage cou...
```diff diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index b106eb3943d0..f1348a509552 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -146,7 +146,7 @@ static void __uart_start(struct uart_state *state) /* Increment the runtime PM usage coun...
d3c50061765d4b5616dc97f5804fc18122598a9b
Analyze and fix the following issue in the Linux kernel code: autofs: fix add autofs_parse_fd()
Problem Details: We are seeing systemd hang on its autofs direct mount at /proc/sys/fs/binfmt_misc. Historically this was due to a mismatch in the communication structure size between a 64 bit kernel and a 32 bit user space and was fixed by making the pipe communication record oriented. During autofs v5 development I...
```diff diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h index 244f18cdf23c..8c1d587b3eef 100644 --- a/fs/autofs/autofs_i.h +++ b/fs/autofs/autofs_i.h @@ -221,15 +221,20 @@ static inline int autofs_check_pipe(struct file *pipe) return 0; } -static inline int autofs_prepare_pipe(struct file *pipe) +static i...
9644bc49705723bf7c69aa9bf542bb5161b91dba
Analyze and fix the following issue in the Linux kernel code: Fix NULL pointer dereference in cn_filter()
Problem Details: Check that sk_user_data is not NULL, else return from cn_filter(). Could not reproduce this issue, but Oliver Sang verified it has fixed the "Closes" problem below. Fixes: 2aa1f7a1f47c ("connector/cn_proc: Add filtering to fix some bugs") Reported-by: kernel test robot <oliver.sang@intel.com> Closes: ...
```diff diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index 05d562e9c8b1..44b19e696176 100644 --- a/drivers/connector/cn_proc.c +++ b/drivers/connector/cn_proc.c @@ -54,7 +54,7 @@ static int cn_filter(struct sock *dsk, struct sk_buff *skb, void *data) enum proc_cn_mcast_op mc_op; uintptr_t ...
8881e1639f1f899b64e9bccf6cc14d51c1d3c822
Analyze and fix the following issue in the Linux kernel code: sched/fair: Scan cluster before scanning LLC in wake-up path
Problem Details: For platforms having clusters like Kunpeng920, CPUs within the same cluster have lower latency when synchronizing and accessing shared resources like cache. Thus, this patch tries to find an idle cpu within the cluster of the target CPU before scanning the whole LLC to gain lower latency. This will be ...
```diff diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index aa2091a08034..c47b38eded19 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7259,6 +7259,30 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool } } + if (static_branch_unlikely(&sched_cluster_active)...
5ebde09d91707a4a9bec1e3d213e3c12ffde348f
Analyze and fix the following issue in the Linux kernel code: sched/core: Fix RQCF_ACT_SKIP leak
Problem Details: Igor Raits and Bagas Sanjaya report a RQCF_ACT_SKIP leak warning. This warning may be triggered in the following situations: CPU0 CPU1 __schedule() *rq->clock_update_flags <<= 1;* unregister_fair_sched_group() pick_next_task_fair+0x4a/0x410 destroy...
```diff diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 264c2eb380d7..dc724f59e495 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5361,8 +5361,6 @@ context_switch(struct rq *rq, struct task_struct *prev, /* switch_mm_cid() requires the memory barriers above. */ switch_mm_cid(rq, prev, n...
b0eaf27f202813f28af77e33e80ec0f05a34df01
Analyze and fix the following issue in the Linux kernel code: vgacon: fix mips/sibyte build regression
Problem Details: The conversion to vgacon_register_screen() was missing an #include statement for the swarm board: arch/mips/sibyte/swarm/setup.c:146:9: error: implicit declaration of function 'vgacon_register_screen' [-Werror=implicit-function-declaration] Reported-by: kernel test robot <lkp@intel.com> Closes: https...
```diff diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c index 74e7c242b690..38c90b5e8754 100644 --- a/arch/mips/sibyte/swarm/setup.c +++ b/arch/mips/sibyte/swarm/setup.c @@ -13,6 +13,7 @@ #include <linux/memblock.h> #include <linux/init.h> #include <linux/kernel.h> +#include <linux/conso...
389ede06c2974b2f878a7ebff6b0f4f707f9db74
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: tests with delayed read/precision makrs in loop body
Problem Details: These test cases try to hide read and precision marks from loop convergence logic: marks would only be assigned on subsequent loop iterations or after exploring states pushed to env->head stack first. Without verifier fix to use exact states comparison logic for iterators convergence these tests (excep...
```diff diff --git a/tools/testing/selftests/bpf/progs/iters.c b/tools/testing/selftests/bpf/progs/iters.c index 6b9b3c56f009..764a68420c3e 100644 --- a/tools/testing/selftests/bpf/progs/iters.c +++ b/tools/testing/selftests/bpf/progs/iters.c @@ -14,6 +14,13 @@ int my_pid; int arr[256]; int small_arr[16] SEC(".data.s...
2793a8b015f7f1caadb9bce9c63dc659f7522676
Analyze and fix the following issue in the Linux kernel code: bpf: exact states comparison for iterator convergence checks
Problem Details: Convergence for open coded iterators is computed in is_state_visited() by examining states with branches count > 1 and using states_equal(). states_equal() computes sub-state relation using read and precision marks. Read and precision marks are propagated from children states, thus are not guaranteed t...
```diff diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h index e67cd45a85be..38b788228594 100644 --- a/include/linux/bpf_verifier.h +++ b/include/linux/bpf_verifier.h @@ -384,6 +384,7 @@ struct bpf_verifier_state { */ struct bpf_idx_pair *jmp_history; u32 jmp_history_cnt; + u32 dfs_depth;...
a558892b3456d44f2a89d238f5d650f0574fa3b2
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix one kernel-doc comment
Problem Details: Fix a spelling errors in kernel doc comment, silence the warning: drivers/thunderbolt/tb.c:760: warning: expecting prototype for tb_maximum_banwidth(). Prototype was for tb_maximum_bandwidth() instead Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.c...
```diff diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index 664f8e89f16d..f250a6788b6c 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -739,7 +739,7 @@ static bool tb_asym_supported(struct tb_port *src_port, struct tb_port *dst_port } /** - * tb_maximum_banwidth() - Maximu...
d761bb01c85b22d5b44abe283eb89019693f6595
Analyze and fix the following issue in the Linux kernel code: clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data
Problem Details: `struct clk_hw_onecell_data` is a flexible structure, which means that it contains flexible-array member at the bottom, in this case array `hws`: include/linux/clk-provider.h: 1380 struct clk_hw_onecell_data { 1381 unsigned int num; 1382 struct clk_hw *hws[] __counted_by(num); 1383 }; ...
```diff diff --git a/drivers/clk/socfpga/stratix10-clk.h b/drivers/clk/socfpga/stratix10-clk.h index 75234e0783e1..83fe4eb3133c 100644 --- a/drivers/clk/socfpga/stratix10-clk.h +++ b/drivers/clk/socfpga/stratix10-clk.h @@ -7,8 +7,10 @@ #define __STRATIX10_CLK_H struct stratix10_clock_data { - struct clk_hw_onecell_...
dcce5cc7826e9c6b3a2443e5e6b7f8d02a103c35
Analyze and fix the following issue in the Linux kernel code: clk: Show active consumers of clocks in debugfs
Problem Details: This feature lists the clock consumer's name and respective connection id. Using this feature user can easily check that which user has acquired and enabled a particular clock. Usage: >> cat /sys/kernel/debug/clk/clk_summary enable prepare protect ...
```diff diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index c249f9791ae8..0544615d2a1d 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3188,28 +3188,41 @@ static void clk_summary_show_one(struct seq_file *s, struct clk_core *c, int level) { int phase; + struct clk *clk_user; + int multi_node = ...
5ad1e217a2b23aa046b241183bd9452d259d70d0
Analyze and fix the following issue in the Linux kernel code: clk: visconti: Fix undefined behavior bug in struct visconti_pll_provider
Problem Details: `struct clk_hw_onecell_data` is a flexible structure, which means that it contains flexible-array member at the bottom, in this case array `hws`: include/linux/clk-provider.h: 1380 struct clk_hw_onecell_data { 1381 unsigned int num; 1382 struct clk_hw *hws[] __counted_by(num); 1383 }; ...
```diff diff --git a/drivers/clk/visconti/pll.h b/drivers/clk/visconti/pll.h index 01d07f1bf01b..c4bd40676da4 100644 --- a/drivers/clk/visconti/pll.h +++ b/drivers/clk/visconti/pll.h @@ -15,8 +15,10 @@ struct visconti_pll_provider { void __iomem *reg_base; - struct clk_hw_onecell_data clk_data; struct device_nod...
03acb9ccec3f8cbcc0ed93c188b7a119ef30ef64
Analyze and fix the following issue in the Linux kernel code: keys: Remove unused extern declarations
Problem Details: Since commit b2a4df200d57 ("KEYS: Expand the capacity of a keyring") iterate_over_keyring() is never used, so can be removed. And commit b5f545c880a2 ("[PATCH] keys: Permit running process to instantiate keys") left behind keyring_search_instkey(). Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a...
```diff diff --git a/security/keys/internal.h b/security/keys/internal.h index 3c1e7122076b..471cf36dedc0 100644 --- a/security/keys/internal.h +++ b/security/keys/internal.h @@ -109,13 +109,6 @@ extern void __key_link_end(struct key *keyring, extern key_ref_t find_key_to_update(key_ref_t keyring_ref, const s...
3edc22655647378dea01900f7b04e017ff96bda9
Analyze and fix the following issue in the Linux kernel code: integrity: powerpc: Do not select CA_MACHINE_KEYRING
Problem Details: No other platform needs CA_MACHINE_KEYRING, either. This is policy that should be decided by the administrator, not Kconfig dependencies. Cc: stable@vger.kernel.org # v6.6+ Fixes: d7d91c4743c4 ("integrity: PowerVM machine keyring enablement") Signed-off-by: Michal Suchanek <msuchanek@suse.de> Signed-...
```diff diff --git a/security/integrity/Kconfig b/security/integrity/Kconfig index 232191ee09e3..b6e074ac0227 100644 --- a/security/integrity/Kconfig +++ b/security/integrity/Kconfig @@ -68,8 +68,6 @@ config INTEGRITY_MACHINE_KEYRING depends on INTEGRITY_ASYMMETRIC_KEYS depends on SYSTEM_BLACKLIST_KEYRING depends...
c745cd1718b7825d69315fe7127e2e289e617598
Analyze and fix the following issue in the Linux kernel code: KEYS: trusted: tee: Refactor register SHM usage
Problem Details: The OP-TEE driver using the old SMC based ABI permits overlapping shared buffers, but with the new FF-A based ABI each physical page may only be registered once. As the key and blob buffer are allocated adjancently, there is no need for redundant register shared memory invocation. Also, it is incompat...
```diff diff --git a/security/keys/trusted-keys/trusted_tee.c b/security/keys/trusted-keys/trusted_tee.c index ac3e270ade69..aa3d477de6db 100644 --- a/security/keys/trusted-keys/trusted_tee.c +++ b/security/keys/trusted-keys/trusted_tee.c @@ -65,24 +65,16 @@ static int trusted_tee_seal(struct trusted_key_payload *p, ch...
31de287345f41bbfaec36a5c8cbdba035cf76442
Analyze and fix the following issue in the Linux kernel code: KEYS: trusted: Rollback init_trusted() consistently
Problem Details: Do bind neither static calls nor trusted_key_exit() before a successful init, in order to maintain a consistent state. In addition, depart the init_trusted() in the case of a real error (i.e. getting back something else than -ENODEV). Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Closes:...
```diff diff --git a/security/keys/trusted-keys/trusted_core.c b/security/keys/trusted-keys/trusted_core.c index 85fb5c22529a..fee1ab2c734d 100644 --- a/security/keys/trusted-keys/trusted_core.c +++ b/security/keys/trusted-keys/trusted_core.c @@ -358,17 +358,17 @@ static int __init init_trusted(void) if (!get_random...
f862ed2d0bf0cf51c28c1a69e3c2a1558d5a2978
Analyze and fix the following issue in the Linux kernel code: genetlink: don't merge dumpit split op for different cmds into single iter
Problem Details: Currently, split ops of doit and dumpit are merged into a single iter item when they are subsequent. However, there is no guarantee that the dumpit op is for the same cmd as doit op. Fix this by checking if cmd is the same for both. This problem does not occur in existing families. Signed-off-by: Jir...
```diff diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 8315d31b53db..92ef5ed2e7b0 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@ -225,7 +225,8 @@ static void genl_op_from_split(struct genl_op_iter *iter) } if (i + cnt < family->n_split_ops && - family->split_ops[i ...
46d913d4800e5b02fa20683785d873404f1667c4
Analyze and fix the following issue in the Linux kernel code: idpf: cancel mailbox work in error path
Problem Details: In idpf_vc_core_init, the mailbox work is queued on a mailbox workqueue but it is not cancelled on error. This results in a call trace when idpf_mbx_task tries to access the freed mailbox queue pointer. Fix it by cancelling the mailbox work in the error path. Fixes: 4930fbf419a7 ("idpf: add core init ...
```diff diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c index e276b5360c2e..2c1b051fdc0d 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c @@ -3146,6 +3146,7 @@ restart: err_intr_req: can...
d38b4d0d95bc0c7243ca54a32c256c0583b6a9fc
Analyze and fix the following issue in the Linux kernel code: idpf: set scheduling mode for completion queue
Problem Details: The HW must be programmed differently for queue-based scheduling mode. To program the completion queue context correctly, the control plane must know the scheduling mode not only for the Tx queue, but also for the completion queue. Unfortunately, currently the driver sets the scheduling mode only for t...
```diff diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c index 6fa79898c42c..58c5412d3173 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c @@ -1160,6 +1160,7 @@ static void idpf_rxq_set_descids(struct idpf_vp...
81a4169856987b65918a93e9b9f53a28496575cf
Analyze and fix the following issue in the Linux kernel code: net_sched: sch_fq: fastpath needs to take care of sk->sk_pacing_status
Problem Details: If packets of a TCP flows take the fast path, we need to make sure sk->sk_pacing_status is set to SK_PACING_FQ otherwise TCP might fallback to internal pacing, which is not optimal. Fixes: 076433bd78d7 ("net_sched: sch_fq: add fast path for mostly idle qdisc") Signed-off-by: Eric Dumazet <edumazet@goo...
```diff diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c index f6fd0de293e5..bf9d00518a60 100644 --- a/net/sched/sch_fq.c +++ b/net/sched/sch_fq.c @@ -383,6 +383,10 @@ static struct fq_flow *fq_classify(struct Qdisc *sch, struct sk_buff *skb, if (fq_fastpath_check(sch, skb, now)) { q->internal.stat_fastpath_...
06e4dd18f86876bc29786d66165f781cd0265b7c
Analyze and fix the following issue in the Linux kernel code: net_sched: sch_fq: fix off-by-one error in fq_dequeue()
Problem Details: A last minute change went wrong. We need to look for a packet in all 3 bands, not only two. Fixes: 29f834aa326e ("net_sched: sch_fq: add 3 bands and WRR scheduling") Reported-by: kernel test robot <oliver.sang@intel.com> Closes: https://lore.kernel.org/oe-lkp/202310201422.a22b0999-oliver.sang@intel.c...
```diff diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c index 8eacdb54e72f..f6fd0de293e5 100644 --- a/net/sched/sch_fq.c +++ b/net/sched/sch_fq.c @@ -651,7 +651,7 @@ static struct sk_buff *fq_dequeue(struct Qdisc *sch) begin: head = fq_pband_head_select(pband); if (!head) { - while (++retry < FQ_BANDS) { + ...
d788c9338342a3146d115281922901c1e3e1cbff
Analyze and fix the following issue in the Linux kernel code: sfc: cleanup and reduce netlink error messages
Problem Details: Reduce the length of netlink error messages as they are likely to be truncated anyway. Additionally, reword netlink error messages so they are more consistent with previous messages. Fixes: 9dbc8d2b9a02 ("sfc: add decrement ipv6 hop limit by offloading set hop limit actions") Fixes: 3c9561c0a5b9 ("sfc...
```diff diff --git a/drivers/net/ethernet/sfc/tc.c b/drivers/net/ethernet/sfc/tc.c index 834f000ba1c4..30ebef88248d 100644 --- a/drivers/net/ethernet/sfc/tc.c +++ b/drivers/net/ethernet/sfc/tc.c @@ -629,14 +629,14 @@ static int efx_tc_flower_record_encap_match(struct efx_nic *efx, } if (child_ip_tos_mask != old...
473baeab929444295b0530f8766e4becb6a08973
Analyze and fix the following issue in the Linux kernel code: ARM: dts: BCM5301X: Explicitly disable unused switch CPU ports
Problem Details: When redescribing ports I assumed that missing "label" (like "cpu") means switch port isn't used. That was incorrect and I realized my change made Linux always use the first (5) CPU port (there are 3 of them). While above should technically be possible it often isn't correct: 1. Non-default switch por...
```diff diff --git a/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi b/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi index 42bcbf10957c..9f9084269ef5 100644 --- a/arch/arm/boot/dts/broadcom/bcm4708-buffalo-wzr-1166dhp-common.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm4708-buffalo-w...
e035ddb68bb2827cff3aad1a6ff17ecc6e62f07e
Analyze and fix the following issue in the Linux kernel code: arm64: dts: socionext: add missing cache properties
Problem Details: As all level 2 and level 3 caches are unified, add required cache-unified property to fix warnings like: uniphier-ld11-ref.dtb: l2-cache: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@soci...
```diff diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi index 54e58d945fd7..4680571c264d 100644 --- a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi +++ b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi @@ -53,6 +53,7 @@ l2: l2-cache { compatibl...
9bc633117d6a8411c6912cb0194b3e0f83ef9d56
Analyze and fix the following issue in the Linux kernel code: hte: tegra194: add GPIOLIB dependency
Problem Details: The driver started calling into a few interfaces that are part of GPIOLIB and don't have stub implementations otherwise: drivers/hte/hte-tegra194.c: In function 'tegra_hte_line_xlate': drivers/hte/hte-tegra194.c:424:48: error: implicit declaration of function 'gpio_device_get_base'; did you mean 'gpio...
```diff diff --git a/drivers/hte/Kconfig b/drivers/hte/Kconfig index cf29e0218bae..8e0fd818a73e 100644 --- a/drivers/hte/Kconfig +++ b/drivers/hte/Kconfig @@ -17,6 +17,7 @@ if HTE config HTE_TEGRA194 tristate "NVIDIA Tegra194 HTE Support" depends on ARCH_TEGRA_194_SOC + depends on GPIOLIB help Enable this op...
530886897c789cf77c9a0d4a7cc5549f0768b5f8
Analyze and fix the following issue in the Linux kernel code: Bluetooth: hci_sync: Fix Opcode prints in bt_dev_dbg/err
Problem Details: Printed Opcodes may be missing leading zeros: Bluetooth: hci0: Opcode 0x c03 failed: -110 Fix this by always printing leading zeros: Bluetooth: hci0: Opcode 0x0c03 failed: -110 Fixes: d0b137062b2d ("Bluetooth: hci_sync: Rework init stages") Fixes: 6a98e3836fa2 ("Bluetooth: Add helper for serializ...
```diff diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index c6f57af88bfd..d85a7091a116 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -152,7 +152,7 @@ struct sk_buff *__hci_cmd_sync_sk(struct hci_dev *hdev, u16 opcode, u32 plen, struct sk_buff *skb; int err = 0; - bt_de...
a85fb91e3d728bdfc80833167e8162cce8bc7004
Analyze and fix the following issue in the Linux kernel code: Bluetooth: Fix double free in hci_conn_cleanup
Problem Details: syzbot reports a slab use-after-free in hci_conn_hash_flush [1]. After releasing an object using hci_conn_del_sysfs in the hci_conn_cleanup function, releasing the same object again using the hci_dev_put and hci_conn_put functions causes a double free. Here's a simplified flow: hci_conn_del_sysfs: h...
```diff diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 3735764b3169..2cee330188ce 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -172,13 +172,11 @@ static void hci_conn_cleanup(struct hci_conn *conn) hdev->notify(hdev, HCI_NOTIFY_CONN_DEL); } - hci_conn_del_sysfs...