id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
a940e0a685575424d33324ec7f0089045249de0a
Analyze and fix the following issue in the Linux kernel code: vhost: fix VHOST_*_OWNER documentation
Problem Details: VHOST_OWNER_SET and VHOST_OWNER_RESET are used in the documentation instead of VHOST_SET_OWNER and VHOST_RESET_OWNER respectively. To avoid confusion, let's use the right names in the documentation. No change to the API, only the documentation is involved. Signed-off-by: Stefano Garzarella <sgarzare@...
```diff diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h index b95dd84eef2d..d4b3e2ae1314 100644 --- a/include/uapi/linux/vhost.h +++ b/include/uapi/linux/vhost.h @@ -28,10 +28,10 @@ /* Set current process as the (exclusive) owner of this file descriptor. This * must be called before any other...
16c22c56d4282584742022a37d4f79a46ca6094a
Analyze and fix the following issue in the Linux kernel code: virtio_pci: Use self group type for cap commands
Problem Details: Section 2.12.1.2 of v1.4 of the VirtIO spec states: The device and driver capabilities commands are currently defined for self group type. 1. VIRTIO_ADMIN_CMD_CAP_ID_LIST_QUERY 2. VIRTIO_ADMIN_CMD_DEVICE_CAP_GET 3. VIRTIO_ADMIN_CMD_DRIVER_CAP_SET Fixes: bfcad518605d ("virtio: Manage device and driver...
```diff diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index 5eaade757860..d50fe030d825 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c @@ -247,7 +247,7 @@ virtio_pci_admin_cmd_dev_parts_objects_enable(struct virtio_device *virtio_dev) sg_...
1ee1313f4722e6d67c6e9447ee81d24d6e3ff4ad
Analyze and fix the following issue in the Linux kernel code: riscv: module: Allocate PLT entries for R_RISCV_PLT32
Problem Details: apply_r_riscv_plt32_rela() may need to emit a PLT entry for the referenced symbol, so there must be space allocated in the PLT. Fixes: 8fd6c5142395 ("riscv: Add remaining module relocations") Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> ...
```diff diff --git a/arch/riscv/kernel/module-sections.c b/arch/riscv/kernel/module-sections.c index e264e59e596e..91d0b355ceef 100644 --- a/arch/riscv/kernel/module-sections.c +++ b/arch/riscv/kernel/module-sections.c @@ -73,16 +73,17 @@ static bool duplicate_rela(const Elf_Rela *rela, int idx) static void count_max_...
0b4cce68efb93e31a8e51795d696df6e379cb41c
Analyze and fix the following issue in the Linux kernel code: riscv: module: Fix out-of-bounds relocation access
Problem Details: The current code allows rel[j] to access one element past the end of the relocation section. Simplify to num_relocations which is equivalent to the existing size expression. Fixes: 080c4324fa5e ("riscv: optimize ELF relocation function in riscv") Signed-off-by: Samuel Holland <samuel.holland@sifive.co...
```diff diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c index 0ae34d79b87b..7f6147c18033 100644 --- a/arch/riscv/kernel/module.c +++ b/arch/riscv/kernel/module.c @@ -860,7 +860,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, } j++; - if (j > sechdrs[relsec].sh_size...
e94eb7ea6f206e229791761a5fdf9389f8dbd183
Analyze and fix the following issue in the Linux kernel code: riscv: Properly export reserved regions in /proc/iomem
Problem Details: The /proc/iomem represents the kernel's memory map. Regions marked with "Reserved" tells the user that the range should not be tampered with. Kexec-tools, when using the older kexec_load syscall relies on the "Reserved" regions to build the memory segments, that will be the target of the new kexec'd ke...
```diff diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index c174544eefc8..f7c9a1caa83e 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -66,6 +66,9 @@ static struct resource bss_res = { .name = "Kernel bss", }; static struct resource elfcorehdr_res = { .name = "ELF Core hd...
441016056010e50cee18633b9dc125b24feeb74d
Analyze and fix the following issue in the Linux kernel code: riscv: Fix unaligned access info messages
Problem Details: Ensure we only print messages about command line parameters when the parameters are actually in use. Also complain about the use of the vector parameter when vector support isn't available. Fixes: aecb09e091dc ("riscv: Add parameter for skipping access speed tests") Reported-by: Geert Uytterhoeven <ge...
```diff diff --git a/arch/riscv/kernel/unaligned_access_speed.c b/arch/riscv/kernel/unaligned_access_speed.c index 585d2dcf2dab..b8ba13819d05 100644 --- a/arch/riscv/kernel/unaligned_access_speed.c +++ b/arch/riscv/kernel/unaligned_access_speed.c @@ -439,29 +439,36 @@ static int __init check_unaligned_access_all_cpus(v...
c31a0b6402d15b530514eee9925adfcb8cfbb1c9
Analyze and fix the following issue in the Linux kernel code: drm/xe: Set LRC addresses before guc load
Problem Details: The metadata saved in the ADS is read by GuC when it's initialized. Saving the addresses to the LRCs when they are populated is too late as GuC will keep using the old ones. This was causing GuC to use the RCS LRC for any engine class. It's not a big problem on a Linux-only scenario since the they are...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_ads.c b/drivers/gpu/drm/xe/xe_guc_ads.c index 315f86c9164f..44c1fa2fe7c8 100644 --- a/drivers/gpu/drm/xe/xe_guc_ads.c +++ b/drivers/gpu/drm/xe/xe_guc_ads.c @@ -496,24 +496,52 @@ static void fill_engine_enable_masks(struct xe_gt *gt, engine_enable_mask(gt, XE_ENGI...
138303ec6ccbe38611931eeb955a722c6f78ec25
Analyze and fix the following issue in the Linux kernel code: sysctl: move u8 register test to lib/test_sysctl.c
Problem Details: If the test added in commit b5ffbd139688 ("sysctl: move the extra1/2 boundary check of u8 to sysctl_check_table_array") is run as a module, a lingering reference to the module is left behind, and a 'sysctl -a' leads to a panic. To reproduce CONFIG_KUNIT=y CONFIG_SYSCTL_KUNIT_TEST=m Then run t...
```diff diff --git a/kernel/sysctl-test.c b/kernel/sysctl-test.c index eb2842bd0557..92f94ea28957 100644 --- a/kernel/sysctl-test.c +++ b/kernel/sysctl-test.c @@ -367,54 +367,6 @@ static void sysctl_test_api_dointvec_write_single_greater_int_max( KUNIT_EXPECT_EQ(test, 0, *((int *)table.data)); } -/* - * Test that ...
53bd97801632c940767f4c8407c2cbdeb56b40e7
Analyze and fix the following issue in the Linux kernel code: rust: firmware: Use `ffi::c_char` type in `FwFunc`
Problem Details: The `FwFunc` struct contains an function with a char pointer argument, for which a `*const u8` pointer was used. This is not really the "proper" type for this, so use a `*const kernel::ffi::c_char` pointer instead. This has no real functionality changes, since now `kernel::ffi::c_char` (which bindgen ...
```diff diff --git a/rust/kernel/firmware.rs b/rust/kernel/firmware.rs index f04b058b09b2..2494c96e105f 100644 --- a/rust/kernel/firmware.rs +++ b/rust/kernel/firmware.rs @@ -4,7 +4,7 @@ //! //! C header: [`include/linux/firmware.h`](srctree/include/linux/firmware.h) -use crate::{bindings, device::Device, error::Er...
1363c134ade81e425873b410566e957fecebb261
Analyze and fix the following issue in the Linux kernel code: fs/filesystems: Fix potential unsigned integer underflow in fs_name()
Problem Details: fs_name() has @index as unsigned int, so there is underflow risk for operation '@index--'. Fix by breaking the for loop when '@index == 0' which is also more proper than '@index <= 0' for unsigned integer comparison. Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Link: https://lore.kernel.org/2025...
```diff diff --git a/fs/filesystems.c b/fs/filesystems.c index 58b9067b2391..95e5256821a5 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -156,15 +156,19 @@ static int fs_index(const char __user * __name) static int fs_name(unsigned int index, char __user * buf) { struct file_system_type * tmp; - int len, r...
1d17057d2166a192b3fad358a20c93fa3e994ef8
Analyze and fix the following issue in the Linux kernel code: fs/fs_parse: Correct comments of fs_validate_description()
Problem Details: For fs_validate_description(), its comments easily mislead reader that the function will search array @desc for duplicated entries with name specified by parameter @name, but @name is not used for search actually. Fix by marking name as owner's name of these parameter specifications. Signed-off-by: Z...
```diff diff --git a/fs/fs_parser.c b/fs/fs_parser.c index e635a81e17d9..c5cb19788f74 100644 --- a/fs/fs_parser.c +++ b/fs/fs_parser.c @@ -429,9 +429,9 @@ bool validate_constant_table(const struct constant_table *tbl, size_t tbl_size, } /** - * fs_validate_description - Validate a parameter description - * @name: T...
84d37635986987649fec6dd7358392243a35601e
Analyze and fix the following issue in the Linux kernel code: drm/xe/pf: Don't show GGTT/LMEM debugfs files under media GT
Problem Details: Most of the PF's debugfs files (and their implementations) are based on the GT hierarchy even if files are related to GGTT or LMEM data, that are related to the tile. While we could reach the tile data from any GT, to avoid potential misuse, some functions allow to be used on the primary GT only, and ...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c index b2521dd6ec42..0fe47f41b63c 100644 --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_debugfs.c @@ -51,26 +51,17 @@ static unsigned int extract_vfid(struct dentry *d...
d2f5819b6ed357c0c350c0616b6b9f38be59adf6
Analyze and fix the following issue in the Linux kernel code: slab: ensure slab->obj_exts is clear in a newly allocated slab page
Problem Details: ktest recently reported crashes while running several buffered io tests with __alloc_tagging_slab_alloc_hook() at the top of the crash call stack. The signature indicates an invalid address dereference with low bits of slab->obj_exts being set. The bits were outside of the range used by page_memcg_data...
```diff diff --git a/mm/slub.c b/mm/slub.c index b46f87662e71..dc9e729e1d26 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1973,6 +1973,11 @@ static inline void handle_failed_objexts_alloc(unsigned long obj_exts, #define OBJCGS_CLEAR_MASK (__GFP_DMA | __GFP_RECLAIMABLE | \ __GFP_ACCOUNT | __GFP_NOFAIL) +static inli...
028363685bd0b7a19b4a820f82dd905b1dc83999
Analyze and fix the following issue in the Linux kernel code: espintcp: remove encap socket caching to avoid reference leak
Problem Details: The current scheme for caching the encap socket can lead to reference leaks when we try to delete the netns. The reference chain is: xfrm_state -> enacp_sk -> netns Since the encap socket is a userspace socket, it holds a reference on the netns. If we delete the espintcp state (through flush or indiv...
```diff diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 39365fd2ea17..06ab2a3d2ebd 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -236,7 +236,6 @@ struct xfrm_state { /* Data for encapsulator */ struct xfrm_encap_tmpl *encap; - struct sock __rcu *encap_sk; /* NAT keepalive */ u32 n...
63c1f19a3be3169e51a5812d22a6d0c879414076
Analyze and fix the following issue in the Linux kernel code: espintcp: fix skb leaks
Problem Details: A few error paths are missing a kfree_skb. Fixes: e27cca96cd68 ("xfrm: add espintcp (RFC 8229)") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
```diff diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 0e4076866c0a..876df672c0bf 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -199,8 +199,10 @@ static int esp_output_tcp_finish(struct xfrm_state *x, struct sk_buff *skb) sk = esp_find_tcp_sk(x); err = PTR_ERR_OR_ZERO(sk); - if (err) + if (err) { + ...
7d346bf124282d0326dd4f1b104b2d07d902ef23
Analyze and fix the following issue in the Linux kernel code: arm64: dts: mediatek: mt8186: starmie: Fix external display
Problem Details: The dpi-default-pins overwrittes the same called node, defined in mt8186-corsola.dtsi with the wrong set of pins, so remove it from mt8186-corsola-starmie.dtsi as the first one is correct and sufficient. In addition, remove dpi-func-pins node from mt8186-corsola-starmie.dtsi, as it is not used anywhere...
```diff diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola-starmie.dtsi b/arch/arm64/boot/dts/mediatek/mt8186-corsola-starmie.dtsi index 5ea8bdc00e81..a8e79c2791ba 100644 --- a/arch/arm64/boot/dts/mediatek/mt8186-corsola-starmie.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola-starmie.dtsi @@ -375,51 +375,6...
394f29033324e2317bfd6a7ed99b9a60832b36a2
Analyze and fix the following issue in the Linux kernel code: arm64: dts: mediatek: mt8195: Reparent vdec1/2 and venc1 power domains
Problem Details: By hardware, the first and second core of the video decoder IP need the VDEC_SOC to be powered up in order to be able to be accessed (both internally, by firmware, and externally, by the kernel). Similarly, for the video encoder IP, the second core needs the first core to be powered up in order to be a...
```diff diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi index 4f2dc0a75566..1ded4b3f8760 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -617,22 +617,6 @@ #size-cells = <0>; #power-domain-cells = <1>; ...
ec71844817266c8d301f5745126cdbdafd33edea
Analyze and fix the following issue in the Linux kernel code: arm64: dts: mediatek: mt8390-genio-common: Fix pcie pinctrl dtbs_check error
Problem Details: Rename pcie pinctrl definition to fix the following dtbs_check error for mt8370-genio-510-evk and mt8390-genio-700-evk devicetree files: ``` pinctrl@10005000: 'pcie-default' does not match any of the regexes: '-pins$', 'pinctrl-[0-9]+' ``` Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@colla...
```diff diff --git a/arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi b/arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi index 60139e6dffd8..e9d57f44475b 100644 --- a/arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8390-genio-common.dtsi @@ -501,7 +501,7 @@ &pcie ...
f19d67bbe6cbe375dce9976ad1e9690aaeaa33e1
Analyze and fix the following issue in the Linux kernel code: arm64: dts: mediatek: mt8395-genio-1200-evk: Add scp firmware-name
Problem Details: Set the scp firmware name to the default location. Fixes: f2b543a191b6 ("arm64: dts: mediatek: add device-tree for Genio 1200 EVK board") Signed-off-by: Julien Massot <julien.massot@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kern...
```diff diff --git a/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts b/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts index f02c32def593..2740c799ca12 100644 --- a/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts +++ b/arch/arm64/boot/dts/mediatek/mt8395-genio-1200-evk.dts @@ -872,6 +872,7 @@ &s...
898b289ac89bcd0c793bb5b894d29599ab447fd5
Analyze and fix the following issue in the Linux kernel code: arm64: dts: mediatek: mt8395-nio-12l: Add scp firmware-name
Problem Details: Set the scp firmware name to the default location. Fixes: 96564b1e2ea4 ("arm64: dts: mediatek: Introduce the MT8395 Radxa NIO 12L board") Signed-off-by: Julien Massot <julien.massot@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.ker...
```diff diff --git a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts index 1c922e98441a..f2eb1b683eb7 100644 --- a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts +++ b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts @@ -850,6 +850,7 @@ &scp {...
a37b3b9c3cc595521c7f9d9b2b0b2ad367bf9c98
Analyze and fix the following issue in the Linux kernel code: xfs: compute buffer address correctly in xmbuf_map_backing_mem
Problem Details: Prior to commit e614a00117bc2d, xmbuf_map_backing_mem relied on folio_file_page to return the base page for the xmbuf's loff_t in the xfile, and set b_addr to the page_address of that base page. Now that folio_file_page has been removed from xmbuf_map_backing_mem, we always set b_addr to the folio_add...
```diff diff --git a/fs/xfs/xfs_buf_mem.c b/fs/xfs/xfs_buf_mem.c index b4ffd80b7cb6..dcbfa274e06d 100644 --- a/fs/xfs/xfs_buf_mem.c +++ b/fs/xfs/xfs_buf_mem.c @@ -165,7 +165,7 @@ xmbuf_map_backing_mem( folio_set_dirty(folio); folio_unlock(folio); - bp->b_addr = folio_address(folio); + bp->b_addr = folio_address(f...
267623000d11f6d483214be2484555f600393a12
Analyze and fix the following issue in the Linux kernel code: arm64: dts: mediatek: mt8188: Fix IOMMU device for rdma0
Problem Details: Based on the comments in the MT8188 IOMMU binding header, the rdma0 device specifies the wrong IOMMU device for the IOMMU port it is tied to: This SoC have two MM IOMMU HWs, this is the connected information: iommu-vdo: larb0/2/5/9/10/11A/11C/13/16B/17B/19/21 iommu-vpp: larb1/3/4/6/7/11B/1...
```diff diff --git a/arch/arm64/boot/dts/mediatek/mt8188.dtsi b/arch/arm64/boot/dts/mediatek/mt8188.dtsi index 69a8423d3858..29d35ca94597 100644 --- a/arch/arm64/boot/dts/mediatek/mt8188.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8188.dtsi @@ -2579,7 +2579,7 @@ reg = <0 0x1c002000 0 0x1000>; clocks = <&vdosys0 C...
b73e05281cd9e37b5525641ca6f4544867372533
Analyze and fix the following issue in the Linux kernel code: xfs: remove the leftover xfs_{set,clear}_li_failed infrastructure
Problem Details: Marking a log item as failed kept a buffer reference around for resubmission of inode and dquote items. For inode items commit 298f7bec503f3 ("xfs: pin inode backing buffer to the inode log item") started pinning the inode item buffers unconditionally and removed the need for this. Later commit acc8f...
```diff diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c index edbc521870a1..b4e32f0860b7 100644 --- a/fs/xfs/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c @@ -1186,9 +1186,8 @@ xfs_qm_dqflush_done( if (test_bit(XFS_LI_IN_AIL, &lip->li_flags) && (lip->li_lsn == qlip->qli_flush_lsn || test_bit(XFS_LI_FAILED, &...
fb10144ba426b88080c6abcede5f1332bebc3c60
Analyze and fix the following issue in the Linux kernel code: drm/udl: Support adapters without firmware descriptor
Problem Details: Set default limit on the number of pixels for adapters without vendor firmware descriptor. The devices work as expected, they just don't provide any description. If parsing the vendor firmware descriptor fails, the device falls back to the given default limits. Failing to allocate memory is still an e...
```diff diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index b5a6b254a202..3dfeb88cf918 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -76,6 +76,7 @@ static int udl_parse_vendor_descriptor(struct udl_device *udl) { struct drm_device *dev = &udl->drm;...
df6dc12e5e6ddbf2a59d5283fcf6ccd0b3d0334d
Analyze and fix the following issue in the Linux kernel code: drm/udl: Validate length in vendor-descriptor parser
Problem Details: Rewrite the parser for the vendor firmware descriptor with the following improvements. - Validate the key-value length given in a vendor descriptor against the length of the descriptor. The current code fails to do this and might read more bytes than available. This can lead to out-of-bounds reads of ...
```diff diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index d3a04bcb65d2..b5a6b254a202 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -8,6 +8,8 @@ * Copyright (C) 2009 Bernie Thompson <bernie@plugable.com> */ +#include <linux/unaligned.h> + #inc...
314c45e39e9abcaf2fe5449a11b6d9ad3b2c7dbc
Analyze and fix the following issue in the Linux kernel code: drm/sysfb: Split source file
Problem Details: Split drm_sysfb_helper.c into two source files. There's now one source file for the mode-setting pipeline and one source file for module meta data. Prepares for adding additional source code to sysfb helpers. v2: - fix typo in commit message (Javier) Signed-off-by: Thomas Zimmermann <tzimmermann@suse...
```diff diff --git a/drivers/gpu/drm/sysfb/Makefile b/drivers/gpu/drm/sysfb/Makefile index 0d2518c97163..861b4026f4a6 100644 --- a/drivers/gpu/drm/sysfb/Makefile +++ b/drivers/gpu/drm/sysfb/Makefile @@ -1,5 +1,8 @@ # SPDX-License-Identifier: GPL-2.0-only +drm_sysfb_helper-y := \ + drm_sysfb.o \ + drm_sysfb_modeset.o...
f99002b9a9cc441a8f362e6fb32cf8a5a990261a
Analyze and fix the following issue in the Linux kernel code: x86/alternatives, um: Rename UML's text_poke_sync() wrapper to smp_text_poke_sync_each_cpu()
Problem Details: Missed this UML wrapper in the rename. Fixes: 6e4955a9d73e ("x86/alternatives: Rename 'text_poke_sync()' to 'smp_text_poke_sync_each_cpu()'") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/202504141003.kc69fVoj-lkp@intel.com
```diff diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index d4b3b6742ec8..2f5ee045bc7a 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -477,7 +477,7 @@ void *text_poke_copy(void *addr, const void *opcode, size_t len) return text_poke(addr, opcode, len); } -void text_poke_...
1013f5636fd808569c1f4c40a58a4efc70713a28
Analyze and fix the following issue in the Linux kernel code: genksyms: Handle typeof_unqual keyword and __seg_{fs,gs} qualifiers
Problem Details: Handle typeof_unqual, __typeof_unqual and __typeof_unqual__ keywords using TYPEOF_KEYW token in the same way as typeof keyword. Also ignore x86 __seg_fs and __seg_gs named address space qualifiers using X86_SEG_KEYW token in the same way as const, volatile or restrict qualifiers. Fixes: ac053946f5c4 ...
```diff diff --git a/scripts/genksyms/keywords.c b/scripts/genksyms/keywords.c index b85e0979a00c..ee1499d27061 100644 --- a/scripts/genksyms/keywords.c +++ b/scripts/genksyms/keywords.c @@ -17,6 +17,8 @@ static struct resword { { "__signed__", SIGNED_KEYW }, { "__typeof", TYPEOF_KEYW }, { "__typeof__", TYPEOF_KE...
dd303e021996a0e43963d852af8a3277e6f5ed88
Analyze and fix the following issue in the Linux kernel code: soc: samsung: usi: prevent wrong bits inversion during unconfiguring
Problem Details: Instead of setting bit 1 (USI_OPTION_CLKSTOP_ON) during USI unconfiguring, all the other bits in the USI_OPTION register get inverted, which should not happen as that means the clock will keep getting provided to the USI IP. Remove the unnecessary tilde. Fixes: 11e77776b58a ("soc: samsung: usi: add a ...
```diff diff --git a/drivers/soc/samsung/exynos-usi.c b/drivers/soc/samsung/exynos-usi.c index c5661ac19f7b..5f7bdf3bab05 100644 --- a/drivers/soc/samsung/exynos-usi.c +++ b/drivers/soc/samsung/exynos-usi.c @@ -233,7 +233,7 @@ static void exynos_usi_unconfigure(void *data) /* Make sure that we've stopped providing th...
22aafe3bcb67472effdea1ccf0df20280192bbaf
Analyze and fix the following issue in the Linux kernel code: x86/fpu: Remove init_task FPU state dependencies, add debugging warning for PF_KTHREAD tasks
Problem Details: init_task's FPU state initialization was a bit of a hack: __x86_init_fpu_begin = .; . = __x86_init_fpu_begin + 128*PAGE_SIZE; __x86_init_fpu_end = .; But the init task isn't supposed to be using the FPU context in any case, so remove the hack and add in some debug warnings. As Linus noted in t...
```diff diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index b7f7c9c83409..eaa7214d6953 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -516,7 +516,11 @@ struct thread_struct { #endif }; -#define x86_task_fpu(task) ((struct fpu *)((void *)(ta...
c360bdc593b8a8b6e94166026728764085919cff
Analyze and fix the following issue in the Linux kernel code: x86/fpu: Make sure x86_task_fpu() doesn't get called for PF_KTHREAD|PF_USER_WORKER tasks during exit
Problem Details: fpu__drop() and arch_release_task_struct() calls x86_task_fpu() unconditionally, while the FPU context area will not be present if it's the init task, and should not be in use when it's some other type of kthread. Return early for PF_KTHREAD or PF_USER_WORKER tasks. The debug warning in x86_task_fpu()...
```diff diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index e4c20908ee49..4a2193892e5d 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -683,7 +683,13 @@ int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal, */ void fpu__drop(struct task_str...
96d20cfd16e779923153f7347b0bef6b3c7606ce
Analyze and fix the following issue in the Linux kernel code: pwm: Do stricter return value checking for .round_waveform_tohw()
Problem Details: The .round_waveform_tohw() is supposed to return 0 if the request could be rounded down to match the hardware capabilities and return 1 if rounding down wasn't possible. Expand the PWM_DEBUG check to not only assert proper downrounding if 0 was returned but also check that it was actually rounded up w...
```diff diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 02d98e4c75a5..59cc8792e312 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -270,10 +270,10 @@ int pwm_round_waveform_might_sleep(struct pwm_device *pwm, struct pwm_waveform * wf_req.duty_length_ns, wf_req.period_length_ns, wf_req.duty_of...
fa829c1f40b7818a6c0b06719b6f057b3b0424dc
Analyze and fix the following issue in the Linux kernel code: pwm: stm32: Emit debug output also for corner cases of the rounding callbacks
Problem Details: When you're interested in the actual register settings the driver chooses or interprets you want to see them also for calls that hit corner cases. Make sure that all calls to stm32_pwm_round_waveform_tohw() and stm32_pwm_round_waveform_fromhw() emit the debug message about the register settings. Sign...
```diff diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c index c6625f51a199..4b148f0afeb9 100644 --- a/drivers/pwm/pwm-stm32.c +++ b/drivers/pwm/pwm-stm32.c @@ -180,11 +180,11 @@ static int stm32_pwm_round_waveform_tohw(struct pwm_chip *chip, wfhw->ccr = min_t(u64, ccr, wfhw->arr + 1); +out: dev_d...
461d68d43d69a3d96750448ea5c3e0a68fc8d4c6
Analyze and fix the following issue in the Linux kernel code: pwm: Add actual hardware state to pwm debugfs file
Problem Details: Traditionally /sys/kernel/debug/pwm only contained info from pwm->state. Most of the time this data represents the last requested setting which might differ considerably from the actually configured in hardware setting. Expand the information in the debugfs file with the actual values. Signed-off-by:...
```diff diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 0387bd838487..02d98e4c75a5 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -2221,25 +2221,28 @@ static void pwm_dbg_show(struct pwm_chip *chip, struct seq_file *s) for (i = 0; i < chip->npwm; i++) { struct pwm_device *pwm = &chip->pwm...
8692c7db9a66c5efe7956afc48d21bc994289d95
Analyze and fix the following issue in the Linux kernel code: bcachefs: btree_root_unreadable_and_scan_found_nothing now AUTOFIX
Problem Details: This will likely mean that the btree had only one node - there was nothing or almost nothing in it, and we should reconstruct and continue. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/sb-errors_format.h b/fs/bcachefs/sb-errors_format.h index 5d43e3504386..512c56ee5d94 100644 --- a/fs/bcachefs/sb-errors_format.h +++ b/fs/bcachefs/sb-errors_format.h @@ -290,7 +290,7 @@ enum bch_fsck_flags { x(btree_node_bkey_bad_u64s, 260, 0) \ x(btree_node_topology_empty_inter...
95d2b9f693ff2a1180a23d7d59acc0c4e72f4c41
Analyze and fix the following issue in the Linux kernel code: Revert "smb: client: fix TCP timers deadlock after rmmod"
Problem Details: This reverts commit e9f2517a3e18a54a3943c098d2226b245d488801. Commit e9f2517a3e18 ("smb: client: fix TCP timers deadlock after rmmod") is intended to fix a null-ptr-deref in LOCKDEP, which is mentioned as CVE-2024-54680, but is actually did not fix anything; The issue can be reproduced on top of it. [...
```diff diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index 370b79b2eaa6..df976ce6aed9 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -1073,13 +1073,9 @@ clean_demultiplex_info(struct TCP_Server_Info *server) msleep(125); if (cifs_rdma_enabled(server)) smbd_destroy(server)...
c707193a17128fae2802d10cbad7239cc57f0c95
Analyze and fix the following issue in the Linux kernel code: Revert "smb: client: Fix netns refcount imbalance causing leaks and use-after-free"
Problem Details: This reverts commit 4e7f1644f2ac6d01dc584f6301c3b1d5aac4eaef. The commit e9f2517a3e18 ("smb: client: fix TCP timers deadlock after rmmod") is not only a bogus fix for LOCKDEP null-ptr-deref but also introduces a real issue, TCP sockets leak, which will be explained in detail in the next revert. Also,...
```diff diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index 4a0b2d220fe8..370b79b2eaa6 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -300,7 +300,6 @@ cifs_abort_connection(struct TCP_Server_Info *server) server->ssocket->flags); sock_release(server->ssocket); server->...
262b73ef442e68e53220b9d6fc5a0d08b557fa42
Analyze and fix the following issue in the Linux kernel code: smb3 client: fix open hardlink on deferred close file error
Problem Details: The following Python script results in unexpected behaviour when run on a CIFS filesystem against a Windows Server: # Create file fd = os.open('test', os.O_WRONLY|os.O_CREAT) os.write(fd, b'foo') os.close(fd) # Open and close the file to leave a pending deferred close fd = os....
```diff diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h index cfcc07905bdf..59f6fdfe560e 100644 --- a/fs/smb/client/cifsproto.h +++ b/fs/smb/client/cifsproto.h @@ -163,6 +163,8 @@ extern int cifs_get_writable_path(struct cifs_tcon *tcon, const char *name, extern struct cifsFileInfo *find_readable_fi...
a1d14d931bf700c1025db8c46d6731aa5cf440f9
Analyze and fix the following issue in the Linux kernel code: nfsd: decrease sc_count directly if fail to queue dl_recall
Problem Details: A deadlock warning occurred when invoking nfs4_put_stid following a failed dl_recall queue operation: T1 T2 nfs4_laundromat nfs4_get_client_reaplist nfs4_anylock_blo...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 2041268b398a..59a693f22452 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5430,7 +5430,7 @@ static void nfsd_break_one_deleg(struct nfs4_delegation *dp) queued = nfsd4_run_cb(&dp->dl_recall); WARN_ON_ONCE(!queued); if (!queued) -...
cd35b6cb46649750b7dbd0df0e2d767415d8917b
Analyze and fix the following issue in the Linux kernel code: nfs: add missing selections of CONFIG_CRC32
Problem Details: nfs.ko, nfsd.ko, and lockd.ko all use crc32_le(), which is available only when CONFIG_CRC32 is enabled. But the only NFS kconfig option that selected CONFIG_CRC32 was CONFIG_NFS_DEBUG, which is client-specific and did not actually guard the use of crc32_le() even on the client. The code worked around...
```diff diff --git a/fs/Kconfig b/fs/Kconfig index 64d420e3c475..8fd1011f7d62 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -368,6 +368,7 @@ config GRACE_PERIOD config LOCKD tristate depends on FILE_LOCKING + select CRC32 select GRACE_PERIOD config LOCKD_V4 diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig index d3f...
424eafe65647a8d6c690284536e711977153195a
Analyze and fix the following issue in the Linux kernel code: i2c: cros-ec-tunnel: defer probe if parent EC is not present
Problem Details: When i2c-cros-ec-tunnel and the EC driver are built-in, the EC parent device will not be found, leading to NULL pointer dereference. That can also be reproduced by unbinding the controller driver and then loading i2c-cros-ec-tunnel module (or binding the device). [ 271.991245] BUG: kernel NULL point...
```diff diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c index 43bf90d90eeb..208ce4f9e782 100644 --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c @@ -247,6 +247,9 @@ static int ec_i2c_probe(struct platform_device *pdev) u32 remot...
f33b01e0947d81c514bc8ff31ad28cae7ff6d91f
Analyze and fix the following issue in the Linux kernel code: ASoC: tas2764: Apply Apple quirks
Problem Details: Apple's SN012776 driver has some peculiar aspects to its behavior that are suspected to work around issues in the codec part. Add a module parameter for enabling individual quirks that should be imitated after the Apple driver. Setting some of these by default seems to be required. For example, settin...
```diff diff --git a/sound/soc/codecs/tas2764-quirks.h b/sound/soc/codecs/tas2764-quirks.h new file mode 100644 index 000000000000..7a62b3ba5b40 --- /dev/null +++ b/sound/soc/codecs/tas2764-quirks.h @@ -0,0 +1,180 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __TAS2764_QUIRKS__ +#define __TAS2764_QUIRKS__ + ...
dd50f0e38563f15819059c923bf142200453e003
Analyze and fix the following issue in the Linux kernel code: ASoC: tas2764: Enable main IRQs
Problem Details: IRQ handling was added in commit dae191fb957f ("ASoC: tas2764: Add IRQ handling") however that same commit masks all interrupts coming from the chip. Unmask the "main" interrupts so that we can see and deal with a number of errors including clock, voltage, and current. Fixes: dae191fb957f ("ASoC: tas2...
```diff diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c index 49b73b74b2d9..fbfe4d032df7 100644 --- a/sound/soc/codecs/tas2764.c +++ b/sound/soc/codecs/tas2764.c @@ -564,7 +564,7 @@ static int tas2764_codec_probe(struct snd_soc_component *component) regmap_reinit_cache(tas2764->regmap, &tas2764_i...
592ab3936b096da5deb64d4c906edbeb989174d6
Analyze and fix the following issue in the Linux kernel code: ASoC: tas2764: Reinit cache on part reset
Problem Details: When the part is reset in component_probe, do not forget to reinit the regcache, otherwise the cache can get out of sync with the part's actual state. This fix is similar to commit 0a0342ede303 ("ASoC: tas2770: Reinit regcache on reset") which concerned the tas2770 driver. Fixes: 827ed8a0fa50 ("ASoC: ...
```diff diff --git a/sound/soc/codecs/tas2764.c b/sound/soc/codecs/tas2764.c index 08aa7ee34256..49b73b74b2d9 100644 --- a/sound/soc/codecs/tas2764.c +++ b/sound/soc/codecs/tas2764.c @@ -546,6 +546,8 @@ static uint8_t sn012776_bop_presets[] = { 0x06, 0x3e, 0x37, 0x30, 0xff, 0xe6 }; +static const struct regmap_conf...
7699892ad3cf3a9afc8c63886344f6e2b73166e2
Analyze and fix the following issue in the Linux kernel code: ASoC: tas2770: Support setting the PDM TX slot
Problem Details: We don't actually support configuring the PDM input right now. Rather, this is useful as a hack. On Apple Silicon machines, amps are split between two I2S buses which are logically ANDed internally at the SoC. Odd and even slot groups are driven by amps on either bus respectively. Since the signals ar...
```diff diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c index 8de7e94d4ba4..55e472304404 100644 --- a/sound/soc/codecs/tas2770.c +++ b/sound/soc/codecs/tas2770.c @@ -240,6 +240,19 @@ static int tas2770_set_ivsense_transmit(struct tas2770_priv *tas2770, return 0; } +static int tas2770_set_pdm_t...
f529c91be8a34ac12e7599bf87c65b6f4a2c9f5c
Analyze and fix the following issue in the Linux kernel code: ASoC: tas2770: Power cycle amp on ISENSE/VSENSE change
Problem Details: The ISENSE/VSENSE blocks are only powered up when the amplifier transitions from shutdown to active. This means that if those controls are flipped on while the amplifier is already playing back audio, they will have no effect. Fix this by forcing a power cycle around transitions in those controls. Re...
```diff diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c index 7f219df8be70..8de7e94d4ba4 100644 --- a/sound/soc/codecs/tas2770.c +++ b/sound/soc/codecs/tas2770.c @@ -156,11 +156,37 @@ static const struct snd_kcontrol_new isense_switch = static const struct snd_kcontrol_new vsense_switch = SOC_DA...
9aff2e8df240e84a36f2607f98a0a9924a24e65d
Analyze and fix the following issue in the Linux kernel code: ASoC: soc-pcm: Fix hw_params() and DAPM widget sequence
Problem Details: Issue: When multiple audio streams share a common BE DAI, the BE DAI widget can be powered up before its hardware parameters are configured. This incorrect sequence leads to intermittent pcm_write errors. For example, the below Tegra use-case throws an error: aplay(2 streams) -> AMX(mux) -> ADX(...
```diff diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 4308a6cbb2e6..43835197d1fe 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1584,10 +1584,13 @@ int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, /* * Filter for systems with 'component_chaining' enabled. * This h...
a0b887f6eb9a0d1be3c57d00b0f3ba8408d3018a
Analyze and fix the following issue in the Linux kernel code: firmware: cs_dsp: tests: Depend on FW_CS_DSP rather then enabling it
Problem Details: FW_CS_DSP gets enabled if KUNIT is enabled. The test should rather depend on if the feature is enabled. Fix this by moving FW_CS_DSP to the depends on clause. Fixes: dd0b6b1f29b9 ("firmware: cs_dsp: Add KUnit testing of bin file download") Signed-off-by: Nico Pache <npache@redhat.com> Signed-off-by: R...
```diff diff --git a/drivers/firmware/cirrus/Kconfig b/drivers/firmware/cirrus/Kconfig index 0a883091259a..e3c2e38b746d 100644 --- a/drivers/firmware/cirrus/Kconfig +++ b/drivers/firmware/cirrus/Kconfig @@ -6,14 +6,11 @@ config FW_CS_DSP config FW_CS_DSP_KUNIT_TEST_UTILS tristate - depends on KUNIT && REGMAP - sel...
96014d91cffb335d3b396771524ff2aba3549865
Analyze and fix the following issue in the Linux kernel code: ASoC: cs-amp-lib-test: Don't select SND_SOC_CS_AMP_LIB
Problem Details: Depend on SND_SOC_CS_AMP_LIB instead of selecting it. KUNIT_ALL_TESTS should only build tests for components that are already being built, it should not cause other stuff to be added to the build. Fixes: 177862317a98 ("ASoC: cs-amp-lib: Add KUnit test for calibration helpers") Signed-off-by: Richard ...
```diff diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 40bb7a1d44bc..20f99cbee29b 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -776,10 +776,9 @@ config SND_SOC_CS_AMP_LIB tristate config SND_SOC_CS_AMP_LIB_TEST - tristate "KUnit test for Cirrus Logic cs-amp-lib" -...
345731a389fa145c76bedebec6e4f3db4cb29486
Analyze and fix the following issue in the Linux kernel code: bcachefs: fix bch2_dev_usage_full_read_fast()
Problem Details: One reference to bch_dev_usage wasn't updated, which meant we weren't reading the full bch_dev_usage_full - oops. Fixes: 955ba7b5ea03 ("bcachefs: bch_dev_usage_full") Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index fea61e60a9ee..4ef261e8db4f 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -37,7 +37,8 @@ void bch2_dev_usage_read_fast(struct bch_dev *ca, struct bch_dev_usage *usage) void bch2_dev_usage_full_read_fast(struct bch_dev *ca, stru...
806776ad9c20c6589f957212ef017e75760a08cd
Analyze and fix the following issue in the Linux kernel code: bcachefs: Add missing error handling
Problem Details: Reported-by: syzbot+d10151bf01574a09a915@syzkaller.appspotmail.com Signed-off-by: Alan Huang <mmpgouride@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index d2b07f602da9..606d684e6f23 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -1125,7 +1125,10 @@ int bch2_fs_initialize(struct bch_fs *c) * journal_res_get() will crash if called before this has * set up the journal.pin F...
d62922ba3cfc01dc42e853f90b93c525751e9383
Analyze and fix the following issue in the Linux kernel code: bcachefs: Prevent granting write refs when filesystem is read-only
Problem Details: Fix a shutdown WARNING in bch2_dev_free caused by active write I/O references (ca->io_ref[WRITE]) on a device being freed. The problem occurs when: - The filesystem is marked read-only (BCH_FS_rw clear in c->flags). - A subsequent operation (e.g., error handling for device removal) incorrectly tries...
```diff diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index b79e80a435e0..788e870bfef6 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -1757,7 +1757,8 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags) up_write(&c->state_lock); return 0; err: - if (ca->mi.state == BCH_ME...
d51faee4bd63b3b02fa6f56210ec0d84c5ccb680
Analyze and fix the following issue in the Linux kernel code: x86/percpu: Refer __percpu_prefix to __force_percpu_prefix
Problem Details: Refer __percpu_prefix to __force_percpu_prefix to avoid duplicate definition. While there, slightly reorder definitions to a more logical sequence, remove unneeded double quotes and move misplaced comment to the right place. No functional changes intended. Signed-off-by: Uros Bizjak <ubizjak@gmail.co...
```diff diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index 5fe314a2e73e..b0d03b6c279b 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h @@ -29,6 +29,8 @@ #ifdef CONFIG_SMP +#define __force_percpu_prefix "%%"__stringify(__percpu_seg)":" + #ifdef CONFIG_CC_...
94824ac9a8aaf2fb3c54b4bdde842db80ffa555d
Analyze and fix the following issue in the Linux kernel code: ext4: fix off-by-one error in do_split
Problem Details: Syzkaller detected a use-after-free issue in ext4_insert_dentry that was caused by out-of-bounds access due to incorrect splitting in do_split. BUG: KASAN: use-after-free in ext4_insert_dentry+0x36a/0x6d0 fs/ext4/namei.c:2109 Write of size 251 at addr ffff888074572f14 by task syz-executor335/5847 CPU...
```diff diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 43f96ef4aa01..dda1791e9e1a 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1971,7 +1971,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, * split it in half by count; each resulting block will have at least * half...
7e50bbb134aba1df0854f171b596b3a42d35605a
Analyze and fix the following issue in the Linux kernel code: ext4: avoid -Wflex-array-member-not-at-end warning
Problem Details: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of a flexible structure where the size of the flexible-array member is known at compile-time, and refactor the rest of the code, accor...
```diff diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 0d523e9fb3d5..f88424c28194 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3037,10 +3037,8 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) unsigned char blocksize_bits = min_t(unsigned char, sb->s_blocksize_bit...
ce7e8a65aa1b7e8a6833403b314fa8f2cf133119
Analyze and fix the following issue in the Linux kernel code: Documentation: ext4: Add fields to ext4_super_block documentation
Problem Details: Documentation and implementation of the ext4 super block have slightly diverged: Padding has been removed in order to make room for new fields that are still missing in the documentation. Add the new fields s_encryption_level, s_first_error_errorcode, s_last_error_errorcode to the documentation of the...
```diff diff --git a/Documentation/filesystems/ext4/super.rst b/Documentation/filesystems/ext4/super.rst index a1eb4a11a1d0..1b240661bfa3 100644 --- a/Documentation/filesystems/ext4/super.rst +++ b/Documentation/filesystems/ext4/super.rst @@ -328,9 +328,13 @@ The ext4 superblock is laid out as follows in - s_chec...
05872a167c2cab80ef186ef23cc34a6776a1a30c
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to do sanity check on sbi->total_valid_block_count
Problem Details: syzbot reported a f2fs bug as below: ------------[ cut here ]------------ kernel BUG at fs/f2fs/f2fs.h:2521! RIP: 0010:dec_valid_block_count+0x3b2/0x3c0 fs/f2fs/f2fs.h:2521 Call Trace: f2fs_truncate_data_blocks_range+0xc8c/0x11a0 fs/f2fs/file.c:695 truncate_dnode+0x417/0x740 fs/f2fs/node.c:973 trun...
```diff diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index ca884e39a5ff..c3d6456eaa76 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -2526,8 +2526,14 @@ static inline void dec_valid_block_count(struct f2fs_sb_info *sbi, blkcnt_t sectors = count << F2FS_LOG_SECTORS_PER_BLOCK; spin_lock(&sbi->stat_lock); - f2f...
aa00c6d5d05a80ef5946984025c25ab231b722f9
Analyze and fix the following issue in the Linux kernel code: f2fs: support to disable linear lookup fallback
Problem Details: After commit 91b587ba79e1 ("f2fs: Introduce linear search for dentries"), f2fs forced to use linear lookup whenever a hash-based lookup fails on casefolded directory, it may affect performance for scenarios: a) create a new file w/ filename it doesn't exist in directory, b) lookup a file which may be r...
```diff diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 5a63ff0df03b..a9f21bc1915d 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -366,7 +366,8 @@ start_find_entry: out: #if IS_ENABLED(CONFIG_UNICODE) - if (IS_CASEFOLDED(dir) && !de && use_hash) { + if (!sb_no_casefold_compat_fallback(dir->i_sb) && + IS_CASEFO...
d26fecb03e1f1069480d41fa2a6cea87ebbb89b8
Analyze and fix the following issue in the Linux kernel code: f2fs: prevent the current section from being selected as a victim during GC
Problem Details: When selecting a victim using next_victim_seg in a large section, the selected section might already have been cleared and designated as the new current section, making it actively in use. This behavior causes inconsistency between the SIT and SSA. F2FS-fs (dm-54): Inconsistent segment (70961) type [0...
```diff diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 5fcb1f92d506..503f6df690bf 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -486,6 +486,11 @@ static inline void __set_test_and_free(struct f2fs_sb_info *sbi, free_i->free_sections++; + if (GET_SEC_FROM_SEG(sbi, sbi->next_victim_seg[BG_GC])...
8d7861ac507d23024c7d74b6cb59a9cca248bcb7
Analyze and fix the following issue in the Linux kernel code: rv: Fix out-of-bound memory access in rv_is_container_monitor()
Problem Details: When rv_is_container_monitor() is called on the last monitor in rv_monitors_list, KASAN yells: BUG: KASAN: global-out-of-bounds in rv_is_container_monitor+0x101/0x110 Read of size 8 at addr ffffffff97c7c798 by task setup/221 The buggy address belongs to the variable: rv_monitors_list+0x18/0x...
```diff diff --git a/kernel/trace/rv/rv.c b/kernel/trace/rv/rv.c index 968c5c3b0246..e4077500a91d 100644 --- a/kernel/trace/rv/rv.c +++ b/kernel/trace/rv/rv.c @@ -225,7 +225,12 @@ bool rv_is_nested_monitor(struct rv_monitor_def *mdef) */ bool rv_is_container_monitor(struct rv_monitor_def *mdef) { - struct rv_monito...
485acd207d7daf8cf941a5f0fd0c09bc6d049402
Analyze and fix the following issue in the Linux kernel code: ftrace: Do not have print_graph_retval() add a newline
Problem Details: The retval and retaddr options for function_graph tracer will add a comment at the end of a function for both leaf and non leaf functions that looks like: __wake_up_common(); /* ret=0x1 */ } /* pick_next_task_fair ret=0x0 */ The function print_graph_retval() adds a newl...
```diff diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c index 2f077d4158e5..0c357a89c58e 100644 --- a/kernel/trace/trace_functions_graph.c +++ b/kernel/trace/trace_functions_graph.c @@ -880,8 +880,6 @@ static void print_graph_retval(struct trace_seq *s, struct ftrace_graph_ent_e...
05f1a939225ec895a97a6b2f1cf64e329b6474f5
Analyze and fix the following issue in the Linux kernel code: selinux: fix the kdoc header for task_avdcache_update
Problem Details: The kdoc header incorrectly references an older parameter, update it to reference what is currently used in the function. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202504122308.Ch8PzJdD-lkp@intel.com/ Signed-off-by: Paul Moore <paul@paul-moore.com>
```diff diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index edc9ae81e202..b8115df536ab 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -3160,7 +3160,7 @@ static inline int task_avdcache_search(struct task_security_struct *tsec, * task_avdcache_update - Update the task's AVD ...
4551383e78d59b34eea3f4ed28ad22df99e25d59
Analyze and fix the following issue in the Linux kernel code: iio: imu: st_lsm6dsx: Fix wakeup source leaks on device unbind
Problem Details: Device can be unbound, so driver must also release memory for the wakeup source. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20250406-b4-device-wakeup-leak-iio-v1-3-2d7d322a4a93@linaro.org Signed-off...
```diff diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c index 4fdcc2acc94e..96c6106b95ee 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c @@ -2719,8 +2719,11 @@ int st_lsm6dsx_probe(struct device *dev, i...
ad3764b45c1524872b621d5667a56f6a574501bd
Analyze and fix the following issue in the Linux kernel code: iio: adc: qcom-spmi-iadc: Fix wakeup source leaks on device unbind
Problem Details: Device can be unbound, so driver must also release memory for the wakeup source. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20250406-b4-device-wakeup-leak-iio-v1-2-2d7d322a4a93@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.c...
```diff diff --git a/drivers/iio/adc/qcom-spmi-iadc.c b/drivers/iio/adc/qcom-spmi-iadc.c index 7fb8b2499a1d..b64a8a407168 100644 --- a/drivers/iio/adc/qcom-spmi-iadc.c +++ b/drivers/iio/adc/qcom-spmi-iadc.c @@ -543,7 +543,9 @@ static int iadc_probe(struct platform_device *pdev) else return ret; } else { - dev...
0cd34d98dfd4f2b596415b8f12faf7b946613458
Analyze and fix the following issue in the Linux kernel code: iio: accel: fxls8962af: Fix wakeup source leaks on device unbind
Problem Details: Device can be unbound, so driver must also release memory for the wakeup source. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20250406-b4-device-wakeup-leak-iio-v1-1-2d7d322a4a93@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.c...
```diff diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c index 48e4282964a0..bf1d3923a181 100644 --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -1226,8 +1226,11 @@ int fxls8962af_core_probe(struct device *dev, struct regmap *regmap, int irq) ...
f5755c23ed8a4603194f6425828a2760f814e117
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: reset MLO global memory during recovery
Problem Details: When operating with multiple devices grouped together, the firmware stores data related to the state machine of each partner device in the MLO global memory region. If the firmware crashes, it updates the state to 'crashed'. During recovery, this memory is shared with the firmware again, and upon detec...
```diff diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c index 55db189d8234..9b23329f1bf2 100644 --- a/drivers/net/wireless/ath/ath12k/core.c +++ b/drivers/net/wireless/ath/ath12k/core.c @@ -1657,6 +1657,9 @@ static void ath12k_core_reset(struct work_struct *work) return; ...
718ead261feba32b00f8ef1d3dff7527106b9458
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix ath12k_core_pre_reconfigure_recovery() with grouping
Problem Details: Currently, ath12k_core_pre_reconfigure_recovery() reconfigures all radios within the same group. During grouping and driver going for a recovery, this function is called as many times as there are devices in the group. Consequently, it performs the same reconfiguration multiple times, which is unnecess...
```diff diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c index cb2a99d110d5..0fb3e57cd254 100644 --- a/drivers/net/wireless/ath/ath12k/core.c +++ b/drivers/net/wireless/ath/ath12k/core.c @@ -1411,6 +1411,18 @@ static void ath12k_core_pre_reconfigure_recovery(struct ath12k_bas...
1d55625bc2a1c2a8c68153b020e1e097ea27f1b0
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix firmware assert during reboot with hardware grouping
Problem Details: At present, during PCI shutdown, the power down is only executed for a single device. However, when operating in a group, all devices need to be powered down simultaneously. Failure to do so will result in a firmware assertion. Hence, introduce a new ath12k_pci_hw_group_power_down() and call it during...
```diff diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index 35576f3734d0..a8a17d6aa75e 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -1757,13 +1757,34 @@ qmi_fail: ath12k_core_free(ab); } +static void ath12k_pci_hw_gro...
6af396942bf132a1a49523e8fe2f816dc1ebd913
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix ATH12K_FLAG_REGISTERED flag handling
Problem Details: Commit a5686ae820fa ("wifi: ath12k: move ATH12K_FLAG_REGISTERED handling to ath12k_mac_register()") relocated the setting of the ATH12K_FLAG_REGISTERED flag to the ath12k_mac_register() function. However, this function only accesses the first device (ab) via ag->ab[0], resulting in the flag being set o...
```diff diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c index 8a571a615313..cb2a99d110d5 100644 --- a/drivers/net/wireless/ath/ath12k/core.c +++ b/drivers/net/wireless/ath/ath12k/core.c @@ -958,6 +958,9 @@ static void ath12k_core_hw_group_stop(struct ath12k_hw_group *ag) ...
dce7aec6b1f74b0a46b901ab8de1f7bd0515f733
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix failed to set mhi state error during reboot with hardware grouping
Problem Details: With hardware grouping, during reboot, whenever a device is removed, it powers down itself and all its partner devices in the same group. Now this is done by all devices and hence there is multiple power down for devices and hence the following error messages can be seen: ath12k_pci 0002:01:00.0: fail...
```diff diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index fcb9c40b227b..35576f3734d0 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -1487,6 +1487,9 @@ void ath12k_pci_power_down(struct ath12k_base *ab, bool is_suspend) { ...
62f3878fa290cb21535459311fe1dc008cd381da
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: add reference counting for core attachment to hardware group
Problem Details: Currently, driver does not manage reference counting for attaching and detaching cores to/from hardware groups. This can lead to issues when multiple cores are involved. Or with same core, attach/detach is called multiple times back to back. Fix this issue by using reference counting. With that, it i...
```diff diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c index 0e71935b2720..8a571a615313 100644 --- a/drivers/net/wireless/ath/ath12k/core.c +++ b/drivers/net/wireless/ath/ath12k/core.c @@ -640,9 +640,49 @@ struct reserved_mem *ath12k_core_get_reserved_mem(struct ath12k_base...
6d019abc402f58b25a7cab30b2d9af2f3173e4df
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix SLUB BUG - Object already free in ath12k_reg_free()
Problem Details: During rmmod of ath12k module with SLUB debug enabled, following print is seen - ============================================================================= BUG kmalloc-1k (Not tainted): Object already free ----------------------------------------------------------------------------- Allocated in a...
```diff diff --git a/drivers/net/wireless/ath/ath12k/reg.c b/drivers/net/wireless/ath/ath12k/reg.c index 893650f76fb2..3260df2ad600 100644 --- a/drivers/net/wireless/ath/ath12k/reg.c +++ b/drivers/net/wireless/ath/ath12k/reg.c @@ -817,8 +817,12 @@ void ath12k_reg_free(struct ath12k_base *ab) { int i; + mutex_lock(...
8c7a5031a6b0d42e640fbd2d5d05f61f74e32dce
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Fix buffer overflow in debugfs
Problem Details: If the user tries to write more than 32 bytes then it results in memory corruption. Fortunately, this is debugfs so it's limited to root users. Fixes: 3f73c24f28b3 ("wifi: ath12k: Add support to enable debugfs_htt_stats") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Vasanthaku...
```diff diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c index 1c0d5fa39a8d..aeaf970339d4 100644 --- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c +++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c @@ -5377,6 +5377,9 @@ static ssize_t ...
4703416d0fb993f7505025667f868f6981a5f7ab
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Fix a couple NULL vs IS_ERR() bugs
Problem Details: The devm_memremap() function returns error pointers on error and the ioremap() function returns NULL on error. The error checking here got those flipped around. Fixes: c01d5cc9b9fe ("wifi: ath12k: Power up userPD") Fixes: 6cee30f0da75 ("wifi: ath12k: add AHB driver support for IPQ5332") Signed-off-by...
```diff diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c index a9d9943a73f4..636dfe237a79 100644 --- a/drivers/net/wireless/ath/ath12k/ahb.c +++ b/drivers/net/wireless/ath/ath12k/ahb.c @@ -360,10 +360,10 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab) mem_phys = rme...
1a0e65750b55d2cf5de4a9bf7d6d55718784bdb7
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Fix WMI tag for EHT rate in peer assoc
Problem Details: Incorrect WMI tag is used for EHT rate update from host to firmware while encoding peer assoc WMI. Correct the WMI tag used for EHT rate update from WMI_TAG_HE_RATE_SET to the proper tag. This ensures firmware does not mistakenly update HE rate during parsing. Found during code review. Compile tested...
```diff diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index d0f3e27c87e3..ea303dca38b5 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -2372,7 +2372,7 @@ skip_ml_params: for (i = 0; i < arg->peer_eht_mcs_count; i++) { ...
d61c0b3c63462d17e63e5a2b4815e0f1ad17f57e
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Resolve multicast packet drop by populating key_cipher in ath12k_install_key()
Problem Details: Currently, the key_cipher in the ath12k_vif structure, which represents the group cipher of the MLD AP, is populated when the link address matches the ieee80211_vif address within ath12k_install_key(). However, in MLD AP, the link address and ieee80211_vif address can differ. Due to this key_cipher is...
```diff diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index eb0c461559b9..1bc8e81ad525 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4668,7 +4668,6 @@ static int ath12k_install_key(struct ath12k_link_vif *arvif, .macadd...
6177c97fb6f05bf0473a2806e3bece7e77693209
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: fix cleanup path after mhi init
Problem Details: Currently, the 'err_pci_msi_free' label is misplaced, causing the cleanup sequence to be incorrect. Fix this by moving the 'err_pci_msi_free' label to the correct position after 'err_irq_affinity_cleanup'. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00209-QCAHKSWPL_SILICONZ-1 Fixes: a3012f206d07 ("wi...
```diff diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index 7f1bb150f326..fcb9c40b227b 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -1706,12 +1706,12 @@ err_hal_srng_deinit: err_mhi_unregister: ath12k_mhi_unregister(ab_...
5e0097514dfb923d27a49bd8900a649d3a50dc4b
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Add support for link specific datapath stats
Problem Details: Add support to record the number of frames enqueued, hardware descriptor type, encapsulation/encryption types used, frames dropped and completed. This is useful for understanding the datapath performance and tune the peak throughput. The link specific stats can be viewed through the below debugfs file...
```diff diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index e8d2a0c859f6..ef5cf275b834 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -310,6 +310,8 @@ struct ath12k_link_vif { u8 link_id; struct ath12k_vif *ahvif; ...
bd00cc7e8a4c1048d14c9a9e9790c582119785fb
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: replace the usage of rx desc with rx_info
Problem Details: In ath12k_dp_rx_h_mpdu(), during the undecap to native wifi mode, the rx descriptor memory is overwritten. After this function call, any subsequent accesses to rx descriptor related memory yield invalid values. Fix this by replacing instances where rx_desc was used with the pre-cached information in rx...
```diff diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c index 6df04920a0c6..210fda4af5d0 100644 --- a/drivers/net/wireless/ath/ath12k/dp_mon.c +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c @@ -2080,6 +2080,7 @@ static void ath12k_dp_mon_rx_deliver_msdu(struct ath12k *ar...
e5566162af8b9690e096d2e6089e4ed955a0d13d
Analyze and fix the following issue in the Linux kernel code: net: phy: mediatek: permit to compile test GE SOC PHY driver
Problem Details: When commit 462a3daad679 ("net: phy: mediatek: fix compile-test dependencies") fixed the dependency, it should have also introduced an or on COMPILE_TEST to permit this driver to be compile-tested even if NVMEM_MTK_EFUSE wasn't selected. The driver makes use of NVMEM API that are always compiled (retur...
```diff diff --git a/drivers/net/phy/mediatek/Kconfig b/drivers/net/phy/mediatek/Kconfig index 2a8ac5aed0f8..6a4c2b328c41 100644 --- a/drivers/net/phy/mediatek/Kconfig +++ b/drivers/net/phy/mediatek/Kconfig @@ -15,8 +15,7 @@ config MEDIATEK_GE_PHY config MEDIATEK_GE_SOC_PHY tristate "MediaTek SoC Ethernet PHYs" - ...
e1d0b52d87ca68a92f2f8693b8eb475795a9a73f
Analyze and fix the following issue in the Linux kernel code: net: hibmcge: fix multiple phy_stop() issue
Problem Details: After detecting the np_link_fail exception, the driver attempts to fix the exception by using phy_stop() and phy_start() in the scheduled task. However, hbg_fix_np_link_fail() and .ndo_stop() may be concurrently executed. As a result, phy_stop() is executed twice, and the following Calltrace occurs: ...
```diff diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c index f29a937ad087..42b0083c9193 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_mdio.c @@ -2,6 +2,7 @@ // Copyright (c) 2024 Hisili...
ae6c1dce3244e31011ee65f89fc2484f3cf6cf85
Analyze and fix the following issue in the Linux kernel code: net: hibmcge: fix not restore rx pause mac addr after reset issue
Problem Details: The MAC hardware supports receiving two types of pause frames from link partner. One is a pause frame with a destination address of 01:80:C2:00:00:01. The other is a pause frame whose destination address is the address of the hibmcge driver. 01:80:C2:00:00:01 is supported by default. In .ndo_set_mac_...
```diff diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c index 4e8cb66f601c..a0bcfb5a713d 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_err.c @@ -26,12 +26,15 @@ static void hbg_restore_mac_t...
1d6c3e06232e5f53458842915bbff28e8fc29244
Analyze and fix the following issue in the Linux kernel code: net: hibmcge: fix the incorrect np_link fail state issue.
Problem Details: In the debugfs file, the driver displays the np_link fail state based on the HBG_NIC_STATE_NP_LINK_FAIL. However, HBG_NIC_STATE_NP_LINK_FAIL is cleared in hbg_service_task() So, this value of np_link fail is always false. This patch directly reads the related register to display the real state. Fixe...
```diff diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_debugfs.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_debugfs.c index 9c09e4835990..01ad82d2f5cc 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_debugfs.c @@ -106,6 +106,7 @@ static int hb...
4e4ac53335de54bcb9d26842df0998cfd8fcaf90
Analyze and fix the following issue in the Linux kernel code: net: hibmcge: fix wrong mtu log issue
Problem Details: A dbg log is generated when the driver modifies the MTU, which is expected to trace the change of the MTU. However, the log is recorded after WRITE_ONCE(). At this time, netdev->mtu has been changed to the new value. As a result, netdev->mtu is the same as new_mtu. This patch modifies the log locatio...
```diff diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c index e5c961ad4b9b..2e64dc1ab355 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c @@ -203,12 +203,12 @@ static int hbg_net_chan...
4ad3df755a96012f792c7fa2aa62317db3cba82b
Analyze and fix the following issue in the Linux kernel code: net: hibmcge: fix the share of irq statistics among different network ports issue
Problem Details: hbg_irqs is a global array which contains irq statistics. However, the irq statistics of different network ports point to the same global array. As a result, the statistics are incorrect. This patch allocates a statistics array for each network port to prevent the statistics of different network ports...
```diff diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h b/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h index f8cdab62bf85..7725cb0c5c8a 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h @@ -108,14 +108,16 @@ struct hbg_irq_...
9afaaa54e3eb9b64fc07c06741897800e98ac253
Analyze and fix the following issue in the Linux kernel code: net: hibmcge: fix incorrect multicast filtering issue
Problem Details: The driver does not support multicast filtering, the mask must be set to 0xFFFFFFFF. Otherwise, incorrect filtering occurs. This patch fixes this problem. Fixes: 37b367d60d0f ("net: hibmcge: Add unicast frame filter supported in this module") Signed-off-by: Jijie Shao <shaojijie@huawei.com> Reviewed-...
```diff diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c index 7d3bbd3e2adc..9b65eef62b3f 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c @@ -234,6 +234,10 @@ void hbg_hw_set_mac_filter_enabl...
5b04080cd6028f0737bbbd0c5b462d226cff9052
Analyze and fix the following issue in the Linux kernel code: net: hibmcge: fix incorrect pause frame statistics issue
Problem Details: The driver supports pause frames, but does not pass pause frames based on rx pause enable configuration, resulting in incorrect pause frame statistics. like this: mz eno3 '01 80 c2 00 00 01 00 18 2d 04 00 9c 88 08 00 01 ff ff' \ -p 64 -c 100 ethtool -S enp132s0f2 | grep -v ": 0" NIC statistics: ...
```diff diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c index 74a18033b444..7d3bbd3e2adc 100644 --- a/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c +++ b/drivers/net/ethernet/hisilicon/hibmcge/hbg_hw.c @@ -242,6 +242,9 @@ void hbg_hw_set_pause_enable(stru...
7f533cc5ee4c4436cee51dc58e81dfd9c3384418
Analyze and fix the following issue in the Linux kernel code: scsi: target: iscsi: Fix timeout on deleted connection
Problem Details: NOPIN response timer may expire on a deleted connection and crash with such logs: Did not receive response to NOPIN on CID: 0, failing connection for I_T Nexus (null),i,0x00023d000125,iqn.2017-01.com.iscsi.target,t,0x3d BUG: Kernel NULL pointer dereference on read at 0x00000000 NIP strlcpy+0x8/0xb0 ...
```diff diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 1244ef3aa86c..620ba6e0ab07 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -4263,8 +4263,8 @@ int iscsit_close_connection( spin_unlock(&iscsit_global->ts_bitmap_lock); ...
fc8a5ee50743516700d10a83c598b6adb3c2dbef
Analyze and fix the following issue in the Linux kernel code: scsi: pm80xx: Add __nonstring annotations for unterminated strings
Problem Details: When a character array without a terminating NUL character has a static initializer, GCC 15's -Wunterminated-string-initialization will only warn if the array lacks the "nonstring" attribute[1]. Mark the arrays with __nonstring to and correctly identify the char array as "not a C string" and thereby el...
```diff diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c index 85ff95c6543a..7618f9cc9986 100644 --- a/drivers/scsi/pm8001/pm8001_ctl.c +++ b/drivers/scsi/pm8001/pm8001_ctl.c @@ -644,7 +644,7 @@ static DEVICE_ATTR(gsm_log, S_IRUGO, pm8001_ctl_gsm_log_show, NULL); #define FLASH_CMD_SET_N...
f7a11cba0ed79d9d37941dddf69a8a655c8644bc
Analyze and fix the following issue in the Linux kernel code: bonding: hold ops lock around get_link
Problem Details: syzbot reports a case of ethtool_ops->get_link being called without ops lock: ethtool_op_get_link+0x15/0x60 net/ethtool/ioctl.c:63 bond_check_dev_link+0x1fb/0x4b0 drivers/net/bonding/bond_main.c:864 bond_miimon_inspect drivers/net/bonding/bond_main.c:2734 [inline] bond_mii_monitor+0x49d/0x3170 dri...
```diff diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 950d8e4d86f8..8ea183da8d53 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -850,8 +850,9 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_dev, int...
3b5091fee49ffcee512901318ca2425bb1e31a5c
Analyze and fix the following issue in the Linux kernel code: scsi: mpi3mr: Reset the pending interrupt flag
Problem Details: If an admin interrupt is missed, admin_pend_isr may stay set and trigger admin reply processing even when no admin I/Os are pending. Clearing/Resetting it in the admin completion path prevents this. Fixes: ca41929b2ed5 ("scsi: mpi3mr: Check admin reply queue from Watchdog") Cc: stable@vger.kernel.org...
```diff diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index d6e402aacb2a..003e1f7005c4 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -451,6 +451,7 @@ int mpi3mr_process_admin_reply_q(struct mpi3mr_ioc *mrioc) return 0; } + atomic_set(&mrioc...
cdd445258db9919e9dde497a6d5c3477ea7faf4d
Analyze and fix the following issue in the Linux kernel code: scsi: mpi3mr: Fix pending I/O counter
Problem Details: Commit 199510e33dea ("scsi: mpi3mr: Update consumer index of reply queues after every 100 replies") introduced a regression with the per-reply queue pending I/O counter which was erroneously decremented, leading to the counter going negative. Drop the incorrect atomic decrement for the pending I/O cou...
```diff diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 3fcb1ad3b070..d6e402aacb2a 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -565,7 +565,7 @@ int mpi3mr_process_op_reply_q(struct mpi3mr_ioc *mrioc, WRITE_ONCE(op_req_q->ci, le16_to_cpu(r...
52024cd6ec71a6ca934d0cc12452bd8d49850679
Analyze and fix the following issue in the Linux kernel code: net: mctp: Set SOCK_RCU_FREE
Problem Details: Bind lookup runs under RCU, so ensure that a socket doesn't go away in the middle of a lookup. Fixes: 833ef3b91de6 ("mctp: Populate socket implementation") Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Link: https://patch.msgid.link/20250410-mctp-rcu-sock-v1-1-872de9fdc877@codeconstruct.com...
```diff diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c index dd895617defd..9b12ca97f412 100644 --- a/net/mctp/af_mctp.c +++ b/net/mctp/af_mctp.c @@ -630,6 +630,9 @@ static int mctp_sk_hash(struct sock *sk) { struct net *net = sock_net(sk); + /* Bind lookup runs under RCU, remain live during that. */ + sock_s...
f3fdd4fba16c74697d8bc730b82fb7c1eff7fab3
Analyze and fix the following issue in the Linux kernel code: ethtool: cmis_cdb: use correct rpl size in ethtool_cmis_module_poll()
Problem Details: rpl is passed as a pointer to ethtool_cmis_module_poll(), so the correct size of rpl is sizeof(*rpl) which should be just 1 byte. Using the pointer size instead can cause stack corruption: Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: ethtool_cmis_wait_for_cond+0xf4/0x100...
```diff diff --git a/net/ethtool/cmis_cdb.c b/net/ethtool/cmis_cdb.c index 0e2691ccb0df..3057576bc81e 100644 --- a/net/ethtool/cmis_cdb.c +++ b/net/ethtool/cmis_cdb.c @@ -351,7 +351,7 @@ ethtool_cmis_module_poll(struct net_device *dev, struct netlink_ext_ack extack = {}; int err; - ethtool_cmis_page_init(&page_da...
4c324085062919d4e21c69e5e78456dcec0052fe
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: mcq: Add NULL check in ufshcd_mcq_abort()
Problem Details: A race can occur between the MCQ completion path and the abort handler: once a request completes, __blk_mq_free_request() sets rq->mq_hctx to NULL, meaning the subsequent ufshcd_mcq_req_to_hwq() call in ufshcd_mcq_abort() can return a NULL pointer. If this NULL pointer is dereferenced, the kernel will ...
```diff diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c index 240ce135bbfb..f1294c29f484 100644 --- a/drivers/ufs/core/ufs-mcq.c +++ b/drivers/ufs/core/ufs-mcq.c @@ -677,13 +677,6 @@ int ufshcd_mcq_abort(struct scsi_cmnd *cmd) unsigned long flags; int err; - if (!ufshcd_cmd_inflight(lrbp->cmd...
8b82f656826c741d032490b089a5638c33f2c91d
Analyze and fix the following issue in the Linux kernel code: pds_core: fix memory leak in pdsc_debugfs_add_qcq()
Problem Details: The memory allocated for intr_ctrl_regset, which is passed to debugfs_create_regset32() may not be cleaned up when the driver is removed. Fix that by using device managed allocation for it. Fixes: 45d76f492938 ("pds_core: set up device and adminq") Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> ...
```diff diff --git a/drivers/net/ethernet/amd/pds_core/debugfs.c b/drivers/net/ethernet/amd/pds_core/debugfs.c index ac37a4e738ae..04c5e3abd8d7 100644 --- a/drivers/net/ethernet/amd/pds_core/debugfs.c +++ b/drivers/net/ethernet/amd/pds_core/debugfs.c @@ -154,8 +154,9 @@ void pdsc_debugfs_add_qcq(struct pdsc *pdsc, stru...
b2e689baf220408aff8ee5dfb4edb0817e1632bb
Analyze and fix the following issue in the Linux kernel code: crypto: ahash - Disable request chaining
Problem Details: Disable hash request chaining in case a driver that copies an ahash_request object by hand accidentally triggers chaining. Reported-by: Manorit Chawdhry <m-chawdhry@ti.com> Fixes: f2ffe5a9183d ("crypto: hash - Add request chaining API") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Tested-by...
```diff diff --git a/crypto/ahash.c b/crypto/ahash.c index 9f57b925b116..2d9eec2b2b1c 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -315,16 +315,7 @@ EXPORT_SYMBOL_GPL(crypto_ahash_setkey); static bool ahash_request_hasvirt(struct ahash_request *req) { - struct ahash_request *r2; - - if (ahash_request_isvirt(...
9ae0c92fec69374c6db8dddb0df00d86b9afa5da
Analyze and fix the following issue in the Linux kernel code: crypto: scomp - Fix wild memory accesses in scomp_free_streams
Problem Details: In order to use scomp_free_streams to free the partially allocted streams in the allocation error path, move the alg->stream assignment to the beginning. Also check for error pointers in scomp_free_streams before freeing the ctx. Finally set alg->stream to NULL to not break subsequent attempts to all...
```diff diff --git a/crypto/scompress.c b/crypto/scompress.c index f67ce38d203d..5762fcc63b51 100644 --- a/crypto/scompress.c +++ b/crypto/scompress.c @@ -111,13 +111,14 @@ static void scomp_free_streams(struct scomp_alg *alg) struct crypto_acomp_stream __percpu *stream = alg->stream; int i; + alg->stream = NULL;...
ae82eaf4aeea060bb736c3e20c0568b67c701d7d
Analyze and fix the following issue in the Linux kernel code: scsi: lpfc: Use memcpy() for BIOS version
Problem Details: The strlcat() with FORTIFY support is triggering a panic because it thinks the target buffer will overflow although the correct target buffer size is passed in. Anyway, instead of memset() with 0 followed by a strlcat(), just use memcpy() and ensure that the resulting buffer is NULL terminated. BIOSV...
```diff diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 6574f9e74476..a335d34070d3 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -6003,9 +6003,9 @@ lpfc_sli4_get_ctl_attr(struct lpfc_hba *phba) phba->sli4_hba.flash_id = bf_get(lpfc_cntl_attr_flash_id, c...
3c7ac40d732232fec0ba31d0a5e3cc9c112fc2e7
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Delegate the interrupt service routine to a threaded IRQ handler
Problem Details: On systems with a large number request slots and unavailable MCQ ESI, the current design of the interrupt handler can delay handling of other subsystems interrupts causing display artifacts, GPU stalls or system firmware requests timeouts. Since the interrupt routine can take quite some time, it's pre...
```diff diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 7f256f77b8ba..b40660ca2fa6 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -6971,7 +6971,7 @@ static irqreturn_t ufshcd_sl_intr(struct ufs_hba *hba, u32 intr_status) } /** - * ufshcd_intr - Main interrupt serv...