id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
390513642ee6763c7ada07f0a1470474986e6c1c
Analyze and fix the following issue in the Linux kernel code: io_uring: always do atomic put from iowq
Problem Details: io_uring always switches requests to atomic refcounting for iowq execution before there is any parallilism by setting REQ_F_REFCOUNT, and the flag is not cleared until the request completes. That should be fine as long as the compiler doesn't make up a non existing value for the flags, however KCSAN st...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index a4065e3d13d0..c6209fe44cb1 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1796,7 +1796,7 @@ struct io_wq_work *io_wq_free_work(struct io_wq_work *work) struct io_kiocb *req = container_of(work, struct io_kiocb, work); struct io_kio...
5dff41a86377563f7a2b968aae00d25b4ceb37c9
Analyze and fix the following issue in the Linux kernel code: jfs: fix array-index-out-of-bounds read in add_missing_indices
Problem Details: stbl is s8 but it must contain offsets into slot which can go from 0 to 127. Added a bound check for that error and return -EIO if the check fails. Also make jfs_readdir return with error if add_missing_indices returns with an error. Reported-by: syzbot+b974bd41515f770c608b@syzkaller.appspotmail.com ...
```diff diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c index 93db6eec4465..ab11849cf9cc 100644 --- a/fs/jfs/jfs_dtree.c +++ b/fs/jfs/jfs_dtree.c @@ -2613,7 +2613,7 @@ void dtInitRoot(tid_t tid, struct inode *ip, u32 idotdot) * fsck.jfs should really fix this, but it currently does not. * Called from...
a4685408ff6c3e2af366ad9a7274f45ff3f394ee
Analyze and fix the following issue in the Linux kernel code: jfs: Fix null-ptr-deref in jfs_ioc_trim
Problem Details: [ Syzkaller Report ] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000087: 0000 [#1 KASAN: null-ptr-deref in range [0x0000000000000438-0x000000000000043f] CPU: 2 UID: 0 PID: 10614 Comm: syz-executor.0 Not tainted 6.13.0-rc6-gfbfd64d25c7a-dirty #1 Hardware name: QEMU St...
```diff diff --git a/fs/jfs/jfs_discard.c b/fs/jfs/jfs_discard.c index 5f4b305030ad..4b660296caf3 100644 --- a/fs/jfs/jfs_discard.c +++ b/fs/jfs/jfs_discard.c @@ -86,7 +86,8 @@ int jfs_ioc_trim(struct inode *ip, struct fstrim_range *range) down_read(&sb->s_umount); bmp = JFS_SBI(ip->i_sb)->bmap; - if (minlen > bm...
37bfb464ddca87f203071b5bd562cd91ddc0b40a
Analyze and fix the following issue in the Linux kernel code: jfs: validate AG parameters in dbMount() to prevent crashes
Problem Details: Validate db_agheight, db_agwidth, and db_agstart in dbMount to catch corrupted metadata early and avoid undefined behavior in dbAllocAG. Limits are derived from L2LPERCTL, LPERCTL/MAXAG, and CTLTREESIZE: - agheight: 0 to L2LPERCTL/2 (0 to 5) ensures shift (L2LPERCTL - 2*agheight) >= 0. - agwidth: 1 ...
```diff diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index 26e89d0c69b6..35e063c9f3a4 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -194,7 +194,11 @@ int dbMount(struct inode *ipbmap) !bmp->db_numag || (bmp->db_numag > MAXAG) || (bmp->db_maxag >= MAXAG) || (bmp->db_maxag < 0) || (bmp...
a2d5a0072235a69749ceb04c1a26dc75df66a31a
Analyze and fix the following issue in the Linux kernel code: scsi: smartpqi: Use is_kdump_kernel() to check for kdump
Problem Details: The smartpqi driver checks the reset_devices variable to determine whether special adjustments need to be made for kdump. This has the effect that after a regular kexec reboot, some driver parameters such as max_transfer_size are much lower than usual. More importantly, kexec reboot tests have revealed...
```diff diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 0da7be40c925..e790b5d4e3c7 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -19,6 +19,7 @@ #include <linux/bcd.h> #include <linux/reboot.h> #include <linux/cciss_i...
aea007741b951df05f901b2d4890df2e710d134b
Analyze and fix the following issue in the Linux kernel code: drm/dp_mst: Fix GUID DPCD write to non-root MST branch devices
Problem Details: The return value on success of drm_dp_send_dpcd_write() called for non-root MST branch devices from drm_dp_check_mstb_guid() is the number of bytes transferred. Atm this return value (in case of a complete read) will be regarded incorrectly as an error by the caller of drm_dp_check_mstb_guid(). Fix thi...
```diff diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index e8716e73480b..8c312c1f1724 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -2200,6 +2200,8 @@ static int drm_dp_check_mstb_guid(struc...
cd4c0025069f16fc666c6ffc56c49c9b1154841f
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: exynos: gs101: Put UFS device in reset on .suspend()
Problem Details: GPIO_OUT[0] is connected to the reset pin of embedded UFS device. Before powering off the phy assert the reset signal. This is added as a gs101 specific suspend hook so as not to have any unintended consequences for other SoCs supported by this driver. Signed-off-by: Peter Griffin <peter.griffin@lina...
```diff diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index b9fbc78be74e..2436b9454480 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -1700,6 +1700,12 @@ static void exynos_ufs_hibern8_notify(struct ufs_hba *hba, } } +static int gs101_ufs_suspend(stru...
67e4085015c33bf2fb552af1f171c58b81ef0616
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: exynos: Move phy calls to .exit() callback
Problem Details: ufshcd_pltfrm_remove() calls ufshcd_remove(hba) which in turn calls ufshcd_hba_exit(). By moving the phy_power_off() and phy_exit() calls to the newly created .exit callback they get called by ufshcd_variant_hba_exit() before ufshcd_hba_exit() turns off the regulators. This is also similar flow to the...
```diff diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index ac71b878d872..b9fbc78be74e 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -1522,6 +1522,14 @@ out: return ret; } +static void exynos_ufs_exit(struct ufs_hba *hba) +{ + struct exynos_ufs *ufs ...
deac9ad496ec17e1ec06848964ecc635bdaca703
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: exynos: Enable PRDT pre-fetching with UFSHCD_CAP_CRYPTO
Problem Details: PRDT_PREFETCH_ENABLE[31] bit should be set when desctype field of fmpsecurity0 register is type2 (double file encryption) or type3 (support for file and disk encryption). Setting this bit enables PRDT pre-fetching on both TXPRDT and RXPRDT. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Link:...
```diff diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index e77b3c63e698..ac71b878d872 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -34,7 +34,7 @@ * Exynos's Vendor specific registers for UFSHCI */ #define HCI_TXPRDT_ENTRY_SIZE 0x00 -#define PRDT_PR...
7f05fd9a3b6fb3a9abc5a748307d11831c03175f
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: exynos: Ensure consistent phy reference counts
Problem Details: ufshcd_link_startup() can call ufshcd_vops_link_startup_notify() multiple times when retrying. This causes the phy reference count to keep increasing and the phy to not properly re-initialize. If the phy has already been previously powered on, first issue a phy_power_off() and phy_exit(), before re-in...
```diff diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 533904a4c1a7..e77b3c63e698 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -962,6 +962,12 @@ static int exynos_ufs_phy_init(struct exynos_ufs *ufs) } phy_set_bus_width(generic_phy, ufs->avail...
f92bb7436802f8eb7ee72dc911a33c8897fde366
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: exynos: Disable iocc if dma-coherent property isn't set
Problem Details: If dma-coherent property isn't set then descriptors are non-cacheable and the iocc shareability bits should be disabled. Without this UFS can end up in an incompatible configuration and suffer from random cache related stability issues. Suggested-by: Bart Van Assche <bvanassche@acm.org> Fixes: cc52e15...
```diff diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 1d4603f7622d..533904a4c1a7 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -214,8 +214,8 @@ static int exynos_ufs_shareability(struct exynos_ufs *ufs) /* IO Coherency setting */ if (ufs->sysreg...
68f5ef7eebf0f41df4d38ea55a54c2462af1e3d6
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: exynos: Move UFS shareability value to drvdata
Problem Details: gs101 I/O coherency shareability bits differ from exynosauto SoC. To support both SoCs move this info the SoC drvdata. Currently both the value and mask are the same for both gs101 and exynosauto, thus we use the same value. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Link: https://lore.k...
```diff diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index cd750786187c..1d4603f7622d 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -92,11 +92,16 @@ UIC_TRANSPORT_NO_CONNECTION_RX |\ UIC_TRANSPORT_BAD_TC) -/* FSYS UFS Shareability */ -#defi...
3d101165e72316775947d71321d97194f03dfef3
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: exynos: Ensure pre_link() executes before exynos_ufs_phy_init()
Problem Details: Ensure clocks are enabled before configuring unipro. Additionally move the pre_link() hook before the exynos_ufs_phy_init() calls. This means the register write sequence more closely resembles the ordering of the downstream driver. Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Link: https://...
```diff diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 13dd5dfc03eb..cd750786187c 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -1049,9 +1049,14 @@ static int exynos_ufs_pre_link(struct ufs_hba *hba) exynos_ufs_config_intr(ufs, DFES_DEF_L4_ERRS, UN...
72eea84a1092b50a10eeecfeba4b28ac9f1312ab
Analyze and fix the following issue in the Linux kernel code: scsi: iscsi: Fix missing scsi_host_put() in error path
Problem Details: Add goto to ensure scsi_host_put() is called in all error paths of iscsi_set_host_param() function. This fixes a potential memory leak when strlen() check fails. Fixes: ce51c8170084 ("scsi: iscsi: Add strlen() check in iscsi_if_set{_host}_param()") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link...
```diff diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 9c347c64c315..0b8c91bf793f 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -3182,11 +3182,14 @@ iscsi_set_host_param(struct iscsi_transport *transport, } /* see simila...
1b755d8eb1ace3870789d48fbd94f386ad6e30be
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_tunnel: fix geneve_opt type confusion addition
Problem Details: When handling multiple NFTA_TUNNEL_KEY_OPTS_GENEVE attributes, the parsing logic should place every geneve_opt structure one by one compactly. Hence, when deciding the next geneve_opt position, the pointer addition should be in units of char *. However, the current implementation erroneously does type...
```diff diff --git a/net/netfilter/nft_tunnel.c b/net/netfilter/nft_tunnel.c index 681301b46aa4..2e40f575aed9 100644 --- a/net/netfilter/nft_tunnel.c +++ b/net/netfilter/nft_tunnel.c @@ -341,7 +341,7 @@ static const struct nla_policy nft_tunnel_opts_geneve_policy[NFTA_TUNNEL_KEY_GEN static int nft_tunnel_obj_geneve_in...
3a0a3ff6593d670af2451ec363ccb7b18aec0c0a
Analyze and fix the following issue in the Linux kernel code: net: decrease cached dst counters in dst_release
Problem Details: Upstream fix ac888d58869b ("net: do not delay dst_entries_add() in dst_release()") moved decrementing the dst count from dst_destroy to dst_release to avoid accessing already freed data in case of netns dismantle. However in case CONFIG_DST_CACHE is enabled and OvS+tunnels are used, this fix is incompl...
```diff diff --git a/net/core/dst.c b/net/core/dst.c index c99b95cf9cbb..795ca07e28a4 100644 --- a/net/core/dst.c +++ b/net/core/dst.c @@ -165,6 +165,14 @@ static void dst_count_dec(struct dst_entry *dst) void dst_release(struct dst_entry *dst) { if (dst && rcuref_put(&dst->__rcuref)) { +#ifdef CONFIG_DST_CACHE + ...
12e0b15b1986736af8c64b920efad00c655a3c79
Analyze and fix the following issue in the Linux kernel code: crypto: inside-secure/eip93 - acquire lock on eip93_put_descriptor hash
Problem Details: In the EIP93 HASH functions, the eip93_put_descriptor is called without acquiring lock. This is problematic when multiple thread execute hash operations. Correctly acquire ring write lock on calling eip93_put_descriptor to prevent concurrent access and mess with the ring pointers. Fixes: 9739f5f93b78...
```diff diff --git a/drivers/crypto/inside-secure/eip93/eip93-hash.c b/drivers/crypto/inside-secure/eip93/eip93-hash.c index 5e9627467a42..df1b05ac5a57 100644 --- a/drivers/crypto/inside-secure/eip93/eip93-hash.c +++ b/drivers/crypto/inside-secure/eip93/eip93-hash.c @@ -260,7 +260,8 @@ static int eip93_send_hash_req(st...
32cb8dc550e469facfe54e8fa3b5d8d01448d5df
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix xe_pt_stage_bind_walk kerneldoc
Problem Details: The structure was missing a proper kerneldoc header and once that was added a number of typos and errors became obvious. Fix those. Reported-by: Lucas De Marchi <lucas.demarchi@intel.com> Closes: https://lore.kernel.org/intel-xe/x53tcs5bjldw6lcorjemuheklxcmepdvr2u7lvt3hpqrzqoc4h@nsu6hs25taqj/ Fixes: b...
```diff diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c index 82ae159feed1..33839b25d708 100644 --- a/drivers/gpu/drm/xe/xe_pt.c +++ b/drivers/gpu/drm/xe/xe_pt.c @@ -269,8 +269,11 @@ struct xe_pt_update { bool preexisting; }; +/** + * struct xe_pt_stage_bind_walk - Walk state for the stage_bin...
26fbdf36922711f285fd185ad644f0acdf15959f
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Don't translate FAR if invalid/unsafe
Problem Details: Don't re-walk the page tables if an SEA occurred during the faulting page table walk to avoid taking a fatal exception in the hyp. Additionally, check that FAR_EL2 is valid for SEAs not taken on PTW as the architecture doesn't guarantee it contains the fault VA. Finally, fix up the rest of the abort p...
```diff diff --git a/arch/arm64/include/asm/esr.h b/arch/arm64/include/asm/esr.h index 92fb26e90840..e4f77757937e 100644 --- a/arch/arm64/include/asm/esr.h +++ b/arch/arm64/include/asm/esr.h @@ -482,6 +482,28 @@ static inline bool esr_fsc_is_addr_sz_fault(unsigned long esr) (esr == ESR_ELx_FSC_ADDRSZ_L(-1)); ...
fb8a3eba9c812b67f9cf5531e5b55d13a51e938e
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Only read HPFAR_EL2 when value is architecturally valid
Problem Details: KVM's logic for deciding when HPFAR_EL2 is UNKNOWN doesn't align with the architecture. Most notably, KVM assumes HPFAR_EL2 contains the faulting IPA even in the case of an SEA. Align the logic with the architecture rather than attempting to paraphrase it. Additionally, take the opportunity to improve...
```diff diff --git a/arch/arm64/include/asm/esr.h b/arch/arm64/include/asm/esr.h index d1b1a33f9a8b..92fb26e90840 100644 --- a/arch/arm64/include/asm/esr.h +++ b/arch/arm64/include/asm/esr.h @@ -121,6 +121,15 @@ #define ESR_ELx_FSC_SEA_TTW(n) (0x14 + (n)) #define ESR_ELx_FSC_SECC (0x18) #define ESR_ELx_FSC_SECC_TTW(...
3f8ad18f81841a9ce70f603c45d5a278528c67e6
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix verifier_private_stack test failure
Problem Details: Several verifier_private_stack tests failed with latest bpf-next. For example, for 'Private stack, single prog' subtest, the jitted code: func #0: 0: f3 0f 1e fa endbr64 4: 0f 1f 44 00 00 nopl (%rax,%rax) 9: 0f 1f 00 ...
```diff diff --git a/tools/testing/selftests/bpf/progs/verifier_private_stack.c b/tools/testing/selftests/bpf/progs/verifier_private_stack.c index b1fbdf119553..fc91b414364e 100644 --- a/tools/testing/selftests/bpf/progs/verifier_private_stack.c +++ b/tools/testing/selftests/bpf/progs/verifier_private_stack.c @@ -27,7 ...
14d84357a0af7783a440d4a40794752ed20d2607
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix verifier_bpf_fastcall test
Problem Details: Commit [1] moves percpu data on x86 from address 0x000... to address 0xfff... Before [1]: 159020: 0000000000030700 0 OBJECT GLOBAL DEFAULT 23 pcpu_hot After [1]: 152602: ffffffff83a3e034 4 OBJECT GLOBAL DEFAULT 35 pcpu_hot As a result, verifier_bpf_fastcall tests should now expect a ...
```diff diff --git a/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c b/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c index a9be6ae49454..c258b0722e04 100644 --- a/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c +++ b/tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c @@ -12,7 +12,...
00387808d36e23c7d56e9e04a31de0be1443b0e9
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix tests after fields reorder in struct file
Problem Details: The change in struct file [1] moved f_ref to the 3rd cache line. It made *(u64 *)file dereference invalid from the verifier point of view, because btf_struct_walk() walks into f_lock field, which is 4-byte long. Fix the selftests to deference the file pointer as a 4-byte access. [1] commit e249056c91...
```diff diff --git a/tools/testing/selftests/bpf/progs/test_module_attach.c b/tools/testing/selftests/bpf/progs/test_module_attach.c index fb07f5773888..7f3c233943b3 100644 --- a/tools/testing/selftests/bpf/progs/test_module_attach.c +++ b/tools/testing/selftests/bpf/progs/test_module_attach.c @@ -117,7 +117,7 @@ int B...
5d0b204654de25615cf712be86c3192eca68ed80
Analyze and fix the following issue in the Linux kernel code: xsk: Fix __xsk_generic_xmit() error code when cq is full
Problem Details: When the cq reservation is failed, the error code is not set which is initialized to zero in __xsk_generic_xmit(). That means the packet is not send successfully but sendto() return ok. Considering the impact on uapi, return -EAGAIN is a good idea. The cq is full usually because it is not released in ...
```diff diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index e5d104ce7b82..5696af45bcf7 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -806,8 +806,11 @@ static int __xsk_generic_xmit(struct sock *sk) * if there is space in it. This avoids having to implement * any buffering in the Tx path. */ - if (xsk_cq_r...
4210030d8bc4834fcb774babc458d02a2432ee76
Analyze and fix the following issue in the Linux kernel code: docs: fs/9p: Add missing "not" in cache documentation
Problem Details: A quick fix for what I assume is a typo. Signed-off-by: Tingmao Wang <m@maowtm.org> Reviewed-by: Christian Schoenebeck <linux_oss@crudebyte.com> Message-ID: <20250330213443.98434-1-m@maowtm.org> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
```diff diff --git a/Documentation/filesystems/9p.rst b/Documentation/filesystems/9p.rst index 28871200e87c..522295857f7b 100644 --- a/Documentation/filesystems/9p.rst +++ b/Documentation/filesystems/9p.rst @@ -165,8 +165,8 @@ Options do not necessarily validate cached values on the server. In other words change...
8930424777e43257f5bf6f0f0f53defd0d30415c
Analyze and fix the following issue in the Linux kernel code: tunnels: Accept PACKET_HOST in skb_tunnel_check_pmtu().
Problem Details: Because skb_tunnel_check_pmtu() doesn't handle PACKET_HOST packets, commit 30a92c9e3d6b ("openvswitch: Set the skbuff pkt_type for proper pmtud support.") forced skb->pkt_type to PACKET_OUTGOING for openvswitch packets that are sent using the OVS_ACTION_ATTR_OUTPUT action. This allowed such packets to ...
```diff diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index a3676155be78..364ea798511e 100644 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c @@ -416,7 +416,7 @@ int skb_tunnel_check_pmtu(struct sk_buff *skb, struct dst_entry *encap_dst, skb_dst_update_pmtu_no_confirm(skb, mtu);...
fccd2b711d9628c7ce0111d5e4938652101ee30a
Analyze and fix the following issue in the Linux kernel code: vsock: avoid timeout during connect() if the socket is closing
Problem Details: When a peer attempts to establish a connection, vsock_connect() contains a loop that waits for the state to be TCP_ESTABLISHED. However, the other peer can be fast enough to accept the connection and close it immediately, thus moving the state to TCP_CLOSING. When this happens, the peer in the vsock_c...
```diff diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 7e3db87ae433..fc6afbc8d680 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1551,7 +1551,11 @@ static int vsock_connect(struct socket *sock, struct sockaddr *addr, timeout = vsk->connect_timeout; prepare_to_wait(s...
df207de9d9e7a4d92f8567e2c539d9c8c12fd99d
Analyze and fix the following issue in the Linux kernel code: udp: Fix memory accounting leak.
Problem Details: Matt Dowling reported a weird UDP memory usage issue. Under normal operation, the UDP memory usage reported in /proc/net/sockstat remains close to zero. However, it occasionally spiked to 524,288 pages and never dropped. Moreover, the value doubled when the application was terminated. Finally, it c...
```diff diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 354779b22faf..2742cc7602bb 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1625,12 +1625,12 @@ static bool udp_skb_has_head_state(struct sk_buff *skb) } /* fully reclaim rmem/fwd memory allocated for skb */ -static void udp_rmem_release(struct sock *sk...
5a465a0da13ee9fbd7d3cd0b2893309b0fe4b7e3
Analyze and fix the following issue in the Linux kernel code: udp: Fix multiple wraparounds of sk->sk_rmem_alloc.
Problem Details: __udp_enqueue_schedule_skb() has the following condition: if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf) goto drop; sk->sk_rcvbuf is initialised by net.core.rmem_default and later can be configured by SO_RCVBUF, which is limited by net.core.rmem_max, or SO_RCVBUFFORCE. If we set IN...
```diff diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index d0bffcfa56d8..354779b22faf 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1725,17 +1725,25 @@ static int udp_rmem_schedule(struct sock *sk, int size) int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb) { struct sk_buff_head *list = &s...
1b7fdc702c031134c619b74c4f311c590e50ca3d
Analyze and fix the following issue in the Linux kernel code: rtnetlink: Use register_pernet_subsys() in rtnl_net_debug_init().
Problem Details: rtnl_net_debug_init() registers rtnl_net_debug_net_ops by register_pernet_device() but calls unregister_pernet_subsys() in case register_netdevice_notifier() fails. It corrupts pernet_list because first_device is updated in register_pernet_device() but not unregister_pernet_subsys(). Let's fix it by ...
```diff diff --git a/net/core/rtnl_net_debug.c b/net/core/rtnl_net_debug.c index 7ecd28cc1c22..f3272b09c255 100644 --- a/net/core/rtnl_net_debug.c +++ b/net/core/rtnl_net_debug.c @@ -102,7 +102,7 @@ static int __init rtnl_net_debug_init(void) { int ret; - ret = register_pernet_device(&rtnl_net_debug_net_ops); + re...
ca9e5d3d9a4d7d30355aa68bb30dc6f850f067ab
Analyze and fix the following issue in the Linux kernel code: selftests: tc-testing: fix nat regex matching
Problem Details: In iproute 6.14, the nat ip mask logic was fixed to remove an undefined behaviour[1]. So now instead of reporting '0.0.0.0/32' on x86 and potentially '0.0.0.0/0' in other platforms, it reports '0.0.0.0/0' in all platforms. [1] https://lore.kernel.org/netdev/20250306112520.188728-1-torben.nielsen@preva...
```diff diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json b/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json index ee2792998c89..4f21aeb8a3fb 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/nat.json @...
96844075226b49af25a69a1d084b648ec2d9b08d
Analyze and fix the following issue in the Linux kernel code: net: mvpp2: Prevent parser TCAM memory corruption
Problem Details: Protect the parser TCAM/SRAM memory, and the cached (shadow) SRAM information, from concurrent modifications. Both the TCAM and SRAM tables are indirectly accessed by configuring an index register that selects the row to read or write to. This means that operations must be atomic in order to, e.g., av...
```diff diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h index 44fe9b68d1c2..061fcd444d50 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h @@ -1113,6 +1113,9 @@ struct mvpp2 { /* Spinlocks for CM3 shared memo...
d3210dabda8dd0477f3a6301dcaf9ed44aeccd3c
Analyze and fix the following issue in the Linux kernel code: eth: mlx4: select PAGE_POOL
Problem Details: With commit 8533b14b3d65 ("eth: mlx4: create a page pool for Rx") mlx4 started using functions guarded by PAGE_POOL. This change introduced build errors when CONFIG_MLX4_EN is set but CONFIG_PAGE_POOL is not: ld: vmlinux.o: in function `mlx4_en_alloc_frags': en_rx.c:(.text+0xa5eaf9): undefined ref...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx4/Kconfig b/drivers/net/ethernet/mellanox/mlx4/Kconfig index 825e05fb8607..0b1cb340206f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/Kconfig +++ b/drivers/net/ethernet/mellanox/mlx4/Kconfig @@ -7,6 +7,7 @@ config MLX4_EN tristate "Mellanox Technologies 1/10/40G...
d996e412b2dfc079bd44bff5b3bc743fdb6d7c90
Analyze and fix the following issue in the Linux kernel code: bpf: add missing ops lock around dev_xdp_attach_link
Problem Details: Syzkaller points out that create_link path doesn't grab ops lock, add it. Reported-by: syzbot+08936936fe8132f91f1a@syzkaller.appspotmail.com Closes: https://lore.kernel.org/bpf/67e6b3e8.050a0220.2f068f.0079.GAE@google.com/ Fixes: 97246d6d21c2 ("net: hold netdev instance lock during ndo_bpf") Signed-of...
```diff diff --git a/net/core/dev.c b/net/core/dev.c index be17e0660144..5d20ff226d5e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -10284,7 +10284,9 @@ int bpf_xdp_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) goto unlock; } + netdev_lock_ops(dev); err = dev_xdp_attach_link(dev, &extack...
367579274f60cb23c570ae5348966ab51e1509a4
Analyze and fix the following issue in the Linux kernel code: net: airoha: Fix ETS priomap validation
Problem Details: ETS Qdisc schedules SP bands in a priority order assigning band-0 the highest priority (band-0 > band-1 > .. > band-n) while EN7581 arranges SP bands in a priority order assigning band-7 the highest priority (band-7 > band-6, .. > band-n). Fix priomap check in airoha_qdma_set_tx_ets_sched routine in or...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index 20a96cafc748..69e523dd4186 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -2028,7 +2028,7 @@ static int airoha_qdma_set_tx_ets_sched(struct airoha_gdm_p...
57b290d97c6150774bf929117ca737a26d8fc33d
Analyze and fix the following issue in the Linux kernel code: net: airoha: Fix qid report in airoha_tc_get_htb_get_leaf_queue()
Problem Details: Fix the following kernel warning deleting HTB offloaded leafs and/or root HTB qdisc in airoha_eth driver properly reporting qid in airoha_tc_get_htb_get_leaf_queue routine. $tc qdisc replace dev eth1 root handle 10: htb offload $tc class add dev eth1 arent 10: classid 10:4 htb rate 100mbit ceil 100mbi...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index c0a642568ac1..20a96cafc748 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -2358,7 +2358,7 @@ static int airoha_tc_get_htb_get_leaf_queue(struct airoha_g...
10206302af856791fbcc27a33ed3c3eb09b2793d
Analyze and fix the following issue in the Linux kernel code: sctp: add mutual exclusion in proc_sctp_do_udp_port()
Problem Details: We must serialize calls to sctp_udp_sock_stop() and sctp_udp_sock_start() or risk a crash as syzbot reported: Oops: general protection fault, probably for non-canonical address 0xdffffc000000000d: 0000 [#1] SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f] CPU: 1 UID...
```diff diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index 8e1e97be4df7..ee3eac338a9d 100644 --- a/net/sctp/sysctl.c +++ b/net/sctp/sysctl.c @@ -525,6 +525,8 @@ static int proc_sctp_do_auth(const struct ctl_table *ctl, int write, return ret; } +static DEFINE_MUTEX(sctp_sysctl_mutex); + static int proc_sctp_...
076c700988938e02d51c018095d33b339cdb7ffd
Analyze and fix the following issue in the Linux kernel code: selftests: tc-testing: Add TBF with SKBPRIO queue length corner case test
Problem Details: Add a test case to validate the interaction between TBF and SKBPRIO queueing disciplines, specifically targeting queue length accounting corner cases. This test complements the fix for the queue length accounting issue in the SKBPRIO qdisc. This is still best-effort, as timing and manipulating enqueue...
```diff diff --git a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json index 9044ac054167..25454fd95537 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json +++ b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.js...
ce8fe975fd99b49c29c42e50f2441ba53112b2e8
Analyze and fix the following issue in the Linux kernel code: net_sched: skbprio: Remove overly strict queue assertions
Problem Details: In the current implementation, skbprio enqueue/dequeue contains an assertion that fails under certain conditions when SKBPRIO is used as a child qdisc under TBF with specific parameters. The failure occurs because TBF sometimes peeks at packets in the child qdisc without actually dequeuing them when to...
```diff diff --git a/net/sched/sch_skbprio.c b/net/sched/sch_skbprio.c index 20ff7386b74b..f485f62ab721 100644 --- a/net/sched/sch_skbprio.c +++ b/net/sched/sch_skbprio.c @@ -123,8 +123,6 @@ static int skbprio_enqueue(struct sk_buff *skb, struct Qdisc *sch, /* Check to update highest and lowest priorities. */ if (s...
078aabd567de3d63d37d7673f714e309d369e6e2
Analyze and fix the following issue in the Linux kernel code: netlabel: Fix NULL pointer exception caused by CALIPSO on IPv4 sockets
Problem Details: When calling netlbl_conn_setattr(), addr->sa_family is used to determine the function behavior. If sk is an IPv4 socket, but the connect function is called with an IPv6 address, the function calipso_sock_setattr() is triggered. Inside this function, the following code is executed: sk_fullsock(__sk) ? ...
```diff diff --git a/net/ipv6/calipso.c b/net/ipv6/calipso.c index dbcea9fee626..62618a058b8f 100644 --- a/net/ipv6/calipso.c +++ b/net/ipv6/calipso.c @@ -1072,8 +1072,13 @@ static int calipso_sock_getattr(struct sock *sk, struct ipv6_opt_hdr *hop; int opt_len, len, ret_val = -ENOMSG, offset; unsigned char *opt; ...
8abaa80b403e1fc40877eb9b339ae0ad07e8968f
Analyze and fix the following issue in the Linux kernel code: drm/mode_config: Make drm_mode_config.(max|min)_(width|height) unsigned
Problem Details: It doesn't make much sense to allow devices to specify their min/max resolution as signed integers, and in Rust with CONFIG_RUST_OVERFLOW_CHECKS enabled this provides us actual over/underflow checks. Similarly, it doesn't really make much sense for us to allow devices to specify their minimum/maximum r...
```diff diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 271765e2e9f2..4b8f0370b79b 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -532,8 +532,8 @@ struct drm_mode_config { */ struct list_head privobj_list; - int min_width, min_height; - int max_...
4190aa3a76a6f840ace7d5e30719f85af0ed6302
Analyze and fix the following issue in the Linux kernel code: drm/edid: Use unsigned int in drm_add_modes_noedid()
Problem Details: A negative resolution doesn't really make any sense, so let's make these parameters unsigned. In C this doesn't make much of a difference, but Rust is stricter about signed/unsigned casts and additionally can check for arithmetic over/underflows if CONFIG_RUST_OVERFLOW_CHECKS is enabled. Signed-off-by...
```diff diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 13bc4c290b17..1e69326283dc 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -7099,18 +7099,12 @@ EXPORT_SYMBOL(drm_add_edid_modes); * Return: The number of modes added or 0 if we couldn't find any. */ int ...
688c15017d5cd5aac882400782e7213d40dc3556
Analyze and fix the following issue in the Linux kernel code: netfilter: nf_tables: don't unregister hook when table is dormant
Problem Details: When nf_tables_updchain encounters an error, hook registration needs to be rolled back. This should only be done if the hook has been registered, which won't happen when the table is flagged as dormant (inactive). Just move the assignment into the registration block. Reported-by: syzbot+53ed3a644017...
```diff diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index c2df81b7e950..a133e1c175ce 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -2839,11 +2839,11 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy, err = nft_netdev_regist...
9d74da1177c800eb3d51c13f9821b7b0683845a5
Analyze and fix the following issue in the Linux kernel code: netfilter: nft_set_hash: GC reaps elements with conncount for dynamic sets only
Problem Details: conncount has its own GC handler which determines when to reap stale elements, this is convenient for dynamic sets. However, this also reaps non-dynamic sets with static configurations coming from control plane. Always run connlimit gc handler but honor feedback to reap element if this set is dynamic. ...
```diff diff --git a/net/netfilter/nft_set_hash.c b/net/netfilter/nft_set_hash.c index 8bfac4185ac7..abb0c8ec6371 100644 --- a/net/netfilter/nft_set_hash.c +++ b/net/netfilter/nft_set_hash.c @@ -309,7 +309,8 @@ static bool nft_rhash_expr_needs_gc_run(const struct nft_set *set, nft_setelem_expr_foreach(expr, elem_ex...
1f13c60d84e880df6698441026e64f84c7110c49
Analyze and fix the following issue in the Linux kernel code: x86/idle: Remove MFENCEs for X86_BUG_CLFLUSH_MONITOR in mwait_idle_with_hints() and prefer_mwait_c1_over_halt()
Problem Details: The following commit, 12 years ago: 7e98b7192046 ("x86, idle: Use static_cpu_has() for CLFLUSH workaround, add barriers") added barriers around the CLFLUSH in mwait_idle_with_hints(), justified with: ... and add memory barriers around it since the documentation is explicit that CLFLUSH is only...
```diff diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h index ce857ef54cf1..54dc313bcdf0 100644 --- a/arch/x86/include/asm/mwait.h +++ b/arch/x86/include/asm/mwait.h @@ -116,13 +116,10 @@ static __always_inline void __sti_mwait(unsigned long eax, unsigned long ecx) static __always_inline void ...
2985dae1e521ee1464130902415f5863ea05dc34
Analyze and fix the following issue in the Linux kernel code: mm/page_alloc: Fix try_alloc_pages
Problem Details: Fix an obvious bug. try_alloc_pages() should set_page_refcounted. [ Not so obvious: it was probably correct at the time it was written but was at some point then rebased on top of v6.14-rc1. And at that point there was a semantic conflict with commit efabfe1420f5 ("mm/page_alloc: move set_page_...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f51aa6051a99..5b173c2da641 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7385,6 +7385,9 @@ struct page *try_alloc_pages_noprof(int nid, unsigned int order) /* Unlike regular alloc_pages() there is no __alloc_pages_slowpath(). */ + if (page) + ...
7ca59947b5fcf94e7ea4029d1bd0f7c41500a161
Analyze and fix the following issue in the Linux kernel code: pwm: mediatek: Prevent divide-by-zero in pwm_mediatek_config()
Problem Details: With CONFIG_COMPILE_TEST && !CONFIG_HAVE_CLK, pwm_mediatek_config() has a divide-by-zero in the following line: do_div(resolution, clk_get_rate(pc->clk_pwms[pwm->hwpwm])); due to the fact that the !CONFIG_HAVE_CLK version of clk_get_rate() returns zero. This is presumably just a theoretical problem...
```diff diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c index 01dfa0fab80a..7eaab5831499 100644 --- a/drivers/pwm/pwm-mediatek.c +++ b/drivers/pwm/pwm-mediatek.c @@ -121,21 +121,25 @@ static int pwm_mediatek_config(struct pwm_chip *chip, struct pwm_device *pwm, struct pwm_mediatek_chip *pc = to_p...
4c9106f4906a85f6b13542d862e423bcdc118cc3
Analyze and fix the following issue in the Linux kernel code: idpf: fix adapter NULL pointer dereference on reboot
Problem Details: With SRIOV enabled, idpf ends up calling into idpf_remove() twice. First via idpf_shutdown() and then again when idpf_remove() calls into sriov_disable(), because the VF devices use the idpf driver, hence the same remove routine. When that happens, it is possible for the adapter to be NULL from the fir...
```diff diff --git a/drivers/net/ethernet/intel/idpf/idpf_main.c b/drivers/net/ethernet/intel/idpf/idpf_main.c index b6c515d14cbf..bec4a02c5373 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_main.c +++ b/drivers/net/ethernet/intel/idpf/idpf_main.c @@ -87,7 +87,11 @@ destroy_wqs: */ static void idpf_shutdown(struc...
40206599beec98cfeb01913ee417f015e3f6190c
Analyze and fix the following issue in the Linux kernel code: ixgbe: fix media type detection for E610 device
Problem Details: The commit 23c0e5a16bcc ("ixgbe: Add link management support for E610 device") introduced incorrect media type detection for E610 device. It reproduces when advertised speed is modified after driver reload. Clear the previous outdated PHY type high value. Reproduction steps: modprobe ixgbe ethtool -s ...
```diff diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c index cb07ecd8937d..00935747c8c5 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c @@ -1453,9 +1453,11 @@ enum ixgbe_media_type ixgbe_get_media_...
efaaf344bc2917cbfa5997633bc18a05d3aed27f
Analyze and fix the following issue in the Linux kernel code: e1000e: change k1 configuration on MTP and later platforms
Problem Details: Starting from Meteor Lake, the Kumeran interface between the integrated MAC and the I219 PHY works at a different frequency. This causes sporadic MDI errors when accessing the PHY, and in rare circumstances could lead to packet corruption. To overcome this, introduce minor changes to the Kumeran idle ...
```diff diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h index 5e2cfa73f889..8294a7c4f122 100644 --- a/drivers/net/ethernet/intel/e1000e/defines.h +++ b/drivers/net/ethernet/intel/e1000e/defines.h @@ -803,4 +803,7 @@ /* SerDes Control */ #define E1000_GEN_POLL_TIM...
d931cf9b38da0f533cacfe51c863a9912e67822f
Analyze and fix the following issue in the Linux kernel code: igc: Fix TX drops in XDP ZC
Problem Details: Fixes TX frame drops in AF_XDP zero copy mode when budget < 4. xsk_tx_peek_desc() consumed TX frame and it was ignored because of low budget. Not even AF_XDP completion was done for dropped frames. It can be reproduced on i226 by sending 100000x 60 B frames with launch time set to minimal IPG (672 ns ...
```diff diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 27c99ff59ed4..156d123c0e21 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -3042,7 +3042,7 @@ static void igc_xdp_xmit_zc(struct igc_ring *ring) *...
dddeeaa16ce9d163ccf3b681715512d338afa541
Analyze and fix the following issue in the Linux kernel code: igc: Fix XSK queue NAPI ID mapping
Problem Details: In commit b65969856d4f ("igc: Link queues to NAPI instances"), the XSK queues were incorrectly unmapped from their NAPI instances. After discussion on the mailing list and the introduction of a test to codify the expected behavior, we can see that the unmapping causes the check_xsk test to fail: NETIF...
```diff diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h index cd1d7b6c1782..c35cc5cb1185 100644 --- a/drivers/net/ethernet/intel/igc/igc.h +++ b/drivers/net/ethernet/intel/igc/igc.h @@ -337,8 +337,6 @@ struct igc_adapter { struct igc_led_classdev *leds; }; -void igc_set_que...
31e98e277ae47f56632e4d663b1d4fd12ba33ea8
Analyze and fix the following issue in the Linux kernel code: wifi: ath11k: fix node corruption in ar->arvifs list
Problem Details: In current WLAN recovery code flow, ath11k_core_halt() only reinitializes the "arvifs" list head. This will cause the list node immediately following the list head to become an invalid list node. Because the prev of that node still points to the list head "arvifs", but the next of the list head "arvifs...
```diff diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c index 3f0e8e65e8e9..2e9f8a5e61e4 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -2238,6 +2238,7 @@ err_hal_srng_deinit: void ath11k_core_halt(struct ath11k *ar) { ...
15293c1829d897065295750f1c1987f0ac82a890
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Fix spelling errors in mac.c file
Problem Details: Fix spelling error correpsondig -> corresponding in the comments within the file mac.c Compile tested only. Signed-off-by: Maharaja Kennadyrajan <maharaja.kennadyrajan@oss.qualcomm.com> Link: https://patch.msgid.link/20250401173755.1982382-1-maharaja.kennadyrajan@oss.qualcomm.com Signed-off-by: Jeff ...
```diff diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 74b9e956c68d..b19e30d95560 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4472,7 +4472,7 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw, return -EI...
c426497fa2055c8005196922e7d29c41d7e0948a
Analyze and fix the following issue in the Linux kernel code: wifi: ath12k: Fix memory leak due to multiple rx_stats allocation
Problem Details: rx_stats for each arsta is allocated when adding a station. arsta->rx_stats will be freed when a station is removed. Redundant allocations are occurring when the same station is added multiple times. This causes ath12k_mac_station_add() to be called multiple times, and rx_stats is allocated each time....
```diff diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index f2fddf213afb..f4152f5d4987 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -5557,10 +5557,13 @@ static int ath12k_mac_station_add(struct ath12k *ar, ar->max_...
e4d4b8670c44cdd22212cab3c576e2d317efa67c
Analyze and fix the following issue in the Linux kernel code: ring-buffer: Use flush_kernel_vmap_range() over flush_dcache_folio()
Problem Details: Some architectures do not have data cache coherency between user and kernel space. For these architectures, the cache needs to be flushed on both the kernel and user addresses so that user space can see the updates the kernel has made. Instead of using flush_dcache_folio() and playing with virt_to_fol...
```diff diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index f25966b3a1fc..d4b0f7b55cce 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c @@ -6016,7 +6016,7 @@ static void rb_update_meta_page(struct ring_buffer_per_cpu *cpu_buffer) meta->read = cpu_buffer->read; /* Som...
a07c43e6c2ff4cbdba7abf8d533b2faf19fa2287
Analyze and fix the following issue in the Linux kernel code: bcachefs: add missing selection of XARRAY_MULTI
Problem Details: When CONFIG_XARRAY_MULTI is not set, reading from a bcachefs file hits the 'BUG_ON(order > 0);' in xas_set_order(), because it tries to insert a large folio in the page cache. Fix this by making bcachefs select XARRAY_MULTI. Fixes: be212d86b19c ("bcachefs: bs > ps support") Signed-off-by: Eric Bigger...
```diff diff --git a/fs/bcachefs/Kconfig b/fs/bcachefs/Kconfig index c9798750202d..bf1c94e51dd0 100644 --- a/fs/bcachefs/Kconfig +++ b/fs/bcachefs/Kconfig @@ -26,6 +26,7 @@ config BCACHEFS_FS select SRCU select SYMBOLIC_ERRNAME select MIN_HEAP + select XARRAY_MULTI help The bcachefs filesystem - a modern, cop...
dcffc3b1ae3251d796a25c673f614e3099ca83d3
Analyze and fix the following issue in the Linux kernel code: bcachefs: Split up bch_dev.io_ref
Problem Details: We now have separate per device io_refs for read and write access. This fixes a device removal bug where the discard workers were still running while we're removing alloc info for that device. It's also a bit of hardening; we no longer allow writes to devices that are read-only. Signed-off-by: Kent ...
```diff diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index c12ca7538e4f..1a467bb74a47 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -1950,7 +1950,7 @@ static void bch2_do_discards_work(struct work_struct *work) trace_discard_buckets(c, s.seen, s.op...
dd941507a9486252d6fcf11814387666792020f3
Analyze and fix the following issue in the Linux kernel code: tracing: fprobe events: Fix possible UAF on modules
Problem Details: Commit ac91052f0ae5 ("tracing: tprobe-events: Fix leakage of module refcount") moved try_module_get() from __find_tracepoint_module_cb() to find_tracepoint() caller, but that introduced a possible UAF because the module can be unloaded before try_module_get(). In this case, the module object should be ...
```diff diff --git a/kernel/trace/trace_fprobe.c b/kernel/trace/trace_fprobe.c index 985ff98272da..2cd9ff1049f1 100644 --- a/kernel/trace/trace_fprobe.c +++ b/kernel/trace/trace_fprobe.c @@ -919,9 +919,15 @@ static void __find_tracepoint_module_cb(struct tracepoint *tp, struct module *mo struct __find_tracepoint_cb_d...
d24fa977eec53399a9a49a2e1dc592430ea0a607
Analyze and fix the following issue in the Linux kernel code: tracing: fprobe: Fix to lock module while registering fprobe
Problem Details: Since register_fprobe() does not get the module reference count while registering fgraph filter, if the target functions (symbols) are in modules, those modules can be unloaded when registering fprobe to fgraph. To avoid this issue, get the reference counter of module for each symbol, and put it after...
```diff diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c index 33082c4e8154..cb86f90d4b1e 100644 --- a/kernel/trace/fprobe.c +++ b/kernel/trace/fprobe.c @@ -445,6 +445,7 @@ struct filter_match_data { size_t index; size_t size; unsigned long *addrs; + struct module **mods; }; static int filter_match_...
8e5419d6542fdf2dca9a0acdef2b8255f0e4ba69
Analyze and fix the following issue in the Linux kernel code: nfs: Add missing release on error in nfs_lock_and_join_requests()
Problem Details: Call nfs_release_request() on this error path before returning. Fixes: c3f2235782c3 ("nfs: fold nfs_folio_find_and_lock_request into nfs_lock_and_join_requests") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/3aaaa3d5-1c8a-41e4-98c7-717801ddd171@stanley.mountai...
```diff diff --git a/fs/nfs/write.c b/fs/nfs/write.c index aa3d8bea3ec0..23df8b214474 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -579,8 +579,10 @@ retry: while (!nfs_lock_request(head)) { ret = nfs_wait_on_request(head); - if (ret < 0) + if (ret < 0) { + nfs_release_request(head); return ERR_PTR...
fc0585c7faa9fffa0ecdd6e2466e3293cd3239ac
Analyze and fix the following issue in the Linux kernel code: rv: Fix missing unlock on double nested monitors return path
Problem Details: RV doesn't support nested monitors having children monitors themselves and exits with the EINVAL code. However, it returns without unlocking the rv_interface_lock. Unlock the lock before returning from the initialisation function. Cc: Masami Hiramatsu <mhiramat@kernel.org> Link: https://lore.kernel.o...
```diff diff --git a/kernel/trace/rv/rv.c b/kernel/trace/rv/rv.c index 50344aa9f7f9..968c5c3b0246 100644 --- a/kernel/trace/rv/rv.c +++ b/kernel/trace/rv/rv.c @@ -809,7 +809,8 @@ int rv_register_monitor(struct rv_monitor *monitor, struct rv_monitor *parent) if (p && rv_is_nested_monitor(p)) { pr_info("Parent monit...
023f124a64174c47e18340ded7e2a39b96eb9523
Analyze and fix the following issue in the Linux kernel code: scripts/sorttable: Fix endianness handling in build-time mcount sort
Problem Details: Kernel cross-compilation with BUILDTIME_MCOUNT_SORT produces zeroed mcount values if the build-host endianness does not match the ELF file endianness. The mcount values array is converted from ELF file endianness to build-host endianness during initialization in fill_relocs()/fill_addrs(). Avoid extra...
```diff diff --git a/scripts/sorttable.c b/scripts/sorttable.c index 7b4b3714b1af..deed676bfe38 100644 --- a/scripts/sorttable.c +++ b/scripts/sorttable.c @@ -857,7 +857,7 @@ static void *sort_mcount_loc(void *arg) for (void *ptr = vals; ptr < vals + size; ptr += long_size) { uint64_t key; - key = long_size ...
ea8d7647f9ddf1f81e2027ed305299797299aa03
Analyze and fix the following issue in the Linux kernel code: tracing: Verify event formats that have "%*p.."
Problem Details: The trace event verifier checks the formats of trace events to make sure that they do not point at memory that is not in the trace event itself or in data that will never be freed. If an event references data that was allocated when the event triggered and that same data is freed before the event is re...
```diff diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 8638b7f7ff85..069e92856bda 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -470,6 +470,7 @@ static void test_event_printk(struct trace_event_call *call) case '%': continue; case 'p': + do_poin...
42ea22e754ba4f2b86f8760ca27f6f71da2d982c
Analyze and fix the following issue in the Linux kernel code: ftrace: Add cond_resched() to ftrace_graph_set_hash()
Problem Details: When the kernel contains a large number of functions that can be traced, the loop in ftrace_graph_set_hash() may take a lot of time to execute. This may trigger the softlockup watchdog. Add cond_resched() within the loop to allow the kernel to remain responsive even when processing a large number of f...
```diff diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 92015de6203d..1a48aedb5255 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -6855,6 +6855,7 @@ ftrace_graph_set_hash(struct ftrace_hash *hash, char *buffer) } } } + cond_resched(); } while_for_each_ftrace_rec(); ...
2c9ee74a6d6166d0f31f00841cde16a2915fffcb
Analyze and fix the following issue in the Linux kernel code: tracing: Free module_delta on freeing of persistent ring buffer
Problem Details: If a persistent ring buffer is created, a "module_delta" array is also allocated to hold the module deltas of loaded modules that match modules in the scratch area. If this buffer gets freed, the module_delta array is not freed and causes a memory leak. Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: M...
```diff diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 103b193875b3..de6d7f0e6206 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -9609,6 +9609,7 @@ static void free_trace_buffers(struct trace_array *tr) return; free_trace_buffer(&tr->array_buffer); + kfree(tr->module_delta); #...
b81ff11c21af688fc8435aad1e5c1463beff8c2d
Analyze and fix the following issue in the Linux kernel code: ftrace: Have tracing function args depend on PROBE_EVENTS_BTF_ARGS
Problem Details: The option PROBE_EVENTS_BTF_ARGS enables the functions btf_find_func_proto() and btf_get_func_param() which are used by the function argument tracing code. The option FUNCTION_TRACE_ARGS was dependent on the same configs that PROBE_EVENTS_BTF_ARGS was dependent on, but it was also dependent on PROBE_EV...
```diff diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 033fba0633cf..a3f35c7d83b6 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -265,8 +265,7 @@ config FUNCTION_GRAPH_RETADDR config FUNCTION_TRACE_ARGS bool - depends on HAVE_FUNCTION_ARG_ACCESS_API - depends on DEBUG_INFO_BT...
892c4e465c360d07f529bc3668fde7cbd4ea6b32
Analyze and fix the following issue in the Linux kernel code: docs: Fix references to IBM CAPI (cxl) removal version
Problem Details: The IBM CAPI (cxl) driver was removed in 6.15, not 6.14. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
```diff diff --git a/Documentation/ABI/removed/sysfs-class-cxl b/Documentation/ABI/removed/sysfs-class-cxl index 15756a49eba2..266c413b96e8 100644 --- a/Documentation/ABI/removed/sysfs-class-cxl +++ b/Documentation/ABI/removed/sysfs-class-cxl @@ -1,4 +1,4 @@ -The cxl driver was removed in 6.14. +The cxl driver was remo...
e19c1272c80a5ecce387c1b0c3b995f4edf9c525
Analyze and fix the following issue in the Linux kernel code: spi: bcm2835: Restore native CS probing when pinctrl-bcm2835 is absent
Problem Details: The lookup table forces the use of the "pinctrl-bcm2835" GPIO chip provider and essentially assumes that there is going to be such a provider, and if not, we will fail to set-up the SPI device. While this is true on Raspberry Pi based systems (2835/36/37, 2711, 2712), this is not true on 7712/77122 Br...
```diff diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 06a81727d74d..77de5a07639a 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1226,7 +1226,12 @@ static int bcm2835_spi_setup(struct spi_device *spi) struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr); st...
a0f0dc96de03ffeefc2a177b7f8acde565cb77f4
Analyze and fix the following issue in the Linux kernel code: wifi: wl1251: fix memory leak in wl1251_tx_work
Problem Details: The skb dequeued from tx_queue is lost when wl1251_ps_elp_wakeup fails with a -ETIMEDOUT error. Fix that by queueing the skb back to tx_queue. Fixes: c5483b719363 ("wl12xx: check if elp wakeup failed") Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Reviewed-by: Michael Nemanov <michael.nemanov@t...
```diff diff --git a/drivers/net/wireless/ti/wl1251/tx.c b/drivers/net/wireless/ti/wl1251/tx.c index 474b603c121c..adb4840b0489 100644 --- a/drivers/net/wireless/ti/wl1251/tx.c +++ b/drivers/net/wireless/ti/wl1251/tx.c @@ -342,8 +342,10 @@ void wl1251_tx_work(struct work_struct *work) while ((skb = skb_dequeue(&wl->t...
9e935c0fe3f806ff700a804c00832f0f340b6061
Analyze and fix the following issue in the Linux kernel code: wifi: brcmfmac: fix memory leak in brcmf_get_module_param
Problem Details: The memory allocated for settings is not freed when brcmf_of_probe fails. Fix that by freeing settings before returning in error path. Fixes: 0ff0843310b7 ("wifi: brcmfmac: Add optional lpo clock enable support") Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com> Acked-by: Arend van Spriel <arend.va...
```diff diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index cfcf01eb0daa..f26e4679e4ff 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -561,8 +56...
ff4ec537e48cfb84400f52ad102f6d82fe934580
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mld: silence uninitialized variable warning
Problem Details: The "resp_len" isn't initialized if iwl_dhc_resp_data() fails. Fixes: b611cf6b57a8 ("wifi: iwlwifi: mld: add support for DHC_TOOLS_UMAC_GET_TAS_STATUS command") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgi...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mld/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mld/debugfs.c index 453ce2ba39d1..89d95e9b4f30 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/debugfs.c @@ -396,8 +396,8 @@ static ssize_t iwl_dbgfs_tas_...
378677eb8f44621ecc9ce659f7af61e5baa94d81
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: Purge vif txq in ieee80211_do_stop()
Problem Details: After ieee80211_do_stop() SKB from vif's txq could still be processed. Indeed another concurrent vif schedule_and_wake_txq call could cause those packets to be dequeued (see ieee80211_handle_wake_tx_queue()) without checking the sdata current state. Because vif.drv_priv is now cleared in this function...
```diff diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index b0423046028c..183b63235000 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -659,6 +659,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) ieee8021...
a104042e2bf6528199adb6ca901efe7b60c2c27f
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: Update skb's control block key in ieee80211_tx_dequeue()
Problem Details: The ieee80211 skb control block key (set when skb was queued) could have been removed before ieee80211_tx_dequeue() call. ieee80211_tx_dequeue() already called ieee80211_tx_h_select_key() to get the current key, but the latter do not update the key in skb control block in case it is NULL. Because some ...
```diff diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 20179db88c4a..34f229a6eab0 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3894,6 +3894,7 @@ begin: * The key can be removed while the packet was queued, so need to call * this here to get the current key. */ + info->control.hw_key = N...
27c7e63b3cb1a20bb78ed4a36c561ea4579fd7da
Analyze and fix the following issue in the Linux kernel code: wifi: at76c50x: fix use after free access in at76_disconnect
Problem Details: The memory pointed to by priv is freed at the end of at76_delete_device function (using ieee80211_free_hw). But the code then accesses the udev field of the freed object to put the USB device. This may also lead to a memory leak of the usb device. Fix this by using udev from interface. Fixes: 29e20aa6...
```diff diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless/atmel/at76c50x-usb.c index 504e05ea30f2..97ea7ab0f491 100644 --- a/drivers/net/wireless/atmel/at76c50x-usb.c +++ b/drivers/net/wireless/atmel/at76c50x-usb.c @@ -2552,7 +2552,7 @@ static void at76_disconnect(struct usb_interface *inter...
44605365f93518eacfc500665d965e88db4791c2
Analyze and fix the following issue in the Linux kernel code: iwlwifi: mld: fix building with CONFIG_PM_SLEEP disabled
Problem Details: The newly added driver causes multiple build problems when CONFIG_PM_SLEEP is disabled: drivers/net/wireless/intel/iwlwifi/mld/mac80211.c:1982:12: error: 'iwl_mld_resume' defined but not used [-Werror=unused-function] 1982 | static int iwl_mld_resume(struct ieee80211_hw *hw) | ^~~~~~...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c index 6851064b82da..0b5bc5abb82d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c @@ -501,7 +501,7 @@ int iwl_mld_mac80211_star...
676b902db4766aaec049d6ca4800dfa093599005
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mld: fix PM_SLEEP -Wundef warning
Problem Details: Config symbols are not defined if turned off, so need to use #ifdef, not #if. Fixes: d1e879ec600f9 ("wifi: iwlwifi: add iwlmld sub-driver") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Yedidya Ben Shimol <yedidya.ben.shimol@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mld/iface.h b/drivers/net/wireless/intel/iwlwifi/mld/iface.h index d1d56b081bf6..ec14d0736cee 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/iface.h +++ b/drivers/net/wireless/intel/iwlwifi/mld/iface.h @@ -166,7 +166,7 @@ struct iwl_mld_vif { struct iwl_m...
99f201a9a7d59d95da75695c41b3baf72c39efd3
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mld: reduce scope for uninitialized variable
Problem Details: After resuming from D3, keeping the connection or disconnecting isn't relevant for the case of netdetect. Reduce the scope of the keep_connection indicator to wowlan only. Fixes: d1e879ec600f9 ("wifi: iwlwifi: add iwlmld sub-driver") Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com> Sign...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mld/d3.c b/drivers/net/wireless/intel/iwlwifi/mld/d3.c index 5a7207accd86..2c6e8ecd93b7 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/d3.c @@ -1895,7 +1895,6 @@ int iwl_mld_wowlan_resume(struct iwl_mld *mld) ...
a22b3d54de94f82ca057cc2ebf9496fa91ebf698
Analyze and fix the following issue in the Linux kernel code: cgroup/cpuset: Fix race between newly created partition and dying one
Problem Details: There is a possible race between removing a cgroup diectory that is a partition root and the creation of a new partition. The partition to be removed can be dying but still online, it doesn't not currently participate in checking for exclusive CPUs conflict, but the exclusive CPUs are still there in s...
```diff diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 485b651869d9..5bc8f55c8cca 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -710,6 +710,7 @@ struct cgroup_subsys { void (*css_released)(struct cgroup_subsys_state *css); void (*css_free)(struct cgroup_...
8983dc1b66c0e1928a263b8af0bb06f6cb9229c4
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/realtek: Fix built-in mic on another ASUS VivoBook model
Problem Details: There is another VivoBook model which built-in mic got broken recently by the fix of the pin sort. Apply the correct quirk ALC256_FIXUP_ASUS_MIC_NO_PRESENCE to this model for addressing the regression, too. Fixes: 3b4309546b48 ("ALSA: hda: Fix headset detection failure due to unstable sort") Closes: ...
```diff diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index eec3ea1a7e08..79004bc8107b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -10889,6 +10889,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x1043, 0x1c43, "ASUS UX8406MA",...
d354d52c55c6ccebcc4f4148820139f319a4065f
Analyze and fix the following issue in the Linux kernel code: drm/i915/psr: Prevent DP Panel Replay as well when CRC is enable
Problem Details: We are seeing timeouts in opening CRC fd when testing on setup where DP Panel Replay can be enabled. Fix these by checking if CRC is enabled for DP Panel Replay as well. Signed-off-by: Jouni Högander <jouni.hogander@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Link: https://lore.kernel....
```diff diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 55414fa55b12..eef48c014112 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -1595,6 +1595,12 @@ _panel_replay_compute_config(struct intel_dp *intel_dp, ...
c8b5b7c5da7d0c31c9b7190b4a7bba5281fc4780
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix null pointer dereference in alloc_preauth_hash()
Problem Details: The Client send malformed smb2 negotiate request. ksmbd return error response. Subsequently, the client can send smb2 session setup even thought conn->preauth_info is not allocated. This patch add KSMBD_SESS_NEED_SETUP status of connection to ignore session setup request if smb2 negotiate phase is not ...
```diff diff --git a/fs/smb/server/connection.h b/fs/smb/server/connection.h index 91c2318639e7..14620e147dda 100644 --- a/fs/smb/server/connection.h +++ b/fs/smb/server/connection.h @@ -27,6 +27,7 @@ enum { KSMBD_SESS_EXITING, KSMBD_SESS_NEED_RECONNECT, KSMBD_SESS_NEED_NEGOTIATE, + KSMBD_SESS_NEED_SETUP, KSMBD...
d6691010523fe1016f482a1e1defcc6289eeea48
Analyze and fix the following issue in the Linux kernel code: spi: bcm2835: Do not call gpiod_put() on invalid descriptor
Problem Details: If we are unable to lookup the chip-select GPIO, the error path will call bcm2835_spi_cleanup() which unconditionally calls gpiod_put() on the cs->gpio variable which we just determined was invalid. Fixes: 21f252cd29f0 ("spi: bcm2835: reduce the abuse of the GPIO API") Signed-off-by: Florian Fainelli ...
```diff diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 0d1aa6592484..06a81727d74d 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1162,7 +1162,8 @@ static void bcm2835_spi_cleanup(struct spi_device *spi) sizeof(u32), DMA_TO_DEVICE); - gpiod_put(bs->cs_g...
8b46fdaea819a679da176b879e7b0674a1161a5e
Analyze and fix the following issue in the Linux kernel code: lib: scatterlist: fix sg_split_phys to preserve original scatterlist offsets
Problem Details: The split_sg_phys function was incorrectly setting the offsets of all scatterlist entries (except the first) to 0. Only the first scatterlist entry's offset and length needs to be modified to account for the skip. Setting the rest entries' offsets to 0 could lead to incorrect data access. I am using...
```diff diff --git a/lib/sg_split.c b/lib/sg_split.c index 60a0babebf2e..0f89aab5c671 100644 --- a/lib/sg_split.c +++ b/lib/sg_split.c @@ -88,8 +88,6 @@ static void sg_split_phys(struct sg_splitter *splitters, const int nb_splits) if (!j) { out_sg->offset += split->skip_sg0; out_sg->length -= split->skip_...
e2a33a2a3258794891cdd6ca4b1318da6594d157
Analyze and fix the following issue in the Linux kernel code: lib/sort.c: add _nonatomic() variants with cond_resched()
Problem Details: bcachefs calls sort() during recovery to sort all keys it found in the journal, and this may be very large - gigabytes on large machines. This has been causing "task blocked" warnings, so needs a cond_resched(). [kent.overstreet@linux.dev: fix kerneldoc] Link: https://lkml.kernel.org/r/cgsr5a447pxq...
```diff diff --git a/include/linux/sort.h b/include/linux/sort.h index e163287ac6c1..8e5603b10941 100644 --- a/include/linux/sort.h +++ b/include/linux/sort.h @@ -13,4 +13,15 @@ void sort(void *base, size_t num, size_t size, cmp_func_t cmp_func, swap_func_t swap_func); +/* Versions that periodically call cond...
9342bc134ae73a0b3fddec17075ccf75781a3a70
Analyze and fix the following issue in the Linux kernel code: mm/memory_hotplug: fix call folio_test_large with tail page in do_migrate_range
Problem Details: We triggered the below BUG: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x2 pfn:0x240402 head: order:9 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x1ffffe0000000040(head|node=1|zone=3|lastcpupid=0x1ffff) page_type: f4(hugetlb) page dumped because: VM_BUG_ON_PA...
```diff diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 75401866fb76..8305483de38b 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1813,21 +1813,15 @@ static void do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) page = pfn_to_page(pfn); folio = page_folio(page); - /*...
7790c9c9265eed6d1ae1f03e688b880f409e835d
Analyze and fix the following issue in the Linux kernel code: memblock: don't release high memory to page allocator when HIGHMEM is off
Problem Details: Nathan Chancellor reports the following crash on a MIPS system with CONFIG_HIGHMEM=n: Linux version 6.14.0-rc6-00359-g6faea3422e3b (nathan@ax162) (mips-linux-gcc (GCC) 14.2.0, GNU ld (GNU Binutils) 2.42) #1 SMP Fri Mar 21 08:12:02 MST 2025 earlycon: uart8250 at I/O port 0x3f8 (options '38400n8') ...
```diff diff --git a/mm/memblock.c b/mm/memblock.c index 284154445409..0a53db4d9f7b 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -2167,6 +2167,9 @@ static unsigned long __init __free_memory_core(phys_addr_t start, unsigned long start_pfn = PFN_UP(start); unsigned long end_pfn = PFN_DOWN(end); + if (!IS_ENABL...
2ebc3b68ac400444d8cc2ec1f4460c37aa7d28da
Analyze and fix the following issue in the Linux kernel code: mm/mm_init: init holes in the end of the memory map for FLATMEM
Problem Details: Patch series "mm: fixes for fallouts from mem_init() cleanup". These are the fixes for fallouts from mem_init() cleanup reported by Nathan Chancellor and kbuild. The details are in the commit messages. This patch (of 2): Kernel test robot reports the following crash on 32-bit system with FLATMEM a...
```diff diff --git a/mm/mm_init.c b/mm/mm_init.c index a38a1909b407..84f14fa12d0d 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -984,19 +984,19 @@ static void __init memmap_init(void) } } -#ifdef CONFIG_SPARSEMEM /* * Initialize the memory map for hole in the range [memory_end, - * section_end]. + * sec...
4a0cb631447fdcfb870a0b56950272cf25c0a6ee
Analyze and fix the following issue in the Linux kernel code: MAINTAINERS: add peterx as userfaultfd reviewer
Problem Details: Add an entry for userfaultfd and make myself a reviewer of it, just in case it helps people manage the cc list. I named it MEMORY USERFAULTFD, could be a bad name, but then it can be together with the MEMORY* entries when everything is in alphabetic order, which is definitely a benefit. The line may ...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index b1fe0b766cec..3ef706b4b01a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15517,6 +15517,18 @@ F: mm/vma.h F: mm/vma_internal.h F: tools/testing/vma/ +MEMORY USERFAULTFD +M: Andrew Morton <akpm@linux-foundation.org> +R: Peter Xu <peterx@redhat.com> +S: Maintained...
7a95a05f15d570e6087fea59280fe267fe809100
Analyze and fix the following issue in the Linux kernel code: mm: page_alloc: fix defrag_mode's retry & OOM path
Problem Details: Brendan points out that defrag_mode doesn't properly clear ALLOC_NOFRAGMENT on its last-ditch attempt to allocate. But looking closer, the problem is actually more severe: it doesn't actually *check* whether it's already retried, and keeps looping. This means the OOM path is never taken, and the thre...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index f51aa6051a99..37d111184eee 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4604,8 +4604,8 @@ retry: goto retry; /* Reclaim/compaction failed to prevent the fallback */ - if (defrag_mode) { - alloc_flags &= ALLOC_NOFRAGMENT; + if (defrag_mode &&...
36eed5400805b294f1df39b0e3ebc5b7971b3c16
Analyze and fix the following issue in the Linux kernel code: mm/mremap: do not set vrm->vma NULL immediately prior to checking it
Problem Details: This seems rather unwise. If we cannot merge, extend, then we need to recall the original VMA to see if we need to uncharge. If we do need to, do so. Link: https://lkml.kernel.org/r/b2fb6b9c-376d-4e9b-905e-26d847fd3865@lucifer.local Fixes: d5c8aec0542e ("mm/mremap: initial refactor of move_vma()") S...
```diff diff --git a/mm/mremap.c b/mm/mremap.c index 0865387531ed..7db9da609c84 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -1561,11 +1561,12 @@ static unsigned long expand_vma_in_place(struct vma_remap_struct *vrm) * adjacent to the expanded vma and otherwise * compatible. */ - vma = vrm->vma = vma_merge_ex...
c11bcbc0a517acf69282c8225059b2a8ac5fe628
Analyze and fix the following issue in the Linux kernel code: mm: zswap: fix crypto_free_acomp() deadlock in zswap_cpu_comp_dead()
Problem Details: Currently, zswap_cpu_comp_dead() calls crypto_free_acomp() while holding the per-CPU acomp_ctx mutex. crypto_free_acomp() then holds scomp_lock (through crypto_exit_scomp_ops_async()). On the other hand, crypto_alloc_acomp_node() holds the scomp_lock (through crypto_scomp_init_tfm()), and then alloca...
```diff diff --git a/mm/zswap.c b/mm/zswap.c index 0dcc54eab58b..204fb59da33c 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -883,18 +883,32 @@ static int zswap_cpu_comp_dead(unsigned int cpu, struct hlist_node *node) { struct zswap_pool *pool = hlist_entry(node, struct zswap_pool, node); struct crypto_acomp_ctx *aco...
1ca77ff1837249701053a7fcbdedabc41f4ae67c
Analyze and fix the following issue in the Linux kernel code: mm/hugetlb: move hugetlb_sysctl_init() to the __init section
Problem Details: hugetlb_sysctl_init() is only invoked once by an __init function and is merely a wrapper around another __init function so there is not reason to keep it. Fixes the following warning when toning down some GCC inline options: WARNING: modpost: vmlinux: section mismatch in reference: hugetlb_sysctl...
```diff diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 6fccfe6d046c..39f92aad7bd1 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5179,7 +5179,7 @@ static const struct ctl_table hugetlb_table[] = { }, }; -static void hugetlb_sysctl_init(void) +static void __init hugetlb_sysctl_init(void) { register_sysctl_init...
a0a9f2180b90c7d5f7c85a77b359856f675cf760
Analyze and fix the following issue in the Linux kernel code: mm: page_isolation: avoid calling folio_hstate() without hugetlb_lock
Problem Details: I found a NULL pointer dereference as followed: BUG: kernel NULL pointer dereference, address: 0000000000000028 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: Oops: 0000 [#1] SMP PTI CPU: 5 UID: 0 PID: 5964 Comm: sh Kdump: loaded Not taint...
```diff diff --git a/mm/page_isolation.c b/mm/page_isolation.c index a051a29e95ad..b2fc5266e3d2 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@ -83,7 +83,14 @@ static struct page *has_unmovable_pages(unsigned long start_pfn, unsigned long e unsigned int skip_pages; if (PageHuge(page)) { - if ...
b98072af60a7ce19214c80f10a7daab924c69182
Analyze and fix the following issue in the Linux kernel code: mm/hugetlb_vmemmap: fix memory loads ordering
Problem Details: Using x86_64 as an example, for a 32KB struct page[] area describing a 2MB hugeTLB, HVO reduces the area to 4KB by the following steps: 1. Split the (r/w vmemmap) PMD mapping the area into 512 (r/w) PTEs; 2. For the 8 PTEs mapping the area, remap PTE 1-7 to the page mapped by PTE 0, and at the same...
```diff diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5bd9492a66ee..e6a21b62dcce 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -226,11 +226,48 @@ static __always_inline const struct page *page_fixed_fake_head(const struct page } return page; } + +static __...
fe4cdc2c4e248f48de23bc778870fd71e772a274
Analyze and fix the following issue in the Linux kernel code: mm/userfaultfd: fix release hang over concurrent GUP
Problem Details: This patch should fix a possible userfaultfd release() hang during concurrent GUP. This problem was initially reported by Dimitris Siakavaras in July 2023 [1] in a firecracker use case. Firecracker has a separate process handling page faults remotely, and when the process releases the userfaultfd it ...
```diff diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index 97c4d71115d8..d80f94346199 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c @@ -395,32 +395,6 @@ vm_fault_t handle_userfault(struct vm_fault *vmf, unsigned long reason) if (!(vmf->flags & FAULT_FLAG_USER) && (ctx->flags & UFFD_USER_MODE_ONLY)) goto...
f8554f512b8a1ecaa354fd7b1dd63906759e7335
Analyze and fix the following issue in the Linux kernel code: selftests: ublk: kublk: fix an error log line
Problem Details: When doing io_uring operations using liburing, errno is not used to indicate errors, so the %m format specifier does not provide any relevant information for failed io_uring commands. Fix a log line emitted on get_params failure to translate the error code returned in the cqe->res field instead. Signe...
```diff diff --git a/tools/testing/selftests/ublk/kublk.c b/tools/testing/selftests/ublk/kublk.c index d39f166c9dc3..91c282bc7674 100644 --- a/tools/testing/selftests/ublk/kublk.c +++ b/tools/testing/selftests/ublk/kublk.c @@ -215,7 +215,7 @@ static void ublk_ctrl_dump(struct ublk_dev *dev) ret = ublk_ctrl_get_para...
e5f1e8af9c9e151ecd665f6d2e36fb25fec3b110
Analyze and fix the following issue in the Linux kernel code: x86/fred: Fix system hang during S4 resume with FRED enabled
Problem Details: Upon a wakeup from S4, the restore kernel starts and initializes the FRED MSRs as needed from its perspective. It then loads a hibernation image, including the image kernel, and attempts to load image pages directly into their original page frames used before hibernation unless those frames are curren...
```diff diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 63230ff8cf4f..08e76a5ca155 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c @@ -27,6 +27,7 @@ #include <asm/mmu_context.h> #include <asm/cpu_device_id.h> #include <asm/microcode.h> +#include <asm/fred.h> #ifdef CONFIG_X86_32 __vis...
212120a164d59fd534148d315f13db3d296efb0f
Analyze and fix the following issue in the Linux kernel code: Documentation/EDAC: Fix warning document isn't included in any toctree
Problem Details: Fix the build (htmldocs) warning: Documentation/edac/index.rst: WARNING: document isn't included in any toctree. Fixes: db99ea5f2c03 ("EDAC: Add support for EDAC device features control") Closes: https://lore.kernel.org/all/20250228185102.15842f8b@canb.auug.org.au/ Reported-by: Stephen Rothwell <sf...
```diff diff --git a/Documentation/subsystem-apis.rst b/Documentation/subsystem-apis.rst index b52ad5b969d4..ff4fe8c936c8 100644 --- a/Documentation/subsystem-apis.rst +++ b/Documentation/subsystem-apis.rst @@ -71,6 +71,7 @@ Other subsystems accounting/index cpu-freq/index + edac/index fpga/index i2...
b4bc3144c1eca9107f45018000a1e68bfd308d8c
Analyze and fix the following issue in the Linux kernel code: x86/nmi: Fix comment in unknown_nmi_error()
Problem Details: The comment in unknown_nmi_error() is incorrect and misleading. There is no longer a restriction on having a single Unknown NMI handler. Also, nmi_handle() never used the 'b2b' parameter. The commits that made the comment outdated are: 0d443b70cc92 ("x86/platform: Remove warning message for duplica...
```diff diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index cdfb3864d59a..2a07c9adc6a6 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c @@ -327,10 +327,9 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs) int handled; /* - * Use 'false' as back-to-back NMIs are dealt with...