id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
0b49c7d0ae697fcecd7377cb7dda220f7cd096ff
Analyze and fix the following issue in the Linux kernel code: lib: kunit_iov_iter: fix memory leaks
Problem Details: Use vfree() instead of vunmap() to free the buffer allocated by iov_kunit_create_buffer() because vunmap() does not honour VM_MAP_PUT_PAGES. In order for this to work the page array itself must not be managed by kunit. Remove the folio_put() when destroying a folioq. This is handled by vfree(), now....
```diff diff --git a/lib/tests/kunit_iov_iter.c b/lib/tests/kunit_iov_iter.c index bb847e5010eb..d16449bdb833 100644 --- a/lib/tests/kunit_iov_iter.c +++ b/lib/tests/kunit_iov_iter.c @@ -42,7 +42,7 @@ static inline u8 pattern(unsigned long x) static void iov_kunit_unmap(void *data) { - vunmap(data); + vfree(data); ...
118cf3f55975352ac357fb194405031458186819
Analyze and fix the following issue in the Linux kernel code: lib/scatterlist: fix temp buffer in extract_user_to_sg()
Problem Details: Instead of allocating a temporary buffer for extracted user pages extract_user_to_sg() uses the end of the to be filled scatterlist as a temporary buffer. Fix the calculation of the start address if the scatterlist already contains elements. The unused space starts at sgtable->sgl + sgtable->nents no...
```diff diff --git a/lib/scatterlist.c b/lib/scatterlist.c index befdc4b9c11d..b7fe91ef35b8 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c @@ -1123,8 +1123,7 @@ static ssize_t extract_user_to_sg(struct iov_iter *iter, size_t len, off; /* We decant the page list into the tail of the scatterlist */ - pages ...
07b7d66e65d9cfe6b9c2c34aa22cfcaac37a5c45
Analyze and fix the following issue in the Linux kernel code: lib/scatterlist: fix length calculations in extract_kvec_to_sg
Problem Details: Patch series "Fix bugs in extract_iter_to_sg()", v3. Fix bugs in the kvec and user variants of extract_iter_to_sg. This series is growing due to useful remarks made by sashiko.dev. The main bugs are: - The length for an sglist entry when extracting from a kvec can exceed the number of bytes in the...
```diff diff --git a/lib/scatterlist.c b/lib/scatterlist.c index d773720d11bf..befdc4b9c11d 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c @@ -1247,7 +1247,7 @@ static ssize_t extract_kvec_to_sg(struct iov_iter *iter, else page = virt_to_page((void *)kaddr); - sg_set_page(sg, page, len, off); + s...
675a0dd596e712404557286d0a883b54ee28e4f4
Analyze and fix the following issue in the Linux kernel code: arm64/xor: fix conflicting attributes for xor_block_template
Problem Details: Commit 2c54b423cf85 ("arm64/xor: use EOR3 instructions when available") changes the definition to __ro_after_init instead of const, but failed to update the external declaration in xor.h. This was not found because xor-neon.c doesn't include <asm/xor.h>, and can't easily do that due to current archite...
```diff diff --git a/arch/arm64/include/asm/xor.h b/arch/arm64/include/asm/xor.h index c38e3d017a79..bb7428d4ebc6 100644 --- a/arch/arm64/include/asm/xor.h +++ b/arch/arm64/include/asm/xor.h @@ -13,7 +13,7 @@ #ifdef CONFIG_KERNEL_MODE_NEON -extern struct xor_block_template const xor_block_inner_neon; +extern struc...
210259987d9a7bb8506f3e93c2ddbece15c13b15
Analyze and fix the following issue in the Linux kernel code: perf metrics: Make common stalled metrics conditional on having the event
Problem Details: The metric code uses the event parsing code but it generally assumes all events are supported. Arnaldo reported AMD supporting stalled-cycles-frontend but not stalled-cycles-backend [1]. An issue with this is that before parsing happens the metric code tries to share events within groups to reduce the ...
```diff diff --git a/tools/perf/pmu-events/arch/common/common/metrics.json b/tools/perf/pmu-events/arch/common/common/metrics.json index 0d010b3ebc6d..cefc8bfe7830 100644 --- a/tools/perf/pmu-events/arch/common/common/metrics.json +++ b/tools/perf/pmu-events/arch/common/common/metrics.json @@ -46,14 +46,14 @@ }, ...
8cc518735beb879c51df712a5ce5893c02f81b12
Analyze and fix the following issue in the Linux kernel code: perf header: Add utility to convert feature number to a string
Problem Details: For logging and debug messages it can be convenient to convert a feature number to a name. Add header_feat__name for this and reuse the data already within the feat_ops struct. Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
```diff diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 9ffc0f4ca6d1..34178ce826fb 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -3780,6 +3780,13 @@ struct header_print_data { bool full; /* extended list of headers */ }; +const char *header_feat__name(unsigned int i...
42a9f5a16328ed78a88e0498556965b6c6ec515c
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8mm-tqma8mqml: Correct PAD settings for PMIC_nINT
Problem Details: With commit 5d0efaf47ee90 ("regulator: pca9450: Correct interrupt type"), there might be interrupt storm for this board. Need to set PAD PUE and PU together to make pull up work properly. Fixes: dfcd1b6f7620e ("arm64: dts: freescale: add initial device tree for TQMa8MQML with i.MX8MM") Signed-off-by: ...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml.dtsi index 29b298af0d73..1b5ba3c47164 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml.dtsi @@ -292,7 +292,7 @@ }; pinctrl_...
0fb37990774113afd943eaa91323679388584b6d
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8mn-tqma8mqnl: Correct PAD settings for PMIC_nINT
Problem Details: With commit 5d0efaf47ee90 ("regulator: pca9450: Correct interrupt type"), there might be interrupt storm for this board. Need to set PAD PUE and PU together to make pull up work properly. Fixes: 3e56e354db6d3 ("arm64: dts: freescale: add initial device tree for TQMa8MQNL with i.MX8MN") Signed-off-by: ...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl.dtsi index 31a3ca137e63..48a687926aa1 100644 --- a/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mn-tqma8mqnl.dtsi @@ -283,7 +283,7 @@ }; pinctrl_...
721dec3ee9ff5231d13a412ff87df63b966d137b
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8mm-emtop-som: Correct PAD settings for PMIC_nINT
Problem Details: With commit 5d0efaf47ee90 ("regulator: pca9450: Correct interrupt type"), there might be interrupt storm for this board. Need to set PAD PUE and PU together to make pull up work properly. While at here, also correct interrupt type as IRQ_TYPE_LEVEL_LOW. Fixes: cbd3ef64eb9d1 ("arm64: dts: Add support ...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mm-emtop-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-emtop-som.dtsi index 67d22d3768aa..507d1824d99d 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-emtop-som.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-emtop-som.dtsi @@ -60,7 +60,7 @@ pinctrl-names = ...
11e8d234d4be7af401e8a24e078005ecd9bc1d1a
Analyze and fix the following issue in the Linux kernel code: perf trace: Fix potential u64 underflow in duration calculation
Problem Details: Although it happens very rarely, in case of out-of-order events (i.e. due to CPU migration when a syscall is executed), the calculation of event duration might underflow and thus a bogus value is printed: 2.804 ( 0.001 ms): :49553/49553 rt_sigaction(sig: QUIT, act: 0x7fff403ed6e0, oact: 0x7fff403e...
```diff diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index d121640ace6e..873d144807e2 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -2960,7 +2960,7 @@ static int trace__sys_exit(struct trace *trace, struct evsel *evsel, ++trace->stats.vfs_getname; } - if (ttr...
5b402a8aceb15682457b7e65eef1a133d6dfe7e3
Analyze and fix the following issue in the Linux kernel code: scsi: lpfc: Add REG_VFI mailbox cmd error handling
Problem Details: If lpfc_issue_reg_vfi() returns an error in lpfc_rcv_plogi(), then execution of lpfc_rcv_plogi() continues and lpfc_reg_rpi() is called, which allocates an mbuf. When this REG_RPI mailbox is issued, it inevitably fails because the VFI is not registered. However, the REG_RPI failure does not free the ...
```diff diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 5e431928de0b..9c449055a55e 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -1,7 +1,7 @@ /******************************************************************* * This file is pa...
51f4e090b9f87b40c21b6daadb5c06e6c0a07b67
Analyze and fix the following issue in the Linux kernel code: net: stmmac: fix integer underflow in chain mode
Problem Details: The jumbo_frm() chain-mode implementation unconditionally computes len = nopaged_len - bmax; where nopaged_len = skb_headlen(skb) (linear bytes only) and bmax is BUF_SIZE_8KiB or BUF_SIZE_2KiB. However, the caller stmmac_xmit() decides to invoke jumbo_frm() based on skb->len (total length includ...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c index 120a009c9992..37f9417c7c0e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c +++ b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c @@ -20,7 +20,7 @@ static int jumbo_frm(struct stm...
6dede3967619b5944003227a5d09fdc21ed57d10
Analyze and fix the following issue in the Linux kernel code: net: altera-tse: fix skb leak on DMA mapping error in tse_start_xmit()
Problem Details: When dma_map_single() fails in tse_start_xmit(), the function returns NETDEV_TX_OK without freeing the skb. Since NETDEV_TX_OK tells the stack the packet was consumed, the skb is never freed, leaking memory on every DMA mapping failure. Add dev_kfree_skb_any() before returning to properly free the skb...
```diff diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 4342e2d026f8..9eed0be4411e 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -570,6 +570,7 @@ static netdev_tx_t tse_start_xmit(struct ...
2ba199067b89edcf4dcc760941b26753494eb668
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Cover invariant violation case from syzbot
Problem Details: This patch adds a selftest for the change in the previous patch. The selftest is derived from a syzbot reproducer from [1] (among the 22 reproducers on that page, only 4 still reproduced on latest bpf tree, all being small variants of the same invariant violation). The test case failure without the pr...
```diff diff --git a/tools/testing/selftests/bpf/progs/verifier_bounds.c b/tools/testing/selftests/bpf/progs/verifier_bounds.c index bb20f0f06f05..df7c62a12318 100644 --- a/tools/testing/selftests/bpf/progs/verifier_bounds.c +++ b/tools/testing/selftests/bpf/progs/verifier_bounds.c @@ -2165,4 +2165,33 @@ l0_%=: r0 = 0;...
b254c6d816e53ca02856b6f46b4dc56caf6e7713
Analyze and fix the following issue in the Linux kernel code: bpf: Simulate branches to prune based on range violations
Problem Details: This patch fixes the invariant violations that can happen after we refine ranges & tnum based on an incorrectly-detected branch condition. For example, the branch is always true, but we miss it in is_branch_taken; we then refine based on the branch being false and end up with incoherent ranges (e.g. um...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 8215355f6be0..a431b7d50e1b 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -16786,11 +16786,50 @@ static void find_good_pkt_pointers(struct bpf_verifier_state *vstate, })); } +static void regs_refine_cond_op(struct bpf_reg_s...
1821f77fdaec87b31bea950ca465a96601d78ab7
Analyze and fix the following issue in the Linux kernel code: scsi: aic7xxx: Fix compiler warnings triggered by user space code
Problem Details: Fix the following compiler warnings: aicasm_gram.y:1107:24: warning: comparison of different enumeration types ('scope_type' and 'enum yytokentype') [-Wenum-compare] 1107 | || last_scope->type == T_ELSE) { | ~~~~~~~~~~~~~~~~ ^ ~~~~~~ aicasm_scan.l:392...
```diff diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm.h b/drivers/scsi/aic7xxx/aicasm/aicasm.h index 716a2aefc925..f290b50c6475 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm.h +++ b/drivers/scsi/aic7xxx/aicasm/aicasm.h @@ -82,7 +82,7 @@ extern int src_mode; extern int dst_mode; struct symbol; -void stop(con...
23c29ca113e3838e9c8473c65dbc147bd058d757
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: ufs-qcom: Fix spelling mistake "retore" -> "restore"
Problem Details: There is a spelling mistake in a dev_err() message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Link: https://patch.msgid.link/20260331153049.1344957-1-colin.i.king@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@orac...
```diff diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 5a58ffef3d27..bc037db46624 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -2810,7 +2810,7 @@ static int ufs_qcom_get_rx_fom(struct ufs_hba *hba, /* Restore Power Mode. */ ret = ufshcd_change_power_mod...
85a9a4abcdc09ee941273c99d3ad0bc2ddef09ea
Analyze and fix the following issue in the Linux kernel code: perf header: Validate build_id filename length to prevent buffer overflow
Problem Details: The build_id parsing functions calculate a filename length from the event header size and read directly into a stack buffer of PATH_MAX bytes without bounds checking. A malformed perf.data file with a crafted header.size can cause the length to be negative or exceed PATH_MAX, resulting in a stack buffe...
```diff diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 9142a8ba4019..9ffc0f4ca6d1 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2545,6 +2545,11 @@ static int perf_header__read_build_ids_abi_quirk(struct perf_header *header, perf_event_header__bswap(&old_bev.header)...
3a61fd866ef9aaa1d3158b460f852b74a2df07f4
Analyze and fix the following issue in the Linux kernel code: perf expr: Return -EINVAL for syntax error in expr__find_ids()
Problem Details: expr__find_ids() propagates the parser return value directly. For syntax errors, the parser can return a positive value, but callers treat it as success, e.g., for below case on Arm64 platform: metric expr 100 * (STALL_SLOT_BACKEND / (CPU_CYCLES * #slots) - BR_MIS_PRED * 3 / CPU_CYCLES) for backend...
```diff diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c index 465fe2e9bbbe..b7664cb68554 100644 --- a/tools/perf/util/expr.c +++ b/tools/perf/util/expr.c @@ -376,7 +376,8 @@ int expr__find_ids(const char *expr, const char *one, if (one) expr__del_id(ctx, one); - return ret; + /* A positive value mea...
8e8cb6f39930e836144f51cdb6d409c9e4cb71fe
Analyze and fix the following issue in the Linux kernel code: scsi: hpsa: Enlarge controller and IRQ name buffers
Problem Details: hpsa formats the controller name into h->devname[8] and derives interrupt names from it in h->intrname[][16]. Once host_no reaches four digits, "hpsa%d" no longer fits in devname, and the derived IRQ names can then overrun the interrupt-name buffers as well. The previous fix switched these builders to...
```diff diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h index 99b0750850b2..f6bfe75dd696 100644 --- a/drivers/scsi/hpsa.h +++ b/drivers/scsi/hpsa.h @@ -164,7 +164,7 @@ struct bmic_controller_parameters { struct ctlr_info { unsigned int *reply_map; int ctlr; - char devname[8]; + char devname[16]; char *...
2fd68c7ea2ae741a4446d54c8a461255022e2dc7
Analyze and fix the following issue in the Linux kernel code: MAINTAINERS: orphan PPP over Ethernet driver
Problem Details: We haven't seen activities from Michal Ostrowski for quite a long time. The last commit from him is fb64bb560e18 ("PPPoE: Fix flush/close races."), which was in 2009. Email to mostrows@earthlink.net also bounces. Signed-off-by: Qingfang Deng <dqfext@gmail.com> Link: https://patch.msgid.link/2026040102...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index c3fe46d7c4bc..c6e226ae109d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21075,8 +21075,7 @@ F: include/uapi/linux/atmppp.h F: net/atm/pppoatm.c PPP OVER ETHERNET -M: Michal Ostrowski <mostrows@earthlink.net> -S: Maintained +S: Orphan F: drivers/net/ppp/pppoe.c...
1ef5789d9906df3771c99b7f413caaf2bf473ca5
Analyze and fix the following issue in the Linux kernel code: macvlan: annotate data-races around port->bc_queue_len_used
Problem Details: port->bc_queue_len_used is read and written locklessly, add READ_ONCE()/WRITE_ONCE() annotations. While WRITE_ONCE() in macvlan_fill_info() is not yet needed, it is a prereq for future RTNL avoidance. Fixes: d4bff72c8401 ("macvlan: Support for high multicast packet rate") Signed-off-by: Eric Dumazet ...
```diff diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index ea22909cb09d..bbb5c32541f9 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -356,6 +356,7 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port, const struct macvlan_dev *src, struct sk_buff *skb...
35ecb77ae0749a2f1b04872c9978d9d7ddbbeb79
Analyze and fix the following issue in the Linux kernel code: crypto: qat - use swab32 macro
Problem Details: Replace __builtin_bswap32() with swab32 in icp_qat_hw_20_comp.h to fix the following build errors on architectures without native byte-swap support: alpha-linux-ld: drivers/crypto/intel/qat/qat_common/adf_gen4_hw_data.o: in function `adf_gen4_build_decomp_block': drivers/crypto/intel/qat/qat_com...
```diff diff --git a/drivers/crypto/intel/qat/qat_common/icp_qat_hw_20_comp.h b/drivers/crypto/intel/qat/qat_common/icp_qat_hw_20_comp.h index 7ea8962272f2..d28732225c9e 100644 --- a/drivers/crypto/intel/qat/qat_common/icp_qat_hw_20_comp.h +++ b/drivers/crypto/intel/qat/qat_common/icp_qat_hw_20_comp.h @@ -3,6 +3,8 @@ ...
5469d16e71d65e2a71b68e0bb46eae63f9cb8965
Analyze and fix the following issue in the Linux kernel code: crypto: kconfig - fix typos in atmel-ecc and atmel-sha204a help
Problem Details: s/Microhip/Microchip/ Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
```diff diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 8d3b5d2890f8..16fa56898d35 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -490,7 +490,7 @@ config CRYPTO_DEV_ATMEL_ECC select CRYPTO_ECDH select CRC16 help - Microhip / Atmel ECC hw accelerator. + Microchip / Atmel...
590fa5d69c27cfaecd2e8287aec78f902417c877
Analyze and fix the following issue in the Linux kernel code: crypto: iaa - fix per-node CPU counter reset in rebalance_wq_table()
Problem Details: The cpu counter used to compute the IAA device index is reset to zero at the start of each NUMA node iteration. This causes CPUs on every node to map starting from IAA index 0 instead of continuing from the previous node's last index. On multi-node systems, this results in all nodes mapping their CPUs ...
```diff diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c index 547abf453d4a..f62b994e18e5 100644 --- a/drivers/crypto/intel/iaa/iaa_crypto_main.c +++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c @@ -906,8 +906,8 @@ static void rebalance_wq_table(void) return; } ...
ec23d75c4b77ae42af0777ea59599b1d4f611371
Analyze and fix the following issue in the Linux kernel code: crypto: qat - fix type mismatch in RAS sysfs show functions
Problem Details: ADF_RAS_ERR_CTR_READ() expands to atomic_read(), which returns int. The local variable 'counter' was declared as 'unsigned long', causing a type mismatch on the assignment. The format specifier '%ld' was consequently wrong in two ways: wrong length modifier and wrong signedness. Use int to match the r...
```diff diff --git a/drivers/crypto/intel/qat/qat_common/adf_sysfs_ras_counters.c b/drivers/crypto/intel/qat/qat_common/adf_sysfs_ras_counters.c index e97c67c87b3c..6abb57bfd328 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_sysfs_ras_counters.c +++ b/drivers/crypto/intel/qat/qat_common/adf_sysfs_ras_counters.c @...
795c24c677c7a1c12f5768daf22a874a2890662f
Analyze and fix the following issue in the Linux kernel code: crypto: qat - fix compression instance leak
Problem Details: qat_comp_alg_init_tfm() acquires a compression instance via qat_compression_get_instance_node() before calling qat_comp_build_ctx() to initialize the compression context. If qat_comp_build_ctx() fails, the function returns an error without releasing the compression instance, causing a resource leak. W...
```diff diff --git a/drivers/crypto/intel/qat/qat_common/qat_comp_algs.c b/drivers/crypto/intel/qat/qat_common/qat_comp_algs.c index 1265177e3a89..bfc820a08ada 100644 --- a/drivers/crypto/intel/qat/qat_common/qat_comp_algs.c +++ b/drivers/crypto/intel/qat/qat_common/qat_comp_algs.c @@ -133,7 +133,7 @@ static int qat_co...
f216e0f2d1787e662bb6662c9c522185aa3b855a
Analyze and fix the following issue in the Linux kernel code: crypto: qat - disable 420xx AE cluster when lead engine is fused off
Problem Details: The get_ae_mask() function only disables individual engines based on the fuse register, but engines are organized in clusters of 4. If the lead engine of a cluster is fused off, the entire cluster must be disabled. Replace the single bitmask inversion with explicit test_bit() checks on the lead engine...
```diff diff --git a/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c b/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c index 35105213d40c..0002122219bc 100644 --- a/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c +++ b/drivers/crypto/intel/qat/qat_420xx/adf_420xx_hw_data.c @@ -97,9 +97,25 @@ static...
b260d53561dd69b29505222ec44cf386ac2c2ca6
Analyze and fix the following issue in the Linux kernel code: crypto: qat - disable 4xxx AE cluster when lead engine is fused off
Problem Details: The get_ae_mask() function only disables individual engines based on the fuse register, but engines are organized in clusters of 4. If the lead engine of a cluster is fused off, the entire cluster must be disabled. Replace the single bitmask inversion with explicit test_bit() checks on the lead engine...
```diff diff --git a/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c b/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c index 740f68a36ac5..900f19b90b2d 100644 --- a/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c +++ b/drivers/crypto/intel/qat/qat_4xxx/adf_4xxx_hw_data.c @@ -100,9 +100,19 @@ static struc...
8eceab19eba9dcbfd2a0daec72e1bf48aa100170
Analyze and fix the following issue in the Linux kernel code: crypto: af_alg - limit RX SG extraction by receive buffer budget
Problem Details: Make af_alg_get_rsgl() limit each RX scatterlist extraction to the remaining receive buffer budget. af_alg_get_rsgl() currently uses af_alg_readable() only as a gate before extracting data into the RX scatterlist. Limit each extraction to the remaining af_alg_rcvbuf(sk) budget so that receive-side acc...
```diff diff --git a/crypto/af_alg.c b/crypto/af_alg.c index 8e0199394984..437f3e77c7e0 100644 --- a/crypto/af_alg.c +++ b/crypto/af_alg.c @@ -1229,6 +1229,8 @@ int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags, seglen = min_t(size_t, (maxsize - len), msg_data_left(msg)); + /* Never pi...
7487d8db3336839567aabae24618a4f2f2f2adad
Analyze and fix the following issue in the Linux kernel code: vfio/pci: Require vfio_device_ops.name
Problem Details: vfio-pci-core code makes use of the vfio_device_ops.name field in order to set a default driver_override for VFs created on a user-owned PF. This avoids default driver matching, which might otherwise bind those VFs to native drivers. The mechanism for this currently uses kasprintf(), which will set dr...
```diff diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index d43745fe4c84..84d60689d386 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -2139,6 +2139,10 @@ int vfio_pci_core_register_device(struct vfio_pci_core_device *vdev) if (WARN_ON(vdev !=...
c8717a7fa5d2ea9048f398c16ab61d8e4c8f83b8
Analyze and fix the following issue in the Linux kernel code: ecryptfs: Fix typo in ecryptfs_derive_iv function comment
Problem Details: s/vale/value/ Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Tyler Hicks <code@tyhicks.com>
```diff diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 3cc4afb8b10d..a7511acc593e 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c @@ -72,7 +72,7 @@ out: /** * ecryptfs_derive_iv - * @iv: destination for the derived iv vale + * @iv: destination for the derived iv value * @crypt_stat: ...
63f5156a9c3e85ecfcc0127df6069cd7baa7eeb0
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Improve task local data documentation and fix potential memory leak
Problem Details: If TLD_FREE_DATA_ON_THREAD_EXIT is not enabled in a translation unit that calls __tld_create_key() first, another translation unit that enables it will not get the auto cleanup feature as pthread key is only created once when allocation metadata. Fix it by always try to create the pthread key when __tl...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/task_local_data.h b/tools/testing/selftests/bpf/prog_tests/task_local_data.h index 91f3486439bf..1e5c67c78ffb 100644 --- a/tools/testing/selftests/bpf/prog_tests/task_local_data.h +++ b/tools/testing/selftests/bpf/prog_tests/task_local_data.h @@ -22,14 +22,17 ...
7c8ca532a7413b9ecf533d870641e9cff333d685
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix task_local_data data allocation size
Problem Details: Currently, when allocating memory for data, size of tld_data_u->start is not taken into account. This may cause OOB access. Fixed it by adding the non-flexible array part of tld_data_u. Besides, explicitly align tld_data_u->data to 8 bytes in case some fields are added before data in the future. It co...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/task_local_data.h b/tools/testing/selftests/bpf/prog_tests/task_local_data.h index 7819f318b2fb..a52d8b549425 100644 --- a/tools/testing/selftests/bpf/prog_tests/task_local_data.h +++ b/tools/testing/selftests/bpf/prog_tests/task_local_data.h @@ -90,7 +90,7 @@...
83a679d61e8d18787ddc6c2f406546bb80dd2a8d
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: talos/qcs615-ride: Fix inconsistent USB PHY node naming
Problem Details: The USB PHY nodes has inconsistent labels as 'usb_1_hsphy' and 'usb_hsphy_2' across talos.dtsi and qcs615-ride.dts. This patch renames them to follow a consistent naming scheme. No functional changes, only label renaming. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by...
```diff diff --git a/arch/arm64/boot/dts/qcom/qcs615-ride.dts b/arch/arm64/boot/dts/qcom/qcs615-ride.dts index be22c4cf868b..7e05f873194a 100644 --- a/arch/arm64/boot/dts/qcom/qcs615-ride.dts +++ b/arch/arm64/boot/dts/qcom/qcs615-ride.dts @@ -642,7 +642,7 @@ status = "okay"; }; -&usb_hsphy_2 { +&usb_2_hsphy { vd...
1cc96e0e20489159398009d2f453e59c10e413c9
Analyze and fix the following issue in the Linux kernel code: libbpf: Fix BTF handling in bpf_program__clone()
Problem Details: Align bpf_program__clone() with bpf_object_load_prog() by gating BTF func/line info on FEAT_BTF_FUNC kernel support, and resolve caller-provided prog_btf_fd before checking obj->btf so that callers with their own BTF can use clone() even when the object has no BTF loaded. While at it, treat func_info ...
```diff diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 9ea41f40dc82..589085466903 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -9852,7 +9852,9 @@ int bpf_program__clone(struct bpf_program *prog, const struct bpf_prog_load_opts { LIBBPF_OPTS(bpf_prog_load_opts, attr); stru...
eb27e1c885ea75c1661188a548d100c8bce5970a
Analyze and fix the following issue in the Linux kernel code: perf test: Skip perf data type profiling tests for s390
Problem Details: Test case 'perf data type profiling tests' fails on s390 with this error: # ./perf mem record -- ./perf test -w code_with_type failed: no PMU supports the memory events # echo $? 255 # because s390 does not support memory events at all. According to the man page, perf annotate --code-with-t...
```diff diff --git a/tools/perf/tests/shell/data_type_profiling.sh b/tools/perf/tests/shell/data_type_profiling.sh index fb47b7213b33..eca694600a04 100755 --- a/tools/perf/tests/shell/data_type_profiling.sh +++ b/tools/perf/tests/shell/data_type_profiling.sh @@ -15,6 +15,10 @@ err=0 perfdata=$(mktemp /tmp/__perf_test....
77cb9b443b7fff2a93d78cd2e309db030046772f
Analyze and fix the following issue in the Linux kernel code: perf test: Fix ratio_to_prev event parsing test
Problem Details: test__ratio_to_prev() assumed the first event in a group is the leader, which is not the case when the event is expanded into two event groups on hybrid PMU's with auto counter reload support. Instead, iterate over the event group generated for each core PMU. Also update "wrong leader" test to check th...
```diff diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 1d3cc224fbc2..05c3e899b425 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -1796,31 +1796,38 @@ static bool test__acr_valid(void) static int test__ratio_to_prev(struct evlist *evlist) {...
9a82bfde4775b7a87cd1a7e791f46f83ae442848
Analyze and fix the following issue in the Linux kernel code: perf tools: Fix module symbol resolution for non-zero .text sh_addr
Problem Details: When perf resolves symbols from kernel module ELF files (ET_REL), it converts symbol addresses to file offsets so that sample IPs can be matched to the correct symbol. The conversion adjusts each symbol's st_value: sym->st_value -= shdr->sh_addr - shdr->sh_offset; For vmlinux (ET_EXEC), st_value is...
```diff diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 3cd4e5a03cc5..7afa8a117139 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -1354,8 +1354,12 @@ static int dso__process_kernel_symbol(struct dso *dso, struct map *map, char dso_name[PATH_MAX]; /* ...
b5708a308a5602d4a3caf0720dce452082d443ec
Analyze and fix the following issue in the Linux kernel code: perf stat: Fix crash on arm64
Problem Details: Perf stat is crashing on arm64 hosts with the following issue: # make -C tools/perf DEBUG=1 # perf stat sleep 1 perf: util/evsel.c:2034: get_group_fd: Assertion `!(!leader->core.fd)' failed. [1] 1220794 IOT instruction (core dumped) ./perf stat The sorting function introduced by commit a7...
```diff diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index a24326c44297..35934e8bbd51 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1932,25 +1932,33 @@ static int default_evlist_evsel_cmp(void *priv __maybe_unused, const struct evsel *lhs = container_of(lhs_core, str...
15bfba1ad77fad8e45a37aae54b3c813b33fe27c
Analyze and fix the following issue in the Linux kernel code: arm64: mm: Handle invalid large leaf mappings correctly
Problem Details: It has been possible for a long time to mark ptes in the linear map as invalid. This is done for secretmem, kfence, realm dma memory un/share, and others, by simply clearing the PTE_VALID bit. But until commit a166563e7ec37 ("arm64: mm: support large block mapping when rodata=full") large leaf mappings...
```diff diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h index f560e6420267..212ce1b02e15 100644 --- a/arch/arm64/include/asm/pgtable-prot.h +++ b/arch/arm64/include/asm/pgtable-prot.h @@ -25,6 +25,8 @@ */ #define PTE_PRESENT_INVALID (PTE_NG) /* only when !PTE_VALID */ +...
f12b435de2f2bb09ce406467020181ada528844c
Analyze and fix the following issue in the Linux kernel code: arm64: mm: Fix rodata=full block mapping support for realm guests
Problem Details: Commit a166563e7ec37 ("arm64: mm: support large block mapping when rodata=full") enabled the linear map to be mapped by block/cont while still allowing granular permission changes on BBML2_NOABORT systems by lazily splitting the live mappings. This mechanism was intended to be usable by realm guests si...
```diff diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h index 137a173df1ff..472610433aae 100644 --- a/arch/arm64/include/asm/mmu.h +++ b/arch/arm64/include/asm/mmu.h @@ -112,5 +112,7 @@ void kpti_install_ng_mappings(void); static inline void kpti_install_ng_mappings(void) {} #endif +extern ...
07712db80857d5d09ae08f3df85a708ecfc3b61f
Analyze and fix the following issue in the Linux kernel code: eventpoll: defer struct eventpoll free to RCU grace period
Problem Details: In certain situations, ep_free() in eventpoll.c will kfree the epi->ep eventpoll struct while it still being used by another concurrent thread. Defer the kfree() to an RCU callback to prevent UAF. Fixes: f2e467a48287 ("eventpoll: Fix semi-unbounded recursion") Signed-off-by: Nicholas Carlini <nicholas...
```diff diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 5714e900567c..4b43bf41296d 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -226,6 +226,9 @@ struct eventpoll { */ refcount_t refcount; + /* used to defer freeing past ep_get_upwards_depth_proc() RCU walk */ + struct rcu_head rcu; + #ifdef CONFIG_NET...
c636ae346d196b71e972188f91b3260ae522ade6
Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Trigger recovery on TDR with OS scheduling
Problem Details: With OS scheduling mode the driver cannot determine which context caused the timeout, so context abort cannot be used. Instead of queuing context_abort_work, directly trigger full device recovery when a job timeout (TDR) occurs in OS scheduling mode. Fixes: ade00a6c903f ("accel/ivpu: Perform engine re...
```diff diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c index 83da9b297f37..c1ce8329790e 100644 --- a/drivers/accel/ivpu/ivpu_pm.c +++ b/drivers/accel/ivpu/ivpu_pm.c @@ -221,6 +221,12 @@ static void ivpu_job_timeout_work(struct work_struct *work) abort: atomic_set(&vdev->job_timeout_counte...
0c4a59df370bea245695c00aaae6ae75747139bd
Analyze and fix the following issue in the Linux kernel code: sched_ext: Fix is_bpf_migration_disabled() false negative on non-PREEMPT_RCU
Problem Details: Since commit 8e4f0b1ebcf2 ("bpf: use rcu_read_lock_dont_migrate() for trampoline.c"), the BPF prolog (__bpf_prog_enter) calls migrate_disable() only when CONFIG_PREEMPT_RCU is enabled, via rcu_read_lock_dont_migrate(). Without CONFIG_PREEMPT_RCU, the prolog never touches migration_disabled, so migratio...
```diff diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c index 0ae93cd64004..44c3a50c542c 100644 --- a/kernel/sched/ext_idle.c +++ b/kernel/sched/ext_idle.c @@ -860,25 +860,32 @@ static bool check_builtin_idle_enabled(struct scx_sched *sch) * code. * * We can't simply check whether @p->migration_dis...
b905ee77d5f557a83a485b4146210f54f13365fc
Analyze and fix the following issue in the Linux kernel code: sched_ext: Fix missing warning in scx_set_task_state() default case
Problem Details: In scx_set_task_state(), the default case was setting the warn flag, but then returning immediately. This is problematic because the only purpose of the warn flag is to trigger WARN_ONCE, but the early return prevented it from ever firing, leaving invalid task states undetected and untraced. To fix th...
```diff diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 9628c64e5592..0253887e63c0 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -3538,7 +3538,8 @@ static void scx_set_task_state(struct task_struct *p, u32 state) warn = prev_state != SCX_TASK_READY; break; default: - warn = true; + WA...
da6fcc6dbddbef80e603d2f0c1554a9f2ac03742
Analyze and fix the following issue in the Linux kernel code: fuse: fuse_dev_ioctl_clone() should wait for device file to be initialized
Problem Details: Use fuse_get_dev() not __fuse_get_dev() on the old fd, since in the case of synchronous INIT the caller will want to wait for the device file to be available for cloning, just like I/O wants to wait instead of returning an error. Fixes: dfb84c330794 ("fuse: allow synchronous FUSE_INIT") Cc: stable@vge...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index b212565a78cf..8d5bab05adf4 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -2597,9 +2597,8 @@ static int fuse_device_clone(struct fuse_conn *fc, struct file *new) static long fuse_dev_ioctl_clone(struct file *file, __u32 __user *argp) { - int res; int old...
b55dfb173ce808ecc8c598f2c378a9b04c5ce241
Analyze and fix the following issue in the Linux kernel code: net: stmmac: move check for hardware checksum supported
Problem Details: Add a check in .ndo_features_check() to indicate whether hardware checksum can be performed on the skbuff. Where hardware checksum is not supported - either because the channel does not support Tx COE or the skb isn't suitable (stmmac uses a tighter test than can_checksum_protocol()) we also need to di...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ce6c3cc71bf0..e88107a0baf2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4757,22 +4757,6 @@ static netdev_tx_t stm...
e32820264c2949a3e75bc5083e49c885e3bbaf62
Analyze and fix the following issue in the Linux kernel code: net: stmmac: fix TSO support when some channels have TBS available
Problem Details: According to the STM32MP25xx manual, which is dwmac v5.3, TBS (time based scheduling) is not permitted for channels which have hardware TSO enabled. Intel's commit 5e6038b88a57 ("net: stmmac: fix TSO and TBS feature enabling during driver open") concurs with this, but it is incomplete. This commit avo...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index f76ed64fb9e6..729072622fcb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3619,6 +3619,17 @@ static void stmmac_saf...
afe840ddf15c9960e4c4522c95dea459f4fa055b
Analyze and fix the following issue in the Linux kernel code: net: stmmac: fix .ndo_fix_features()
Problem Details: netdev features documentation requires that .ndo_fix_features() is stateless: it shouldn't modify driver state. Yet, stmmac_fix_features() does exactly that, changing whether GSO frames are processed by the driver. Move this code to stmmac_set_features() instead, which is the correct place for it. We ...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 52864561f14e..f76ed64fb9e6 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6073,14 +6073,6 @@ static netdev_features...
989a9c20f63e378e0bb8b05bf82560d7da945de4
Analyze and fix the following issue in the Linux kernel code: net: stmmac: fix channel TSO enable on resume
Problem Details: Rather than configuring the channels depending on whether GSO/TSO is currently enabled by the user, always enable if the hardware has TSO support and the platform wants TSO to be enabled. This avoids the channel TSO enable bit being disabled after a resume when the user has disabled TSO features. This...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 35cf4491ec16..52864561f14e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3705,7 +3705,7 @@ static int stmmac_hw_se...
87ac077d6ea8613b7c1debdf3b5e92c78618fd23
Analyze and fix the following issue in the Linux kernel code: ntfs3: fix memory leak in indx_create_allocate()
Problem Details: When indx_create_allocate() fails after attr_allocate_clusters() succeeds, run_deallocate() frees the disk clusters but never frees the memory allocated by run_add_entry() via kvmalloc() for the runs_tree structure. Fix this by adding run_close() at the out: label to free the run.runs memory on all er...
```diff diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c index 8b107b6714ce..5344b29b0577 100644 --- a/fs/ntfs3/index.c +++ b/fs/ntfs3/index.c @@ -1482,6 +1482,7 @@ out1: run_deallocate(sbi, &run, false); out: + run_close(&run); return err; } ```
445588a3b18bb0702d746cb61f7a443639027651
Analyze and fix the following issue in the Linux kernel code: PCI: dwc: Fix type mismatch for kstrtou32_from_user() return value
Problem Details: kstrtou32_from_user() returns int, but the return value was stored in a u32 variable 'val', risking sign loss. Use a dedicated int variable to correctly handle the return code. Fixes: 4fbfa17f9a07 ("PCI: dwc: Add debugfs based Silicon Debug support for DWC") Signed-off-by: Hans Zhang <18255117159@163....
```diff diff --git a/drivers/pci/controller/dwc/pcie-designware-debugfs.c b/drivers/pci/controller/dwc/pcie-designware-debugfs.c index 2efddb21b2b2..d0884253be97 100644 --- a/drivers/pci/controller/dwc/pcie-designware-debugfs.c +++ b/drivers/pci/controller/dwc/pcie-designware-debugfs.c @@ -258,10 +258,11 @@ static ssiz...
179ee84a89114b854ac2dd1d293633a7f6c8dac1
Analyze and fix the following issue in the Linux kernel code: bpf: Fix incorrect pruning due to atomic fetch precision tracking
Problem Details: When backtrack_insn encounters a BPF_STX instruction with BPF_ATOMIC and BPF_FETCH, the src register (or r0 for BPF_CMPXCHG) also acts as a destination, thus receiving the old value from the memory location. The current backtracking logic does not account for this. It treats atomic fetch operations th...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index df04dccfc540..e3814152b52f 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -617,6 +617,13 @@ static bool is_atomic_load_insn(const struct bpf_insn *insn) insn->imm == BPF_LOAD_ACQ; } +static bool is_atomic_fetch_insn(...
eb7024bfcc5f68ed11ed9dd4891a3073c15f04a8
Analyze and fix the following issue in the Linux kernel code: bpf: Reject sleepable kprobe_multi programs at attach time
Problem Details: kprobe.multi programs run in atomic/RCU context and cannot sleep. However, bpf_kprobe_multi_link_attach() did not validate whether the program being attached had the sleepable flag set, allowing sleepable helpers such as bpf_copy_from_user() to be invoked from a non-sleepable context. This causes a "s...
```diff diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 0b040a417442..af7079aa0f36 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -2752,6 +2752,10 @@ int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr if (!is_kprobe_multi(prog)) return -...
b0db1accbc7395657c2b79db59fa9fae0d6656f3
Analyze and fix the following issue in the Linux kernel code: bpf: reject direct access to nullable PTR_TO_BUF pointers
Problem Details: check_mem_access() matches PTR_TO_BUF via base_type() which strips PTR_MAYBE_NULL, allowing direct dereference without a null check. Map iterator ctx->key and ctx->value are PTR_TO_BUF | PTR_MAYBE_NULL. On stop callbacks these are NULL, causing a kernel NULL dereference. Add a type_may_be_null() guar...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index a3388cb8fcbd..df04dccfc540 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -7905,7 +7905,8 @@ static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regn } else if (reg->type == CONST_PTR_TO_MAP) { err =...
c03791085adcd61fa9b766ab303c7d0941d7378d
Analyze and fix the following issue in the Linux kernel code: cpufreq: Pass the policy to cpufreq_driver->adjust_perf()
Problem Details: cpufreq_cpu_get() can sleep on PREEMPT_RT in presence of concurrent writer(s), however amd-pstate depends on fetching the cpudata via the policy's driver data which necessitates grabbing the reference. Since schedutil governor can call "cpufreq_driver->update_perf()" during sched_tick/enqueue/dequeue ...
```diff diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 2ea4d27fe020..c825fab0bf5c 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -788,13 +788,12 @@ static unsigned int amd_pstate_fast_switch(struct cpufreq_policy *policy, return policy->cur; } -stati...
da77f3a9aa55575cdc74aa5736f31ce6b4091cf7
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add test to verify the fix of kprobe_write_ctx abuse
Problem Details: Add a test to verify the issue: kprobe_write_ctx can be abused to modify struct pt_regs of kernel functions via kprobe_write_ctx=true freplace progs. Without the fix, the issue is verified: kprobe_write_ctx=true freplace prog is allowed to attach to kprobe_write_ctx=false kprobe prog. Then, the first...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/attach_probe.c b/tools/testing/selftests/bpf/prog_tests/attach_probe.c index 9e77e5da7097..38852df70c0d 100644 --- a/tools/testing/selftests/bpf/prog_tests/attach_probe.c +++ b/tools/testing/selftests/bpf/prog_tests/attach_probe.c @@ -220,11 +220,73 @@ static ...
611fe4b79af72d00d80f2223354284447daafae9
Analyze and fix the following issue in the Linux kernel code: bpf: Fix abuse of kprobe_write_ctx via freplace
Problem Details: uprobe programs are allowed to modify struct pt_regs. Since the actual program type of uprobe is KPROBE, it can be abused to modify struct pt_regs via kprobe+freplace when the kprobe attaches to kernel functions. For example, SEC("?kprobe") int kprobe(struct pt_regs *regs) { return 0; } SEC("?frep...
```diff diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 51ade3cde8bb..e1505c9cd09e 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -3733,6 +3733,23 @@ static int bpf_tracing_prog_attach(struct bpf_prog *prog, tr = prog->aux->dst_trampoline; tgt_prog = prog->aux->dst_prog; } + /* +...
a362ae6e7e85bca4c870c37085d7793c4beec360
Analyze and fix the following issue in the Linux kernel code: Documentation: amd-pstate: fix dead links in the reference section
Problem Details: The links for AMD64 Architecture Programmer's Manual and PPR for AMD Family 19h Model 51h, Revision A1 Processors redirect to a generic page. Update the links to the working ones. Signed-off-by: Ninad Naik <ninadnaik07@gmail.com> Link: https://lore.kernel.org/r/20260330190855.1115304-1-ninadnaik07@gma...
```diff diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index d6c2f233ab23..b43675b7f739 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -826,13 +826,13 @@ Reference =========== .. [1] AMD64 Architec...
a5bc4c44aeec2920931e17db7f93965fcd69ee2f
Analyze and fix the following issue in the Linux kernel code: Documentation/amd-pstate: List amd_pstate_prefcore_ranking sysfs file
Problem Details: Add the missing amd_pstate_prefcore_ranking filenames in the sysfs listing example leading to the descriptions of these parameters. Clarify when will the file be visible. Fixes: 15a2b764ea7c ("amd-pstate: Add missing documentation for `amd_pstate_prefcore_ranking`") Reviewed-by: Mario Limonciello (AMD...
```diff diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index b8c846cbf301..b31a478c28ba 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -242,6 +242,7 @@ control its functionality at the system level. Th...
7e1cf24efba4b59a275e87372267dadcb7fd1850
Analyze and fix the following issue in the Linux kernel code: Documentation/amd-pstate: List amd_pstate_hw_prefcore sysfs file
Problem Details: Add the missing amd_pstate_hw_prefcore filenames in the sysfs listing example leading to the descriptions of these parameters. Clarify when will the file be visible. Fixes: b96b82d1af7f ("cpufreq: amd-pstate: Add documentation for `amd_pstate_hw_prefcore`") Reviewed-by: Mario Limonciello (AMD) <superm...
```diff diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index e1771f2225d5..b8c846cbf301 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -239,6 +239,7 @@ control its functionality at the system level. Th...
fcc25a291fbdca2c06c2c6602532050873f0c9de
Analyze and fix the following issue in the Linux kernel code: amd-pstate: Update cppc_req_cached in fast_switch case
Problem Details: The function msr_update_perf() does not cache the new value that is written to MSR_AMD_CPPC_REQ into the variable cpudata->cppc_req_cached when the update is happening from the fast path. Fix that by caching the value everytime the MSR_AMD_CPPC_REQ gets updated. This issue was discovered by Claude Op...
```diff diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index d57969c72c9d..24cdeffbcd40 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -261,7 +261,6 @@ static int msr_update_perf(struct cpufreq_policy *policy, u8 min_perf, if (fast_switch) { wrmsrq(MSR_A...
beda3b363546a423e4e29a7395e04c0ac4ff677e
Analyze and fix the following issue in the Linux kernel code: amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init()
Problem Details: On failure to set the epp, the function amd_pstate_epp_cpu_init() returns with an error code without freeing the cpudata object that was allocated at the beginning of the function. Ensure that the cpudata object is freed before returning from the function. This memory leak was discovered by Claude Op...
```diff diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 5aa9fcd80cf5..d57969c72c9d 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1533,7 +1533,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) ret = amd_pstate_set_epp(policy, cpud...
01968164d94762db2f703647c5acfa28613844f1
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to preserve previous reserve_{blocks,node} value when remount
Problem Details: The following steps will change previous value of reserve_{blocks,node}, this dones not match the original intention. 1.mount -t f2fs -o reserve_root=8192 imgfile test_mount/ F2FS-fs (loop56): Mounted with checkpoint version = 1b69f8c7 mount info: /dev/block/loop56 on /data/test_mount type f2fs (xxx,r...
```diff diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index e20e95696af4..5b552f08fe7b 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1515,6 +1515,7 @@ static int f2fs_check_opt_consistency(struct fs_context *fc, F2FS_OPTION(sbi).root_reserved_blocks); ctx_clear_opt(ctx, F2FS_MOUNT_RESERVE_ROOT); ctx...
02d91398a602c394d72cd61a67c84e2730c5f79b
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to freeze GC and discard threads quickly
Problem Details: Suspend can fail if kernel threads do not freeze for a while. f2fs_gc and f2fs_discard threads can perform long-running operations that prevent them from reaching a freeze point in a timely manner. This patch adds explicit freezing checks in the following locations: 1. f2fs_gc: Added a check at the 'r...
```diff diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 4bfc4452f299..e60c1106f70b 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1895,12 +1895,18 @@ freed: sbi->next_victim_seg[gc_type] = (cur_segno + 1 < sec_end_segno) ? cur_segno + 1 : NULL_SEGNO; + + if (unlikely(freezing(current))) { + folio...
7b9161a605e91d0987e2596a245dc1f21621b23f
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to avoid uninit-value access in f2fs_sanity_check_node_footer
Problem Details: syzbot reported a f2fs bug as below: BUG: KMSAN: uninit-value in f2fs_sanity_check_node_footer+0x374/0xa20 fs/f2fs/node.c:1520 f2fs_sanity_check_node_footer+0x374/0xa20 fs/f2fs/node.c:1520 f2fs_finish_read_bio+0xe1e/0x1d60 fs/f2fs/data.c:177 f2fs_read_end_io+0x6ab/0x2220 fs/f2fs/data.c:-1 bio_endi...
```diff diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 0e108c701aa3..a210a7a627c6 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -173,7 +173,8 @@ static void f2fs_finish_read_bio(struct bio *bio, bool in_task) while (nr_pages--) dec_page_count(F2FS_F_SB(folio), __read_io_type(folio)); - if (F2FS_F_SB...
6a5e3de9c2bb0b691d16789a5d19e9276a09b308
Analyze and fix the following issue in the Linux kernel code: f2fs: fix false alarm of lockdep on cp_global_sem lock
Problem Details: lockdep reported a potential deadlock: a) TCMU device removal context: - call del_gendisk() to get q->q_usage_counter - call start_flush_work() to get work_completion of wb->dwork b) f2fs writeback context: - in wb_workfn(), which holds work_completion of wb->dwork - call f2fs_balance_fs() to get ...
```diff diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 39b97621456a..56c4af4b1737 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -2042,6 +2042,9 @@ struct f2fs_sb_info { spinlock_t iostat_lat_lock; struct iostat_lat_info *iostat_io_lat; #endif +#ifdef CONFIG_DEBUG_LOCK_ALLOC + struct lock_class_key cp_glo...
238e14eb7226f883b72caccd2d37bf5707df066b
Analyze and fix the following issue in the Linux kernel code: f2fs: fix data loss caused by incorrect use of nat_entry flag
Problem Details: Data loss can occur when fsync is performed on a newly created file (before any checkpoint has been written) concurrently with a checkpoint operation. The scenario is as follows: create & write & fsync 'file A' write checkpoint - f2fs_do_sync_file // inline inode - f2fs_write_inode //...
```diff diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index a9cd2803e681..662a61306ec6 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -427,7 +427,9 @@ bool f2fs_need_inode_block_update(struct f2fs_sb_info *sbi, nid_t ino) struct f2fs_nm_info *nm_i = NM_I(sbi); struct nat_entry *e; bool need_update = true; + s...
dccd324fa9bd1a2907a63fa4cc2651f687b2b5d0
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to skip empty sections in f2fs_get_victim
Problem Details: In age-based victim selection (ATGC, AT_SSR, or GC_CB), f2fs_get_victim can encounter sections with zero valid blocks. This situation often arises when checkpoint is disabled or due to race conditions between SIT updates and dirty list management. In such cases, f2fs_get_section_mtime() returns INVALI...
```diff diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 80b8500fa987..4bfc4452f299 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -910,6 +910,9 @@ retry: if (!f2fs_segment_has_free_slot(sbi, segno)) goto next; } + + if (!get_valid_blocks(sbi, segno, true)) + goto next; } if (gc_type == BG_GC...
fe9b8b30b97102859a9102be7bd2a09803bd90bd
Analyze and fix the following issue in the Linux kernel code: f2fs: fix inline data not being written to disk in writeback path
Problem Details: When f2fs_fiemap() is called with `fileinfo->fi_flags` containing the FIEMAP_FLAG_SYNC flag, it attempts to write data to disk before retrieving file mappings via filemap_write_and_wait(). However, there is an issue where the file does not get mapped as expected. The following scenario can occur: root...
```diff diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index df4cdf804376..39b97621456a 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3946,6 +3946,8 @@ int f2fs_sanity_check_node_footer(struct f2fs_sb_info *sbi, enum node_type ntype, bool in_irq); struct folio *f2fs_get_inode_folio(struct f2fs_sb_info *sbi,...
c3e238bd1f56993f205ef83889d406dfeaf717a8
Analyze and fix the following issue in the Linux kernel code: f2fs: fix fsck inconsistency caused by FGGC of node block
Problem Details: During FGGC node block migration, fsck may incorrectly treat the migrated node block as fsync-written data. The reproduction scenario: root@vm:/mnt/f2fs# seq 1 2048 | xargs -n 1 ./test_sync // write inline inode and sync root@vm:/mnt/f2fs# rm -f 1 root@vm:/mnt/f2fs# sync root@vm:/mnt/f2fs# f2fs_io gc_...
```diff diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 630fd3b43a08..c7499cb52745 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1727,9 +1727,10 @@ continue_unlock: return last_folio; } -static bool __write_node_folio(struct folio *folio, bool atomic, bool *submitted, - struct writeback_control *wbc, ...
019f9dda7f66e55eb94cd32e1d3fff5835f73fbc
Analyze and fix the following issue in the Linux kernel code: f2fs: fix fsck inconsistency caused by incorrect nat_entry flag usage
Problem Details: f2fs_need_dentry_mark() reads nat_entry flags without mutual exclusion with the checkpoint path, which can result in an incorrect inode block marking state. The scenario is as follows: create & write & fsync 'file A' write checkpoint - f2fs_do_sync_file // inline inode - f2fs_write_in...
```diff diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index e027c388207f..630fd3b43a08 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1799,13 +1799,12 @@ static bool __write_node_folio(struct folio *folio, bool atomic, bool *submitted goto redirty_out; } - if (atomic) { - if (!test_opt(sbi, NOBARRIER)) - ...
6af249c996f7d73a3435f9e577956fa259347d18
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to do sanity check on dcc->discard_cmd_cnt conditionally
Problem Details: Syzbot reported a f2fs bug as below: ------------[ cut here ]------------ kernel BUG at fs/f2fs/segment.c:1900! Oops: invalid opcode: 0000 [#1] SMP KASAN PTI CPU: 1 UID: 0 PID: 6527 Comm: syz.5.110 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute ...
```diff diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 04891aaf476f..df4cdf804376 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3988,7 +3988,7 @@ bool f2fs_is_checkpointed_data(struct f2fs_sb_info *sbi, block_t blkaddr); int f2fs_start_discard_thread(struct f2fs_sb_info *sbi); void f2fs_drop_discard_cmd(st...
1ec8bea903f439acca927144570e1e419d2f9c9a
Analyze and fix the following issue in the Linux kernel code: KVM: riscv: selftests: Implement kvm_arch_has_default_irqchip
Problem Details: kvm_arch_has_default_irqchip is required for irqfd_test and returns true if an in-kernel interrupt controller is supported. Fixes: a133052666bed ("KVM: selftests: Fix irqfd_test for non-x86 architectures") Signed-off-by: Mayuresh Chitale <mayuresh.chitale@oss.qualcomm.com> Link: https://lore.kernel.or...
```diff diff --git a/tools/testing/selftests/kvm/lib/riscv/processor.c b/tools/testing/selftests/kvm/lib/riscv/processor.c index 51dd455ff52c..067c6b2c15b0 100644 --- a/tools/testing/selftests/kvm/lib/riscv/processor.c +++ b/tools/testing/selftests/kvm/lib/riscv/processor.c @@ -566,3 +566,8 @@ unsigned long riscv64_get...
ec7067e661193403a7a00980bda8612db5954142
Analyze and fix the following issue in the Linux kernel code: eth: fbnic: Increase FBNIC_QUEUE_SIZE_MIN to 64
Problem Details: On systems with 64K pages, RX queues will be wedged if users set the descriptor count to the current minimum (16). Fbnic fragments large pages into 4K chunks, and scales down the ring size accordingly. With 64K pages and 16 descriptors, the ring size mask is 0 and will never be filled. 32 descriptors ...
```diff diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h index 980965274079..e03c9d2c38dc 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h @@ -38,7 +38,7 @@ struct fbnic_net; #define FBNIC_MAX_XDPQS 12...
8f542c7c4aa969331b9be2bad1a1c29883555ab8
Analyze and fix the following issue in the Linux kernel code: ASoC: qcom: qdapm-lpass-dai: correct the error message
Problem Details: Fix the error message to reflect the actual graph stop error instead of graph close error. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20260402081118.348071-11-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.or...
```diff diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c index ba64117b8cfe..87f6db12003e 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -150,7 +150,7 @@ static void q6apm_lpass_dai_shutdown(struct snd_pcm_substream *su...
cab45ab95ce7600fc0ff84585c77fd45b7b0d67c
Analyze and fix the following issue in the Linux kernel code: ASoC: qcom: q6apm-dai: reset queue ptr on trigger stop
Problem Details: Reset queue pointer on SNDRV_PCM_TRIGGER_STOP event to be inline with resetting appl_ptr. Without this we will end up with a queue_ptr out of sync and driver could try to send data that is not ready yet. Fix this by resetting the queue_ptr. Fixes: 3d4a4411aa8bb ("ASoC: q6apm-dai: schedule all availab...
```diff diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c index 306e928e7b49..292be457764f 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -317,6 +317,7 @@ static int q6apm_dai_trigger(struct snd_soc_component *component, case SNDRV_PCM_TRIGGER_ST...
69acc488aaf39d0ddf6c3cf0e47c1873d39919a2
Analyze and fix the following issue in the Linux kernel code: ASoC: qcom: q6apm-lpass-dai: Fix multiple graph opens
Problem Details: As prepare can be called mulitple times, this can result in multiple graph opens for playback path. This will result in a memory leaks, fix this by adding a check before opening. Fixes: be1fae62cf25 ("ASoC: q6apm-lpass-dai: close graph on prepare errors") Cc: Stable@vger.kernel.org Signed-off-by: Sri...
```diff diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c index 5be37eeea329..ba64117b8cfe 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -181,7 +181,7 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *subs...
d5bfdd28e0cdd45043ae6e0ac168a451d59283dc
Analyze and fix the following issue in the Linux kernel code: ASoC: qcom: qdsp6: topology: check widget type before accessing data
Problem Details: Check widget type before accessing the private data, as this could a virtual widget which is no associated with a dsp graph, container and module. Accessing witout check could lead to incorrect memory access. Fixes: 36ad9bf1d93d ("ASoC: qdsp6: audioreach: add topology support") Signed-off-by: Srinivas...
```diff diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index e732fac9b8ca..1f69fba6de26 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -952,9 +952,6 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp, struct audioreach_containe...
4a0e1bcc98f7281d1605768bd2fe71eacc34f9b7
Analyze and fix the following issue in the Linux kernel code: ASoC: qcom: q6apm: remove child devices when apm is removed
Problem Details: looks like q6apm driver does not remove the child driver q6apm-dai and q6apm-bedais when the this driver is removed. Fix this by depopulating them in remove callback. With this change when the dsp is shutdown all the devices associated with q6apm will now be removed. Fixes: 5477518b8a0e ("ASoC: qdsp...
```diff diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 069048db5367..2dc525c8be42 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -762,6 +762,7 @@ static int apm_probe(gpr_device_t *gdev) static void apm_remove(gpr_device_t *gdev) { + of_platform_depop...
6ec1235fc941dac6c011b30ee01d9220ff87e0cd
Analyze and fix the following issue in the Linux kernel code: ASoC: qcom: q6apm: move component registration to unmanaged version
Problem Details: q6apm component registers dais dynamically from ASoC toplology, which are allocated using device managed version apis. Allocating both component and dynamic dais using managed version could lead to incorrect free ordering, dai will be freed while component still holding references to it. Fix this issu...
```diff diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 970b08c89bb3..069048db5367 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -747,13 +747,22 @@ static int apm_probe(gpr_device_t *gdev) q6apm_get_apm_state(apm); - ret = devm_snd_soc_register_comp...
3a359bf5c61d52e7f09754108309d637532164a6
Analyze and fix the following issue in the Linux kernel code: batman-adv: reject oversized global TT response buffers
Problem Details: batadv_tt_prepare_tvlv_global_data() builds the allocation length for a global TT response in 16-bit temporaries. When a remote originator advertises a large enough global TT, the TT payload length plus the VLAN header offset can exceed 65535 and wrap before kmalloc(). The full-table response path sti...
```diff diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 6e95e883c2bf..05cddcf994f6 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -798,8 +798,8 @@ batadv_tt_prepare_tvlv_global_data(struct batadv_orig_node *orig_node, { u16 num_v...
4e453375561fc60820e6b9d8ebeb6b3ee177d42e
Analyze and fix the following issue in the Linux kernel code: ipv6: avoid overflows in ip6_datagram_send_ctl()
Problem Details: Yiming Qian reported : <quote> I believe I found a locally triggerable kernel bug in the IPv6 sendmsg ancillary-data path that can panic the kernel via `skb_under_panic()` (local DoS). The core issue is a mismatch between: - a 16-bit length accumulator (`struct ipv6_txoptions::opt_flen`, type `...
```diff diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index c564b68a0562..993e2d76fc1f 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c @@ -763,6 +763,7 @@ int ip6_datagram_send_ctl(struct net *net, struct sock *sk, { struct in6_pktinfo *src_info; struct cmsghdr *cmsg; + struct ipv6_rt_hdr *orth...
2e3514e63bfb0e972b1f19668547a455d0129e88
Analyze and fix the following issue in the Linux kernel code: net: hsr: fix VLAN add unwind on slave errors
Problem Details: When vlan_vid_add() fails for a secondary slave, the error path calls vlan_vid_del() on the failing port instead of the peer slave that had already succeeded. This results in asymmetric VLAN state across the HSR pair. Fix this by switching to a centralized unwind path that removes the VID from any sla...
```diff diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index d1bfc49b5f01..fd2fea25eff0 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -532,8 +532,8 @@ static void hsr_change_rx_flags(struct net_device *dev, int change) static int hsr_ndo_vlan_rx_add_vid(struct net_device *dev, __be1...
f5df2990c364d1ac596d24b3118dbc56503f7cd4
Analyze and fix the following issue in the Linux kernel code: net: hsr: serialize seq_blocks merge across nodes
Problem Details: During node merging, hsr_handle_sup_frame() walks node_curr->seq_blocks to update node_real without holding node_curr->seq_out_lock. This allows concurrent mutations from duplicate registration paths, risking inconsistent state or XArray/bitmap corruption. Fix this by locking both nodes' seq_out_lock ...
```diff diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index 50996f4de7f9..d41863593674 100644 --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -123,6 +123,40 @@ static void hsr_free_node_rcu(struct rcu_head *rn) hsr_free_node(node); } +static void hsr_lock_seq_out_pair(struct hsr_node *n...
b18c833888742ca9de80c250f9d40d0e97caa9f6
Analyze and fix the following issue in the Linux kernel code: vsock: initialize child_ns_mode_locked in vsock_net_init()
Problem Details: The `child_ns_mode_locked` field lives in `struct net`, which persists across vsock module reloads. When the module is unloaded and reloaded, `vsock_net_init()` resets `mode` and `child_ns_mode` back to their default values, but does not reset `child_ns_mode_locked`. The stale lock from the previous m...
```diff diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 2f7d94d682cb..d912ed2f012a 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -2928,6 +2928,7 @@ static void vsock_net_init(struct net *net) net->vsock.mode = vsock_net_child_mode(current->nsproxy->net_ns); net->v...
e4cabc973133c0623a63e6e3bc3d64e53a2e6d62
Analyze and fix the following issue in the Linux kernel code: drivers/base/memory: fix stale reference to memory_block_add_nid()
Problem Details: The function memory_block_add_nid() was renamed to memory_block_add_nid_early() by commit 0a947c14e48c ("drivers/base: move memory_block_add_nid() into the caller"). Update the stale reference in add_memory_block(). Assisted-by: unnamed:deepseek-v3.2 coccinelle Signed-off-by: Kexin Sun <kexinsun@smai...
```diff diff --git a/drivers/base/memory.c b/drivers/base/memory.c index a3091924918b..0d6ccc7cdf05 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -815,7 +815,7 @@ static int add_memory_block(unsigned long block_id, int nid, unsigned long state /* * MEM_ONLINE at this point implies early memor...
eb1b5fc76a940ce309ecc57dbc465dda09171229
Analyze and fix the following issue in the Linux kernel code: mei: trace: print return value of pci_cfg_read
Problem Details: Extend debug capabilities. Add return value print in the trace_mei_pci_cfg_read(). Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Link: https://patch.msgid.link/20260201094358.1440593-5-alexander.usyskin@intel.com Signed-...
```diff diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index c0d4a02d9cae..72a7cfb2989f 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c @@ -1505,10 +1505,11 @@ static bool mei_me_fw_type_nm(const struct pci_dev *pdev) { u32 reg; unsigned int devfn; + int ret; devfn = PCI_...
f3d0423d4150614c0f6b68c307daa1a6b29730ea
Analyze and fix the following issue in the Linux kernel code: mei: fix idle print specifiers
Problem Details: %01d is equal to %d, simplify the format. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Link: https://patch.msgid.link/20260201094358.1440593-3-alexander....
```diff diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c index b789c4d9c709..f54991b40fc7 100644 --- a/drivers/misc/mei/init.c +++ b/drivers/misc/mei/init.c @@ -348,7 +348,7 @@ bool mei_write_is_idle(struct mei_device *dev) list_empty(&dev->write_list) && list_empty(&dev->write_waiting_list)); -...
2d7ce8eb59ec880774c7500ac949f0100acba521
Analyze and fix the following issue in the Linux kernel code: misc: apds990x: fix all kernel-doc warnings
Problem Details: Move a #define so that it is not between kernel-doc and its struct declaration. Spell one struct member correctly. Warning: include/linux/platform_data/apds990x.h:33 #define APDS_PARAM_SCALE 4096; error: Cannot parse struct or union! Warning: include/linux/platform_data/apds990x.h:62 struct member '...
```diff diff --git a/include/linux/platform_data/apds990x.h b/include/linux/platform_data/apds990x.h index 94dfbaa365e1..37684f68c04f 100644 --- a/include/linux/platform_data/apds990x.h +++ b/include/linux/platform_data/apds990x.h @@ -31,7 +31,6 @@ * itself. If the GA is zero, driver will use uncovered sensor default...
b1c7f7aaabc81ea8a6be2e5cf7d0c5959306f197
Analyze and fix the following issue in the Linux kernel code: misc: vmw_vmci: Fix spelling mistakes in comments
Problem Details: 'occured' -> 'occurred' (two instances) Found by manual inspection. Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl> Link: https://patch.msgid.link/20260220120904.1907108-1-tomasz.unger@yahoo.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c index 872aad355dbe..b777bc3fdde2 100644 --- a/drivers/misc/vmw_vmci/vmci_queue_pair.c +++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c @@ -2532,7 +2532,7 @@ static bool qp_wait_for_ready_queue(struct vmci_qp *qpair) * ...
f9b88613ff402aa6fe8fd020573cb95867ae947e
Analyze and fix the following issue in the Linux kernel code: nvmem: zynqmp_nvmem: Fix buffer size in DMA and memcpy
Problem Details: Buffer size used in dma allocation and memcpy is wrong. It can lead to undersized DMA buffer access and possible memory corruption. use correct buffer size in dma_alloc_coherent and memcpy. Fixes: 737c0c8d07b5 ("nvmem: zynqmp_nvmem: Add support to access efuse") Cc: stable@vger.kernel.org Signed-off-b...
```diff diff --git a/drivers/nvmem/zynqmp_nvmem.c b/drivers/nvmem/zynqmp_nvmem.c index 7da717d6c7fa..d297ff150dc0 100644 --- a/drivers/nvmem/zynqmp_nvmem.c +++ b/drivers/nvmem/zynqmp_nvmem.c @@ -66,7 +66,7 @@ static int zynqmp_efuse_access(void *context, unsigned int offset, dma_addr_t dma_buf; size_t words = bytes...
48b5163c957548f5854f14c90bfdedc33afbea3c
Analyze and fix the following issue in the Linux kernel code: nvmem: imx: assign nvmem_cell_info::raw_len
Problem Details: Avoid getting error messages at startup like the following on i.MX6ULL: nvmem imx-ocotp0: cell mac-addr raw len 6 unaligned to nvmem word size 4 nvmem imx-ocotp0: cell mac-addr raw len 6 unaligned to nvmem word size 4 This shouldn't cause any functional change as this alignment would otherwise be don...
```diff diff --git a/drivers/nvmem/imx-ocotp-ele.c b/drivers/nvmem/imx-ocotp-ele.c index 7cf7e809a8f5..a0d2985c6d03 100644 --- a/drivers/nvmem/imx-ocotp-ele.c +++ b/drivers/nvmem/imx-ocotp-ele.c @@ -131,6 +131,7 @@ static int imx_ocotp_cell_pp(void *context, const char *id, int index, static void imx_ocotp_fixup_dt_ce...
9aad71144fa3682cca3837a06c8623016790e7ec
Analyze and fix the following issue in the Linux kernel code: ibmasm: fix heap over-read in ibmasm_send_i2o_message()
Problem Details: The ibmasm_send_i2o_message() function uses get_dot_command_size() to compute the byte count for memcpy_toio(), but this value is derived from user-controlled fields in the dot_command_header (command_size: u8, data_size: u16) and is never validated against the actual allocation size. A root user can w...
```diff diff --git a/drivers/misc/ibmasm/lowlevel.c b/drivers/misc/ibmasm/lowlevel.c index 6922dc6c10db..5313230f36ad 100644 --- a/drivers/misc/ibmasm/lowlevel.c +++ b/drivers/misc/ibmasm/lowlevel.c @@ -19,17 +19,21 @@ static struct i2o_header header = I2O_HEADER_TEMPLATE; int ibmasm_send_i2o_message(struct service_pr...
0eb09f737428e482a32a2e31e5e223f2b35a71d3
Analyze and fix the following issue in the Linux kernel code: ibmasm: fix OOB reads in command_file_write due to missing size checks
Problem Details: The command_file_write() handler allocates a kernel buffer of exactly count bytes and copies user data into it, but does not validate the buffer against the dot command protocol before passing it to get_dot_command_size() and get_dot_command_timeout(). Since both the allocation size (count) and the he...
```diff diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index f68a8957b98f..dfdfa9ba4747 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c @@ -303,6 +303,8 @@ static ssize_t command_file_write(struct file *file, const char __user *ubuff, s return -EINVAL; ...
4b6e6ead556734bdc14024c5f837132b1e7a4b84
Analyze and fix the following issue in the Linux kernel code: misc: ibmasm: fix OOB MMIO read in ibmasm_handle_mouse_interrupt()
Problem Details: ibmasm_handle_mouse_interrupt() performs an out-of-bounds MMIO read when the queue reader or writer index from hardware exceeds REMOTE_QUEUE_SIZE (60). A compromised service processor can trigger this by writing an out-of-range value to the reader or writer MMIO register before asserting an interrupt....
```diff diff --git a/drivers/misc/ibmasm/remote.c b/drivers/misc/ibmasm/remote.c index ec816d3b38cb..521531738c9a 100644 --- a/drivers/misc/ibmasm/remote.c +++ b/drivers/misc/ibmasm/remote.c @@ -177,6 +177,11 @@ void ibmasm_handle_mouse_interrupt(struct service_processor *sp) writer = get_queue_writer(sp); while ...
84664e43ef87413f81b779b6433f43e14bc558cb
Analyze and fix the following issue in the Linux kernel code: misc: ti_fpc202: fix off-by-one error in port ID bounds check
Problem Details: FPC202_NUM_PORTS is 2, valid port IDs should be 0 and 1. A port_id of 2 would incorrectly pass the check, potentially causing out-of-bounds access to the port-related arrays. Found by code review, compile pass. Fixes: 1e5c9b1efa1c ("misc: add FPC202 dual port controller driver") Signed-off-by: Felix ...
```diff diff --git a/drivers/misc/ti_fpc202.c b/drivers/misc/ti_fpc202.c index 8eb2b5ac9850..578feefb77f1 100644 --- a/drivers/misc/ti_fpc202.c +++ b/drivers/misc/ti_fpc202.c @@ -366,7 +366,7 @@ static int fpc202_probe(struct i2c_client *client) goto unregister_chans; } - if (port_id > FPC202_NUM_PORTS) { + ...
ac7460c6037e45c72703cbe9a96ee6668601c80f
Analyze and fix the following issue in the Linux kernel code: misc: amd-sbi: Address CPUID extended function bits
Problem Details: According to the UAPI header (amd-apml.h), the CPUID extended function capability is indicated by bits [55:48], but the driver currently checks bits [63:56]. Adjust the driver to use bits [55:48] so that extended function capability is detected correctly. Fixes: bb13a84ed6b7 ("misc: amd-sbi: Add suppo...
```diff diff --git a/drivers/misc/amd-sbi/rmi-core.c b/drivers/misc/amd-sbi/rmi-core.c index c3a58912d6db..6979bfd7da64 100644 --- a/drivers/misc/amd-sbi/rmi-core.c +++ b/drivers/misc/amd-sbi/rmi-core.c @@ -48,7 +48,7 @@ /* CPUID MCAMSR mask & index */ #define CPUID_MCA_THRD_INDEX 32 #define CPUID_MCA_FUNC_MASK GENM...
dd3a68a74b29af20e63c1de98f3f175dc1aa7854
Analyze and fix the following issue in the Linux kernel code: MAINTAINERS: Update ocxl maintainer details
Problem Details: I am leaving IBM, and Fred isn't working on OpenCAPI either. Mahesh has kindly agreed to take over as maintainer to review the odd fixes that still come in, and he has plenty of powerpc-specific experience. Add Mahesh as ocxl maintainer, remove Fred as a maintainer, and downgrade myself to reviewer us...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index 48fda1f8332e..4275040b372d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19253,8 +19253,8 @@ F: drivers/net/dsa/ocelot/ocelot_ext.c F: include/linux/mfd/ocelot.h OCXL (Open Coherent Accelerator Processor Interface OpenCAPI) DRIVER -M: Frederic Barrat <fbarrat@li...