id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
7fe8dec3f628e9779f1631576f8e693370050348
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: Cap the packet size pre-calculations
Problem Details: We calculate the possible packet sizes beforehand for adaptive and synchronous endpoints, but we didn't take care of the max frame size for those pre-calculated values. When a device or a bus limits the packet size, a high sample rate or a high number of channels may lead to the packet sizes that are ...
```diff diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 73bce9712dbd..c887c2f5b25d 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -1378,6 +1378,9 @@ int snd_usb_endpoint_set_params(struct snd_usb_audio *chip, return -EINVAL; } + ep->packsize[0] = min(ep->packsize[0], ep->maxframes...
2ec86535555c0e748443c1f07087c088b645a9d5
Analyze and fix the following issue in the Linux kernel code: dma-buf: Assign separate lockdep class to chain lock
Problem Details: dma_fence_chain_enable_signaling() and runs while holding the chain inline_lock and may add callbacks to underlying fences, which takes their inline_lock. Since both locks share the same lockdep class, this valid nesting triggers a recursive locking warning. Assign a distinct lockdep class to the chai...
```diff diff --git a/drivers/dma-buf/dma-fence-chain.c b/drivers/dma-buf/dma-fence-chain.c index a707792b6025..a588f55ea4d3 100644 --- a/drivers/dma-buf/dma-fence-chain.c +++ b/drivers/dma-buf/dma-fence-chain.c @@ -242,6 +242,7 @@ void dma_fence_chain_init(struct dma_fence_chain *chain, struct dma_fence *fence, ...
29c8b85adb47daefc213381bc1831787f512d89b
Analyze and fix the following issue in the Linux kernel code: irqchip/gic-v5: Fix inversion of IRS_IDR0.virt flag
Problem Details: It appears that a !! became ! during a cleanup, resulting in inverted logic when detecting if a host GICv5 implementation is capable of virtualization. Re-add the missing !, fixing the behaviour. Fixes: 3227c3a89d65f ("irqchip/gic-v5: Check if impl is virt capable") Signed-off-by: Sascha Bischoff <sa...
```diff diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c index eeeb40fb0eaa..4ed2bfa17c01 100644 --- a/drivers/irqchip/irq-gic-v5-irs.c +++ b/drivers/irqchip/irq-gic-v5-irs.c @@ -744,7 +744,7 @@ static int __init gicv5_irs_init(struct device_node *node) */ if (list_empty(&irs_nodes)...
0c0eef8ccd2413b0a10eb6bbd3442333b1e64dd2
Analyze and fix the following issue in the Linux kernel code: esp: fix skb leak with espintcp and async crypto
Problem Details: When the TX queue for espintcp is full, esp_output_tail_tcp will return an error and not free the skb, because with synchronous crypto, the common xfrm output code will drop the packet for us. With async crypto (esp_output_done), we need to drop the skb when esp_output_tail_tcp returns an error. Fixe...
```diff diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 2c922afadb8f..6dfc0bcdef65 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -235,10 +235,13 @@ static void esp_output_done(void *data, int err) xfrm_dev_resume(skb); } else { if (!err && - x->encap && x->encap->encap_type == TCP_ENCAP_ESPINT...
7d2fc41f91bc69acb6e01b0fa23cd7d0109a6a23
Analyze and fix the following issue in the Linux kernel code: xfrm: call xdo_dev_state_delete during state update
Problem Details: When we update an SA, we construct a new state and call xdo_dev_state_add, but never insert it. The existing state is updated, then we immediately destroy the new state. Since we haven't added it, we don't go through the standard state delete code, and we're skipping removing it from the device (but xd...
```diff diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 98b362d51836..a00c4fe1ab0c 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -2264,6 +2264,7 @@ out: err = 0; x->km.state = XFRM_STATE_DEAD; + xfrm_dev_state_delete(x); __xfrm_state_put(x); } ```
b57defcf8f109da5ba9cf59b2a736606faf3d846
Analyze and fix the following issue in the Linux kernel code: xfrm: fix the condition on x->pcpu_num in xfrm_sa_len
Problem Details: pcpu_num = 0 is a valid value. The marker for "unset pcpu_num" which makes copy_to_user_state_extra not add the XFRMA_SA_PCPU attribute is UINT_MAX. Fixes: 1ddf9916ac09 ("xfrm: Add support for per cpu xfrm state handling.") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Simon Horman ...
```diff diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 3e6477c6082e..4dd8341225bc 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -3676,7 +3676,7 @@ static inline unsigned int xfrm_sa_len(struct xfrm_state *x) } if (x->if_id) l += nla_total_size(sizeof(x->if_id)); - if (x->pcpu_nu...
aa8a3f3c67235422a0c3608a8772f69ca3b7b63f
Analyze and fix the following issue in the Linux kernel code: xfrm: add missing extack for XFRMA_SA_PCPU in add_acquire and allocspi
Problem Details: We're returning an error caused by invalid user input without setting an extack. Add one. Fixes: 1ddf9916ac09 ("xfrm: Add support for per cpu xfrm state handling.") Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Steffen Klassert <steffen...
```diff diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 403b5ecac2c5..3e6477c6082e 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -1850,6 +1850,7 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, pcpu_num = nla_get_u32(attrs[XFRMA_SA_PCPU]); if (pcpu_num >...
83236b2e43dba00bee5b82eb5758816b1a674f6a
Analyze and fix the following issue in the Linux kernel code: sched_ext: Disable preemption between scx_claim_exit() and kicking helper work
Problem Details: scx_claim_exit() atomically sets exit_kind, which prevents scx_error() from triggering further error handling. After claiming exit, the caller must kick the helper kthread work which initiates bypass mode and teardown. If the calling task gets preempted between claiming exit and kicking the helper wor...
```diff diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index c18e81e8ef51..9280381f8923 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -4423,10 +4423,19 @@ done: scx_bypass(false); } +/* + * Claim the exit on @sch. The caller must ensure that the helper kthread work + * is kicked before the curr...
c601fd5414315fc515f746b499110e46272e7243
Analyze and fix the following issue in the Linux kernel code: drm/client: Do not destroy NULL modes
Problem Details: 'modes' in drm_client_modeset_probe may fail to kcalloc. If this occurs, we jump to 'out', calling modes_destroy on it, which dereferences it. This may result in a NULL pointer dereference in the error case. Prevent that. Fixes: 3039cc0c0653 ("drm/client: Make copies of modes") Signed-off-by: Jonat...
```diff diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index 262b1b8773c5..bb49b8361271 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -930,7 +930,8 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int widt...
c45f7263100cece247dd3fa5fe277bd97fdb5687
Analyze and fix the following issue in the Linux kernel code: firmware: stratix10-rsu: Fix NULL pointer dereference when RSU is disabled
Problem Details: When the Remote System Update (RSU) isn't enabled in the First Stage Boot Loader (FSBL), the driver encounters a NULL pointer dereference when excute svc_normal_to_secure_thread() thread, resulting in a kernel panic: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 ...
```diff diff --git a/drivers/firmware/stratix10-rsu.c b/drivers/firmware/stratix10-rsu.c index 41da07c445a6..e1912108a0fe 100644 --- a/drivers/firmware/stratix10-rsu.c +++ b/drivers/firmware/stratix10-rsu.c @@ -768,7 +768,9 @@ static int stratix10_rsu_probe(struct platform_device *pdev) rsu_async_status_callback)...
d99aa5912c3af4c0f84738d9471836f068d73d69
Analyze and fix the following issue in the Linux kernel code: selftests: net: py: avoid masking exceptions in bkg() failures
Problem Details: bkg() failures are currently quite hard to debug and spot. Often we have code along the lines of: with bkg("./cmd_rx_something -p PORT"): wait_port_listen(PORT) cmd("./cmd_tx_something", host=remote) When wait_port_listen() fails we don't get to see the exit status of bkg(). Even tho ...
```diff diff --git a/tools/testing/selftests/net/lib/py/utils.py b/tools/testing/selftests/net/lib/py/utils.py index 85884f3e827b..8fa1c2fabfc2 100644 --- a/tools/testing/selftests/net/lib/py/utils.py +++ b/tools/testing/selftests/net/lib/py/utils.py @@ -159,8 +159,11 @@ class bkg(cmd): return self def ...
2f61f38a217462411fed950e843b82bc119884cf
Analyze and fix the following issue in the Linux kernel code: net: stmmac: fix timestamping configuration after suspend/resume
Problem Details: When stmmac_init_timestamping() is called, it clears the receive and transmit path booleans that allow timestamps to be read. These are never re-initialised until after userspace requests timestamping features to be enabled. However, our copy of the timestamp configuration is not cleared, which means ...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 82375d34ad57..91f638ce132e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -853,6 +853,7 @@ static int stmmac_init_ti...
e6f43a41ba6206b691c8e9a301f0b4528b8f2278
Analyze and fix the following issue in the Linux kernel code: net: stmmac: qcom-ethqos: remove register field value obfuscations
Problem Details: Convert the register field values to something more human readable. For example, using (BIT(29) | BIT(27)) to update a register field that consists of bits 29:27 is an obfuscated way of writing decimal 5 for this field. The comment above needs to explain that this value is 5. Worse still is BIT(12) |...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 690bd5c7e1a6..50b95fd19f9d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -361,10 +361,12 @@...
b6c94c71f349479b76fcc0ef0dc7147f3f326dff
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx93-tqma9352: improve eMMC pad configuration
Problem Details: Use DSE x4 an PullUp for CMD an DAT, DSE x4 and PullDown for CLK to improve stability and detection at low temperatures under -25°C. Fixes: 0b5fdfaa8e45 ("arm64: dts: freescale: imx93-tqma9352: set SION for cmd and data pad of USDHC") Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com> Signed...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx93-tqma9352.dtsi b/arch/arm64/boot/dts/freescale/imx93-tqma9352.dtsi index 3a23e2eb9feb..ce34a296495c 100644 --- a/arch/arm64/boot/dts/freescale/imx93-tqma9352.dtsi +++ b/arch/arm64/boot/dts/freescale/imx93-tqma9352.dtsi @@ -271,21 +271,21 @@ /* enable SION for da...
44db7bc66eb38e85bb32777c5fd3a4e7baa84147
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx91-tqma9131: improve eMMC pad configuration
Problem Details: Use DSE x4 an PullUp for CMD an DAT, DSE x4 and PullDown for CLK to improve stability and detection at low temperatures under -25°C. Fixes: e71db39f0c7c ("arm64: dts: freescale: add initial device tree for TQMa91xx/MBa91xxCA") Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com> Signed-off-by:...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx91-tqma9131.dtsi b/arch/arm64/boot/dts/freescale/imx91-tqma9131.dtsi index 5792952b7a8e..c99d7bc16848 100644 --- a/arch/arm64/boot/dts/freescale/imx91-tqma9131.dtsi +++ b/arch/arm64/boot/dts/freescale/imx91-tqma9131.dtsi @@ -272,20 +272,20 @@ /* enable SION for da...
4b44cbb264d0ed3f2f2bc2659db6ce45882f4670
Analyze and fix the following issue in the Linux kernel code: overflow: Make sure size helpers are always inlined
Problem Details: With kmalloc_obj() performing implicit size calculations, the embedded size_mul() calls, while marked inline, were not always being inlined. I noticed a couple places where allocations were making a call out for things that would otherwise be compile-time calculated. Force the compilers to always inlin...
```diff diff --git a/include/linux/overflow.h b/include/linux/overflow.h index eddd987a8513..a8cb6319b4fb 100644 --- a/include/linux/overflow.h +++ b/include/linux/overflow.h @@ -42,7 +42,7 @@ * both the type-agnostic benefits of the macros while also being able to * enforce that the return value is, in fact, check...
f86226d3c67b72ae1908f82776dcc7f259e42ff6
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: gsp: derive `Debug` on more sequencer types
Problem Details: Being able to print these is useful when debugging the sequencer. Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260217-nova-misc-v3-5-b4e2d45eafbc@nvidia.com Signed-off-by: Alexandre ...
```diff diff --git a/drivers/gpu/nova-core/gsp/fw.rs b/drivers/gpu/nova-core/gsp/fw.rs index 624f5670ed50..f1797e1f0d9d 100644 --- a/drivers/gpu/nova-core/gsp/fw.rs +++ b/drivers/gpu/nova-core/gsp/fw.rs @@ -330,7 +330,7 @@ impl From<SeqBufOpcode> for u32 { /// Wrapper for GSP sequencer register write payload. #[rep...
3614290d75a4853a74ac501a64f1a4916c99bfe6
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: gsp: remove unnecessary Display impls
Problem Details: We only ever display these in debug context, for which the automatically derived `Debug` impls work just fine - so use them and remove these boilerplate-looking implementations. Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Alistair Popple <apopple@nvidia.com> Reviewed-by: Gary Guo <gary@gar...
```diff diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs index 156f1fc91d31..87dbbd6d1be9 100644 --- a/drivers/gpu/nova-core/gsp/cmdq.rs +++ b/drivers/gpu/nova-core/gsp/cmdq.rs @@ -544,7 +544,7 @@ impl Cmdq { dev_dbg!( &self.dev, - "GSP RPC: send: seq...
b45b9f2668b723f8117a3585d75d01e93281aa38
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: gsp: warn if data remains after processing a message
Problem Details: Not processing the whole data from a received message is a strong indicator of a bug - emit a warning when such cases are detected. Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260217-nova-misc-v3-1-b4e2d45eafbc@nvidia.com ...
```diff diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs index 16895f5281b7..156f1fc91d31 100644 --- a/drivers/gpu/nova-core/gsp/cmdq.rs +++ b/drivers/gpu/nova-core/gsp/cmdq.rs @@ -674,7 +674,17 @@ impl Cmdq { let (cmd, contents_1) = M::Message::from_bytes_prefix(message.c...
5cdbed3ad782700d6381bf5901e3f61c4d8b28bc
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: gsp: fix improper indexing in driver_read_area
Problem Details: The current code indexes into `after_rx` using `tx` which is an index for the whole buffer, not the split buffer `after_rx`. Also add more rigorous no-panic proofs. Fixes: 75f6b1de8133 ("gpu: nova-core: gsp: Add GSP command queue bindings and handling") Signed-off-by: Eliot Courtney <ecourtney@nvidia...
```diff diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs index 333bf0125d74..16895f5281b7 100644 --- a/drivers/gpu/nova-core/gsp/cmdq.rs +++ b/drivers/gpu/nova-core/gsp/cmdq.rs @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 use core::{ - cmp, mem, sync::atomic::{ ...
f64caf673cb5add9ac2065609a52049e2317c498
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: gsp: fix improper handling of empty slot in cmdq
Problem Details: The current code hands out buffers that go all the way up to and including `rx - 1`, but we need to maintain an empty slot to prevent the ring buffer from wrapping around into having 'tx == rx', which means empty. Also add more rigorous no-panic proofs. Fixes: 75f6b1de8133 ("gpu: nova-core: gsp: Add ...
```diff diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs index b88ff8ebc098..333bf0125d74 100644 --- a/drivers/gpu/nova-core/gsp/cmdq.rs +++ b/drivers/gpu/nova-core/gsp/cmdq.rs @@ -227,21 +227,27 @@ impl DmaGspMem { // PANIC: per the invariant of `cpu_write_ptr`, `tx` is `< MS...
9045ae2afc7b7cd51a98d7d773529b56572a4b1b
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: gsp: fix incorrect advancing of write pointer
Problem Details: We should modulo not bitwise-and here. The current code could, for example, set wptr to MSGQ_NUM_PAGES which is not valid. Fixes: 75f6b1de8133 ("gpu: nova-core: gsp: Add GSP command queue bindings and handling") Signed-off-by: Eliot Courtney <ecourtney@nvidia.com> Reviewed-by: Gary Guo <gary@garyguo.n...
```diff diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs index 46819a82a51a..f139aad7af3f 100644 --- a/drivers/gpu/nova-core/gsp/cmdq.rs +++ b/drivers/gpu/nova-core/gsp/cmdq.rs @@ -384,7 +384,7 @@ impl DmaGspMem { // Informs the GSP that it can process `elem_count` new pages fro...
4f2609685418cc995ff6a2d558ed62214dec75dc
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: use checked arithmetic in Booter signature parsing
Problem Details: Use checked_add() when computing signature offsets from firmware- provided values in signatures_iter(). Without checked arithmetic, overflow could wrap to a small plausible offset that points to entirely wrong data. Reviewed-by: Zhi Wang <zhiw@nvidia.com> Signed-off-by: Joel Fernandes <joelagnelf@nvi...
```diff diff --git a/drivers/gpu/nova-core/firmware/booter.rs b/drivers/gpu/nova-core/firmware/booter.rs index 86556cee8e67..21cd437a3c95 100644 --- a/drivers/gpu/nova-core/firmware/booter.rs +++ b/drivers/gpu/nova-core/firmware/booter.rs @@ -119,14 +119,21 @@ impl<'a> HsFirmwareV2<'a> { Some(sig_size) => ...
0568b376a0b13da6582bce1f2e2bbb2eae7fc266
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: use checked arithmetic in FWSEC firmware parsing
Problem Details: Use checked_add() and checked_mul() when computing offsets from firmware-provided values in new_fwsec(). Without checked arithmetic, corrupt firmware could cause integer overflow. The danger is not just wrapping to a huge value, but potentially wrapping to a small plausible offset that passes validati...
```diff diff --git a/drivers/gpu/nova-core/firmware/fwsec.rs b/drivers/gpu/nova-core/firmware/fwsec.rs index bfb7b06b13d1..df3d8de14ca1 100644 --- a/drivers/gpu/nova-core/firmware/fwsec.rs +++ b/drivers/gpu/nova-core/firmware/fwsec.rs @@ -45,10 +45,7 @@ use crate::{ Signed, Unsigned, // }, - n...
399c6e3385a79e0e93837b504ad58477c22db841
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx93-11x11-evk: change usdhc tuning step for eMMC and SD
Problem Details: During system resume, the following errors occurred: [ 430.638625] mmc1: error -84 writing Cache Enable bit [ 430.643618] mmc1: error -84 doing runtime resume For eMMC and SD, there are two tuning pass windows and the gap between those two windows may only have one cell. If tuning step > 1, the...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx93-11x11-evk-common.dtsi b/arch/arm64/boot/dts/freescale/imx93-11x11-evk-common.dtsi index 301e9f05122e..7d3fc4ad7b8b 100644 --- a/arch/arm64/boot/dts/freescale/imx93-11x11-evk-common.dtsi +++ b/arch/arm64/boot/dts/freescale/imx93-11x11-evk-common.dtsi @@ -535,6 +53...
5ab0c76df2403137a6d0fb27a55e03cedf47f44c
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx91-11x11-evk: change usdhc tuning step for eMMC and SD
Problem Details: During system resume, the following errors occurred: [ 430.638625] mmc1: error -84 writing Cache Enable bit [ 430.643618] mmc1: error -84 doing runtime resume For eMMC and SD, there are two tuning pass windows and the gap between those two windows may only have one cell. If tuning step > 1, the...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx91-11x11-evk.dts b/arch/arm64/boot/dts/freescale/imx91-11x11-evk.dts index 03f460d62f7a..6a066a0d86bc 100644 --- a/arch/arm64/boot/dts/freescale/imx91-11x11-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx91-11x11-evk.dts @@ -514,6 +514,7 @@ pinctrl-1 = <&pinctrl_u...
c89b50cc6b9f3df4e21e5b9c10dcdfe830200c72
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix flakiness of task_local_storage/sys_enter_exit
Problem Details: The test_sys_enter_exit test was setting target_pid before attaching the BPF programs, which causes syscalls made during the attach phase to be counted. This is flaky because, apparently, there is no guarantee that both on_enter and on_exit will trigger during the attachment. Move the target_pid assig...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/task_local_storage.c b/tools/testing/selftests/bpf/prog_tests/task_local_storage.c index 7bee33797c71..1b26c12f255a 100644 --- a/tools/testing/selftests/bpf/prog_tests/task_local_storage.c +++ b/tools/testing/selftests/bpf/prog_tests/task_local_storage.c @@ -2...
201ceb94aa1def0024a7c18ce643e5f65026be06
Analyze and fix the following issue in the Linux kernel code: kunit: irq: Ensure timer doesn't fire too frequently
Problem Details: Fix a bug where kunit_run_irq_test() could hang if the system is too slow. This was noticed with the crypto library tests in certain VMs. Specifically, if kunit_irq_test_timer_func() and the associated hrtimer code took over 5us to run, then the CPU would spend all its time executing that code in har...
```diff diff --git a/include/kunit/run-in-irq-context.h b/include/kunit/run-in-irq-context.h index c89b1b1b12dd..bfe60d6cf28d 100644 --- a/include/kunit/run-in-irq-context.h +++ b/include/kunit/run-in-irq-context.h @@ -12,16 +12,16 @@ #include <linux/hrtimer.h> #include <linux/workqueue.h> -#define KUNIT_IRQ_TEST_H...
1046bc7b416814833a43af8e66c52b0ea71c2021
Analyze and fix the following issue in the Linux kernel code: drm/xe/xe2_hpg: Drop invalid workaround Wa_15010599737
Problem Details: Wa_15010599737 was a workaround originally proposed (and ultimately rejected) for DG2-G10. There's no record of it ever being relevant or even considered for any other platforms. The specific bit this workaround was setting is documented as "This bit should be set to 1 for the DX9 API and 0 for all o...
```diff diff --git a/drivers/gpu/drm/xe/xe_wa.c b/drivers/gpu/drm/xe/xe_wa.c index d1a8c375ba03..26950b8a7543 100644 --- a/drivers/gpu/drm/xe/xe_wa.c +++ b/drivers/gpu/drm/xe/xe_wa.c @@ -731,10 +731,7 @@ static const struct xe_rtp_entry_sr lrc_was[] = { }, /* Xe2_HPG */ - { XE_RTP_NAME("15010599737"), - XE_RTP_...
3c4617117a2b7682cf037be5e5533e379707f050
Analyze and fix the following issue in the Linux kernel code: zloop: check for spurious options passed to remove
Problem Details: Zloop uses a command option parser for all control commands, but most options are only valid for adding a new device. Check for incorrectly specified options in the remove handler. Fixes: eb0570c7df23 ("block: new zoned loop block device driver") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed...
```diff diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c index ae9bf2a85c21..9e3bb538d5fc 100644 --- a/drivers/block/zloop.c +++ b/drivers/block/zloop.c @@ -1174,7 +1174,12 @@ static int zloop_ctl_remove(struct zloop_options *opts) int ret; if (!(opts->mask & ZLOOP_OPT_ID)) { - pr_err("No ID specified\...
6acf7860dcc79ed045cc9e6a79c8a8bb6959dba7
Analyze and fix the following issue in the Linux kernel code: zloop: advertise a volatile write cache
Problem Details: Zloop is file system backed and thus needs to sync the underlying file system to persist data. Set BLK_FEAT_WRITE_CACHE so that the block layer actually send flush commands, and fix the flush implementation as sync_filesystem requires s_umount to be held and the code currently misses that. Fixes: eb0...
```diff diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c index 8e334f5025fc..ae9bf2a85c21 100644 --- a/drivers/block/zloop.c +++ b/drivers/block/zloop.c @@ -542,6 +542,21 @@ out: zloop_put_cmd(cmd); } +/* + * Sync the entire FS containing the zone files instead of walking all files. + */ +static int zloo...
bfbc0b5b32a8f28ce284add619bf226716a59bc0
Analyze and fix the following issue in the Linux kernel code: media: dvb-core: fix wrong reinitialization of ringbuffer on reopen
Problem Details: dvb_dvr_open() calls dvb_ringbuffer_init() when a new reader opens the DVR device. dvb_ringbuffer_init() calls init_waitqueue_head(), which reinitializes the waitqueue list head to empty. Since dmxdev->dvr_buffer.queue is a shared waitqueue (all opens of the same DVR device share it), this orphans an...
```diff diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c index 7cfed24054d0..3c8bc75e4d6c 100644 --- a/drivers/media/dvb-core/dmxdev.c +++ b/drivers/media/dvb-core/dmxdev.c @@ -168,7 +168,9 @@ static int dvb_dvr_open(struct inode *inode, struct file *file) mutex_unlock(&dmxdev->mutex);...
08903184553def7ba1ad6ba4fa8afe1ba2ee0a21
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx93-9x9-qsb: change usdhc tuning step for eMMC and SD
Problem Details: During system resume, the following errors occurred: [ 430.638625] mmc1: error -84 writing Cache Enable bit [ 430.643618] mmc1: error -84 doing runtime resume For eMMC and SD, there are two tuning pass windows and the gap between those two windows may only have one cell. If tuning step > 1, the...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts b/arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts index 0852067eab2c..197c8f8b7f66 100644 --- a/arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts +++ b/arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts @@ -507,6 +507,7 @@ pinctrl-2 = <&pinctrl_usdhc1_20...
0c9d379d436e119285ef39a4f96b012f576ed74c
Analyze and fix the following issue in the Linux kernel code: arm64: dts: freescale: imx95-toradex-smarc: fix PMIC_SD2_VSEL label position
Problem Details: Fix the PMIC_SD2_VSEL gpio-line-name position. It should be on line 19 of gpio3, not line 20. Fixes: 90bbe88e0ea6 ("arm64: dts: freescale: add Toradex SMARC iMX95") Cc: stable@vger.kernel.org Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Review...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx95-toradex-smarc.dtsi b/arch/arm64/boot/dts/freescale/imx95-toradex-smarc.dtsi index 5932ba238a8a..f64c05dc50f8 100644 --- a/arch/arm64/boot/dts/freescale/imx95-toradex-smarc.dtsi +++ b/arch/arm64/boot/dts/freescale/imx95-toradex-smarc.dtsi @@ -262,7 +262,6 @@ ...
7e660488ba1377441bab56850b8d72bf868a59f5
Analyze and fix the following issue in the Linux kernel code: ARM: dts: imx51-babbage: rename at45db321d@1 to flash@1
Problem Details: Rename at45db321d@1 to flash@1 to fix below CHECK_DTBS warnings: at45db321d@1 (atmel,at45db321d): $nodename:0: 'at45db321d@1' does not match '^(flash|.*sram|nand)(@.*)?$' from schema $id: http://devicetree.org/schemas/mtd/atmel,dataflash.yaml Signed-off-by: Frank Li <Frank.Li@nxp.com>
```diff diff --git a/arch/arm/boot/dts/nxp/imx/imx51-babbage.dts b/arch/arm/boot/dts/nxp/imx/imx51-babbage.dts index 1b6ec55f9068..b17264e06e69 100644 --- a/arch/arm/boot/dts/nxp/imx/imx51-babbage.dts +++ b/arch/arm/boot/dts/nxp/imx/imx51-babbage.dts @@ -327,7 +327,7 @@ }; }; - flash: at45db321d@1 { + flash: fla...
cf1215fd56cfe552f4d7df17fb995f52a88a2181
Analyze and fix the following issue in the Linux kernel code: ARM: dts: imx51-ts4800: rename fpga@0 to fpga@0,0
Problem Details: Change node name fpga@0 to fpga@0,0 to fix below CHECK_DTBS warnings: memory-controller@83fda000 (fsl,imx51-weim): 'fpga@0' does not match any of the regexes: '^.*@[0-7],[0-9a-f]+$', '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/memory-controllers/fsl/fsl,imx-weim.yam Signe...
```diff diff --git a/arch/arm/boot/dts/nxp/imx/imx51-ts4800.dts b/arch/arm/boot/dts/nxp/imx/imx51-ts4800.dts index 079bd3d14999..5118a68dbbdc 100644 --- a/arch/arm/boot/dts/nxp/imx/imx51-ts4800.dts +++ b/arch/arm/boot/dts/nxp/imx/imx51-ts4800.dts @@ -141,7 +141,7 @@ pinctrl-0 = <&pinctrl_weim>; status = "okay"; -...
1c764712672bc984691d01716d2838b26230b587
Analyze and fix the following issue in the Linux kernel code: ARM: dts: imx35: remove simple-bus 'usbphy'
Problem Details: Remove simple bus 'usbphy' and move chip nodes to up layers to fix below CHECK_DTBS warnings. arch/arm/boot/dts/nxp/imx/imx35-pdk.dtb: usbphy (simple-bus): usb-phy@1:reg:0: [1] is too short from schema $id: http://devicetree.org/schemas/simple-bus.yaml Remove property 'reg' because it is never used...
```diff diff --git a/arch/arm/boot/dts/nxp/imx/imx35.dtsi b/arch/arm/boot/dts/nxp/imx/imx35.dtsi index aed7fe2fd6b9..ab7b64639989 100644 --- a/arch/arm/boot/dts/nxp/imx/imx35.dtsi +++ b/arch/arm/boot/dts/nxp/imx/imx35.dtsi @@ -393,21 +393,13 @@ }; }; - usbphy { - compatible = "simple-bus"; - #address-cells = <...
3645ed51986b10560081bc32a8ff66daf7b1c0ed
Analyze and fix the following issue in the Linux kernel code: ARM: dts: imx35: rename i2c clock-names to ipg
Problem Details: Rename the i2c clock-names from "ipg_per" to "ipg" to match the binding documentation. Fix the following CHECK_DTBS warning: i2c@43f80000 (fsl,imx35-i2c): clock-names:0: 'ipg' was expected Signed-off-by: Frank Li <Frank.Li@nxp.com>
```diff diff --git a/arch/arm/boot/dts/nxp/imx/imx35.dtsi b/arch/arm/boot/dts/nxp/imx/imx35.dtsi index 1c010a83d5df..aed7fe2fd6b9 100644 --- a/arch/arm/boot/dts/nxp/imx/imx35.dtsi +++ b/arch/arm/boot/dts/nxp/imx/imx35.dtsi @@ -79,7 +79,7 @@ compatible = "fsl,imx35-i2c", "fsl,imx1-i2c"; reg = <0x43f80000 0x400...
c79cb42baf2ab1bbaac49cc46a3536af593e46c3
Analyze and fix the following issue in the Linux kernel code: ARM: dts: imx35: rename emi to emi-bus to fix CHECK_DTBS warning
Problem Details: Rename emi to emi-bus to fix below CHECK_DTBS warning: arch/arm/boot/dts/nxp/imx/imx31-bug.dtb: emi@b8000000 (simple-bus): $nodename:0: 'emi@b8000000' does not match '^([a-z][a-z0-9\\-]+-bus|bus|localbus|soc|axi|ahb|apb)(@.+)?$' from schema $id: http://devicetree.org/schemas/simple-bus.yaml Si...
```diff diff --git a/arch/arm/boot/dts/nxp/imx/imx31.dtsi b/arch/arm/boot/dts/nxp/imx/imx31.dtsi index 8541a666747a..c58f855ea851 100644 --- a/arch/arm/boot/dts/nxp/imx/imx31.dtsi +++ b/arch/arm/boot/dts/nxp/imx/imx31.dtsi @@ -333,7 +333,7 @@ }; }; - emi@b8000000 { /* External Memory Interface */ + emi-bus@b...
1f99b5d93d99ca17d50b386a674d0ce1f20932d8
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8mq: Set the correct gpu_ahb clock frequency
Problem Details: According to i.MX 8M Quad Reference Manual, GPU_AHB_CLK_ROOT's maximum frequency is 400MHz. Fixes: 45d2c84eb3a2 ("arm64: dts: imx8mq: add GPU node") Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm> Reviewed-by: Peng Fan <peng.fan@nxp.com> ...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi index 607962f807be..6a25e219832c 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -1632,7 +1632,7 @@ <&clk IMX8MQ_GPU_PLL_OUT>,...
2f38fd99c0004676d835ae96ac4f3b54edc02c82
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Fix shift out of bounds when MAXQ=32
Problem Details: According to JESD223F, the maximum number of queues (MAXQ) is 32. When MCQ is enabled and ESI is disabled, nr_hw_queues=32 causes a shift overflow problem. Fix this by using 64-bit intermediate values to handle the nr_hw_queues=32 case safely. Signed-off-by: wangshuaiwei <wangshuaiwei1@xiaomi.com> Re...
```diff diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 85987373b961..899e663fea6e 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -7110,7 +7110,7 @@ static irqreturn_t ufshcd_handle_mcq_cq_events(struct ufs_hba *hba) ret = ufshcd_vops_get_outstanding_cqs(hba, &out...
a4ab97e34bb687a2ca63fc70b47e8762e689797f
Analyze and fix the following issue in the Linux kernel code: mm: fix NULL NODE_DATA dereference for memoryless nodes on boot
Problem Details: Commit d49004c5f0c1 ("arch, mm: consolidate initialization of nodes, zones and memory map") moved free_area_init() from setup_arch() to mm_core_init_early(), which runs after setup_arch() returns. This changed the ordering relative to init_cpu_to_node() on x86. Before the commit, free_area_init() ran...
```diff diff --git a/mm/mm_init.c b/mm/mm_init.c index 61d983d23f55..df34797691bd 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -1896,7 +1896,11 @@ static void __init free_area_init(void) for_each_node(nid) { pg_data_t *pgdat; - if (!node_online(nid)) + /* + * If an architecture has not allocated node data...
079c24d5690262e83ee476e2a548e416f3237511
Analyze and fix the following issue in the Linux kernel code: mm/tracing: rss_stat: ensure curr is false from kthread context
Problem Details: The rss_stat trace event allows userspace tools, like Perfetto [1], to inspect per-process RSS metric changes over time. The curr field was introduced to rss_stat in commit e4dcad204d3a ("rss_stat: add support to detect RSS updates of external mm"). Its intent is to indicate whether the RSS update is...
```diff diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index 7f93e754da5c..cd7920c81f85 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h @@ -440,7 +440,13 @@ TRACE_EVENT(rss_stat, TP_fast_assign( __entry->mm_id = mm_ptr_to_hash(mm); - __entry->curr = !!(current-...
d155aab90fffa00f93cea1f107aef0a3d548b2ff
Analyze and fix the following issue in the Linux kernel code: mm/kfence: fix KASAN hardware tag faults during late enablement
Problem Details: When KASAN hardware tags are enabled, re-enabling KFENCE late (via /sys/module/kfence/parameters/sample_interval) causes KASAN faults. This happens because the KFENCE pool and metadata are allocated via the page allocator, which tags the memory, while KFENCE continues to access it using untagged point...
```diff diff --git a/mm/kfence/core.c b/mm/kfence/core.c index b5aedf505cec..7393957f9a20 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -1004,14 +1004,14 @@ static int kfence_init_late(void) #ifdef CONFIG_CONTIG_ALLOC struct page *pages; - pages = alloc_contig_pages(nr_pages_pool, GFP_KERNEL, first_onlin...
c80f46ac228b48403866d65391ad09bdf0e8562a
Analyze and fix the following issue in the Linux kernel code: mm/damon/core: disallow non-power of two min_region_sz
Problem Details: DAMON core uses min_region_sz parameter value as the DAMON region alignment. The alignment is made using ALIGN() and ALIGN_DOWN(), which support only the power of two alignments. But DAMON core API callers can set min_region_sz to an arbitrary number. Users can also set it indirectly, using addr_uni...
```diff diff --git a/mm/damon/core.c b/mm/damon/core.c index 01eba1a547d4..adfc52fee9dc 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1252,6 +1252,9 @@ int damon_commit_ctx(struct damon_ctx *dst, struct damon_ctx *src) { int err; + if (!is_power_of_2(src->min_region_sz)) + return -EINVAL; + err = damon...
fdb24a820a5832ec4532273282cbd4f22c291a0d
Analyze and fix the following issue in the Linux kernel code: Squashfs: check metadata block offset is within range
Problem Details: Syzkaller reports a "general protection fault in squashfs_copy_data" This is ultimately caused by a corrupted index look-up table, which produces a negative metadata block offset. This is subsequently passed to squashfs_copy_data (via squashfs_read_metadata) where the negative offset causes an out of...
```diff diff --git a/fs/squashfs/cache.c b/fs/squashfs/cache.c index 8e958db5f786..67abd4dff222 100644 --- a/fs/squashfs/cache.c +++ b/fs/squashfs/cache.c @@ -344,6 +344,9 @@ int squashfs_read_metadata(struct super_block *sb, void *buffer, if (unlikely(length < 0)) return -EIO; + if (unlikely(*offset < 0 || *off...
f85b1c6af5bc3872f994df0a5688c1162de07a62
Analyze and fix the following issue in the Linux kernel code: liveupdate: luo_file: remember retrieve() status
Problem Details: LUO keeps track of successful retrieve attempts on a LUO file. It does so to avoid multiple retrievals of the same file. Multiple retrievals cause problems because once the file is retrieved, the serialized data structures are likely freed and the file is likely in a very different state from what th...
```diff diff --git a/include/linux/liveupdate.h b/include/linux/liveupdate.h index fe82a6c3005f..dd11fdc76a5f 100644 --- a/include/linux/liveupdate.h +++ b/include/linux/liveupdate.h @@ -23,8 +23,11 @@ struct file; /** * struct liveupdate_file_op_args - Arguments for file operation callbacks. * @handler: ...
dd085fe9a8ebfc5d10314c60452db38d2b75e609
Analyze and fix the following issue in the Linux kernel code: mm: thp: deny THP for files on anonymous inodes
Problem Details: file_thp_enabled() incorrectly allows THP for files on anonymous inodes (e.g. guest_memfd and secretmem). These files are created via alloc_file_pseudo(), which does not call get_write_access() and leaves inode->i_writecount at 0. Combined with S_ISREG(inode->i_mode) being true, they appear as read-onl...
```diff diff --git a/mm/huge_memory.c b/mm/huge_memory.c index d4ca8cfd7f9d..8e2746ea74ad 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -94,6 +94,9 @@ static inline bool file_thp_enabled(struct vm_area_struct *vma) inode = file_inode(vma->vm_file); + if (IS_ANON_FILE(inode)) + return false; + return ...
09833d99db36d74456a4d13eb29c32d56ff8f2b6
Analyze and fix the following issue in the Linux kernel code: mm/kfence: disable KFENCE upon KASAN HW tags enablement
Problem Details: KFENCE does not currently support KASAN hardware tags. As a result, the two features are incompatible when enabled simultaneously. Given that MTE provides deterministic protection and KFENCE is a sampling-based debugging tool, prioritize the stronger hardware protections. Disable KFENCE initializati...
```diff diff --git a/mm/kfence/core.c b/mm/kfence/core.c index b4ea3262c925..b5aedf505cec 100644 --- a/mm/kfence/core.c +++ b/mm/kfence/core.c @@ -13,6 +13,7 @@ #include <linux/hash.h> #include <linux/irq_work.h> #include <linux/jhash.h> +#include <linux/kasan-enabled.h> #include <linux/kcsan-checks.h> #include <l...
3abe4113e784b4a1135fe0e89828afecbfebf862
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Add debug log for MCQ command timeout
Problem Details: It is difficult to debug situations where an MCQ command timeout occurs, the corresponding CQ tag response is received, but the request is not completed. Add a one-line log to indicate when the CQ entry is abnormal. Signed-off-by: Peter Wang <peter.wang@mediatek.com> Reviewed-by: Bart Van Assche <bva...
```diff diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c index 18a95b728633..eb3770830d73 100644 --- a/drivers/ufs/core/ufs-mcq.c +++ b/drivers/ufs/core/ufs-mcq.c @@ -301,6 +301,8 @@ static void ufshcd_mcq_process_cqe(struct ufs_hba *hba, ufshcd_compl_one_cqe(hba, tag, cqe); /* After processed...
01517654bc258efb2610e53e99fa4ef641d134b9
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Add debug log for UIC command timeout
Problem Details: It is difficult to debug when a UIC command timeout occurs simultaneously with a UIC command complete interrupt. Currently, we only see the timeout log without any debug information, making it unclear whether the UFS device failed to respond or the host entered an incorrect state. Add a one-line log ...
```diff diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 847b55789bb8..017d05ef94e2 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -5568,8 +5568,11 @@ static irqreturn_t ufshcd_uic_cmd_compl(struct ufs_hba *hba, u32 intr_status) guard(spinlock_irqsave)(hba->host->h...
a46435537a844d0f7b4b620baf962cad136422de
Analyze and fix the following issue in the Linux kernel code: io_uring/cmd_net: use READ_ONCE() for ->addr3 read
Problem Details: Any SQE read should use READ_ONCE(), to ensure the result is read once and only once. Doesn't really matter for this case, but it's better to keep these 100% consistent and always use READ_ONCE() for the prep side of SQE handling. Fixes: 5d24321e4c15 ("io_uring: Introduce getsockname io_uring cmd") Si...
```diff diff --git a/io_uring/cmd_net.c b/io_uring/cmd_net.c index 57ddaf874611..125a81c520a6 100644 --- a/io_uring/cmd_net.c +++ b/io_uring/cmd_net.c @@ -146,7 +146,7 @@ static int io_uring_cmd_getsockname(struct socket *sock, return -EINVAL; uaddr = u64_to_user_ptr(READ_ONCE(sqe->addr)); - ulen = u64_to_user_p...
3733f4be287029dad963534da3d91ac806df233d
Analyze and fix the following issue in the Linux kernel code: bpf: Do not increment tailcall count when prog is NULL
Problem Details: Currently, tailcall count is incremented in the interpreter even when tailcall fails due to non-existent prog. Fix this by holding off on the tailcall count increment until after NULL check on the prog. Suggested-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Hari Bathini <hbathini@linux.ibm....
```diff diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 3ece2da55625..229c74f3d6ae 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -2060,12 +2060,12 @@ select_insn: if (unlikely(tail_call_cnt >= MAX_TAIL_CALL_CNT)) goto out; - tail_call_cnt++; - prog = READ_ONCE(array->ptrs[index]); i...
4fcaf09f5ddffe7021266957e9623eac2fb03ff7
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: fix spelling mistakes in rtw_wlan_util.c
Problem Details: Fix spelling mistakes in comments found by codespell: - alloction => allocation - overwirte => overwrite - indx => index Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl> Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com> Link: https://patch.msgid.link/20260223200006.145296-1-tomasz.unger@yaho...
```diff diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c index 3242978da36c..74c31a97f093 100644 --- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c @@ -572,7 +572,7 @@ s16 rtw_camid_alloc(struct adapter *a...
db7fb3588ab49203bdc9d30bb4e7a8fbb7dc0fe0
Analyze and fix the following issue in the Linux kernel code: staging: sm750fb: remove debug and diagnostic prints
Problem Details: Remove all pr_info, pr_debug, and pr_warn calls that dump internal variable values, pointer addresses, and structure contents not useful for production use. This includes the complete fb_find_mode() result logging in lynxfb_set_fbinfo(), the CH7301 DVI chip status messages in hw_sm750_inithw(), and var...
```diff diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 5c8f2ea784b2..0670b1b0881c 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -375,7 +375,6 @@ static int lynxfb_ops_set_par(struct fb_info *info) line_length = var->xres_virtual * var->bits...
8bd9b67dc6e272f88c59365a2f55d38d52091cf9
Analyze and fix the following issue in the Linux kernel code: staging: sm750fb: Fix "varios" typo in ddk750_swi2c.c
Problem Details: Fix spelling of "varios" to "various". Signed-off-by: Ahmet Ramazan Capoglu <ahmetramazancapoglu@gmail.com> Link: https://patch.msgid.link/20260224113806.1506361-1-ahmetramazancapoglu@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c index 0ef8d4ff2ef9..e63f3b00ec4c 100644 --- a/drivers/staging/sm750fb/ddk750_swi2c.c +++ b/drivers/staging/sm750fb/ddk750_swi2c.c @@ -27,7 +27,7 @@ * * I.e. the SCL may only be changed in section 1. and section 3. w...
25b510c1923a0b42cd0f97d96a8051f38961890a
Analyze and fix the following issue in the Linux kernel code: staging: sm750fb: Fix "programed" typo in ddk750_mode.c
Problem Details: Fix spelling of "programed" to "programmed" and remove extra space. Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Link: https://patch.msgid.link/20260224094616.42494-2-giorgitchankvetadze1997@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 3b25892af713..7163232c0701 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -74,7 +74,7 @@ display_control_adjust_SM750LE(struct mode_parameter *mode_param, return ...
29e79c66b3ccb46cacd2dcd92f45291506fb5259
Analyze and fix the following issue in the Linux kernel code: staging: nvec: fix block comment style in nvec_interrupt()
Problem Details: Fix multi-line block comment to use the preferred kernel comment style with leading asterisks on each line and a trailing */ on a separate line, as reported by checkpatch.pl. Signed-off-by: Kibaek Yoo <psykibaek@gmail.com> Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com> Link: https://patch.msgid...
```diff diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index c6be750bee9d..952c5a849a56 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -659,8 +659,10 @@ static irqreturn_t nvec_interrupt(int irq, void *dev) nvec_tx_set(nvec); to_send = nvec->tx->data[0]; ...
2da10bcaa58a389ca60f8e788180e0dca00739bc
Analyze and fix the following issue in the Linux kernel code: scsi: lpfc: Fix incorrect txcmplq_cnt during cleanup in lpfc_sli_abort_ring()
Problem Details: When a port is offline in lpfc_sli_abort_ring, the phba->txcmplq is cleared but the phba->txcmplq_cnt is not reset to zero. This can sometimes result in a phba->txcmplq_cnt that never reaches zero, which hangs the cleanup process. Update lpfc_sli_abort_ring so that txcmplq_cnt is reset to zero and al...
```diff diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index fc7d478779f8..bd71292e7480 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -4572,59 +4572,41 @@ void lpfc_sli_abort_iocb_ring(struct lpfc_hba *phba, struct lpfc_sli_ring *pring) { LIST_HEAD(tx_comp...
a75281626fc8fa6dc6c9cc314ee423e8bc45203b
Analyze and fix the following issue in the Linux kernel code: staging: rtl8723bs: fix potential out-of-bounds read in rtw_restruct_wmm_ie
Problem Details: The current code checks 'i + 5 < in_len' at the end of the if statement. However, it accesses 'in_ie[i + 5]' before that check, which can lead to an out-of-bounds read. Move the length check to the beginning of the conditional to ensure the index is within bounds before accessing the array. Fixes: 554...
```diff diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index 7df651708381..1ef48bf6581c 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -1988,7 +1988,10 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *i...
645186bf86932c6b9deed2e564cffd09576ba9a4
Analyze and fix the following issue in the Linux kernel code: drm/sun4i: fix kernel-doc warnings in sunxi_engine.h
Problem Details: Correct the kernel-doc notation, add a missing struct member comment, and add a missing "Returns:" function comment to eliminate kernel-doc warnings: Warning: drivers/gpu/drm/sun4i/sunxi_engine.h:116 Incorrect use of kernel-doc format: * @mode_set Warning: drivers/gpu/drm/sun4i/sunxi_engine.h:125 str...
```diff diff --git a/drivers/gpu/drm/sun4i/sunxi_engine.h b/drivers/gpu/drm/sun4i/sunxi_engine.h index ec0c4932f15c..c9461de06cd0 100644 --- a/drivers/gpu/drm/sun4i/sunxi_engine.h +++ b/drivers/gpu/drm/sun4i/sunxi_engine.h @@ -114,7 +114,7 @@ struct sunxi_engine_ops { void (*vblank_quirk)(struct sunxi_engine *engine)...
06277983eca4a31d3c2114fa33d99a6e82484b11
Analyze and fix the following issue in the Linux kernel code: drm/sun4i: backend: fix error pointer dereference
Problem Details: The function drm_atomic_get_plane_state() can return an error pointer and is not checked for it. Add error pointer check. Detected by Smatch: drivers/gpu/drm/sun4i/sun4i_backend.c:496 sun4i_backend_atomic_check() error: 'plane_state' dereferencing possible ERR_PTR() Fixes: 96180dde23b79 ("drm/sun4i: ...
```diff diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 40405a52a073..6391bdc94a5c 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -491,6 +491,9 @@ static int sun4i_backend_atomic_check(struct sunxi_engine *engine, drm_...
c5a244bf17caf2de22f9e100832b75f72b31d3e6
Analyze and fix the following issue in the Linux kernel code: perf metricgroup: Fix metricgroup__has_metric_or_groups
Problem Details: Use metricgroup__for_each_metric rather than pmu_metrics_table__for_each_metric that combines the default metric table with, a potentially empty, CPUID table. Fixes: cee275edcdb1 ("perf metricgroup: Don't early exit if no CPUID table exists") Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-by:...
```diff diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 46bf4dfeebc8..7e39d469111b 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -1605,9 +1605,9 @@ bool metricgroup__has_metric_or_groups(const char *pmu, const char *metric_or_gr .metric_or_groups =...
aa6a6a2d16c1e2e27e986936369959d70316199f
Analyze and fix the following issue in the Linux kernel code: perf parse-events: Fix big-endian 'overwrite' by writing correct union member
Problem Details: The "Read backward ring buffer" test crashes on big-endian (e.g. s390x) due to a NULL dereference when the backward mmap path isn't enabled. Reproducer: # ./perf test -F 'Read backward ring buffer' Segmentation fault (core dumped) # uname -m s390x # Root cause: get_config_terms() stores int...
```diff diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index b9efb296bba5..7b4629625b1e 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -1117,7 +1117,7 @@ static int config_attr(struct perf_event_attr *attr, static struct evsel_config_term *add_config...
744629904c68bde847c31819f23482d09152f810
Analyze and fix the following issue in the Linux kernel code: drm/sun4i: mixer: Fix layer init code
Problem Details: Code refactoring dropped extra NULL sentinel entry at the end of the drm planes array. Add it back. Reported-by: Chen-Yu Tsai <wens@kernel.org> Closes: https://lore.kernel.org/linux-sunxi/CAGb2v65wY2pF6sR+0JgnpLa4ysvjght5hAKDa1RUyo=zEKXreg@mail.gmail.com/ Fixes: 4fa45b04a47d ("drm/sun4i: layer: move ...
```diff diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index ce9c155bfad7..02acc7cbdb97 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -321,7 +321,7 @@ static struct drm_plane **sun8i_layers_init(struct drm_device *drm, unsigned in...
fe5669e363b129cde285bfb4d45abb72d1d77cfc
Analyze and fix the following issue in the Linux kernel code: irqchip/ls-extirq: Fix devm_of_iomap() error check
Problem Details: The devm_of_iomap() function returns an ERR_PTR() encoded error code on failure. Replace the incorrect check against NULL with IS_ERR(). Fixes: 05cd654829dd ("irqchip/ls-extirq: Convert to a platform driver to make it work again") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Io...
```diff diff --git a/drivers/irqchip/irq-ls-extirq.c b/drivers/irqchip/irq-ls-extirq.c index 96f9c20621cf..d724fe843980 100644 --- a/drivers/irqchip/irq-ls-extirq.c +++ b/drivers/irqchip/irq-ls-extirq.c @@ -190,8 +190,10 @@ static int ls_extirq_probe(struct platform_device *pdev) return dev_err_probe(dev, -ENOMEM, "...
e08f2adcf990b8cf272e90898401a9e481c1c667
Analyze and fix the following issue in the Linux kernel code: Revert "irqchip/ls-extirq: Use for_each_of_imap_item iterator"
Problem Details: This reverts commit 3ac6dfe3d7a2396602b67667249b146504dfbd2a. The ls-extirq uses interrupt-map but it's a non-standard use documented in fsl,ls-extirq.yaml: # The driver(drivers/irqchip/irq-ls-extirq.c) have not use standard DT # function to parser interrupt-map. So it doesn't conside...
```diff diff --git a/drivers/irqchip/irq-ls-extirq.c b/drivers/irqchip/irq-ls-extirq.c index a7e9c3885b09..96f9c20621cf 100644 --- a/drivers/irqchip/irq-ls-extirq.c +++ b/drivers/irqchip/irq-ls-extirq.c @@ -125,32 +125,45 @@ static const struct irq_domain_ops extirq_domain_ops = { static int ls_extirq_parse_map(struc...
571cc8356cbf01252d2bbf4101da99380129a727
Analyze and fix the following issue in the Linux kernel code: drm/i915/selftests: Fix build after dma-fence locking rework
Problem Details: The i915_active selftest no longer builds after the dma-fence locking rework because it directly accessed the fence’s spinlock. The helper dma_fence_spinlock() must now be used to obtain the spinlock. Update the selftest to use dma_fence_spinlock() accordingly. Fixes: 1f32f310a13c ("dma-buf: inline sp...
```diff diff --git a/drivers/gpu/drm/i915/selftests/i915_active.c b/drivers/gpu/drm/i915/selftests/i915_active.c index 52345073b409..9fea2fabeac4 100644 --- a/drivers/gpu/drm/i915/selftests/i915_active.c +++ b/drivers/gpu/drm/i915/selftests/i915_active.c @@ -323,9 +323,9 @@ static void active_flush(struct i915_active *...
bfd7db781e2e7a99b086d645a104d16e368f58ff
Analyze and fix the following issue in the Linux kernel code: regulator: Kconfig: fix a typo
Problem Details: Fixes a typo in Kconfig, HWWON -> HWMON Signed-off-by: Felix Gu <ustc.gu@gmail.com> Link: https://patch.msgid.link/20260224-kconfig-v1-1-b0c5459ed7a0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
```diff diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index a708fc63f581..d10b6f9243d5 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -508,7 +508,7 @@ config REGULATOR_FP9931 This driver supports the FP9931/JD9930 voltage regulator chip which is used to provide po...
4baaddaa44af01cd4ce239493060738fd0881835
Analyze and fix the following issue in the Linux kernel code: regulator: bq257xx: Fix device node reference leak in bq257xx_reg_dt_parse_gpio()
Problem Details: In bq257xx_reg_dt_parse_gpio(), if fails to get subchild, it returns without calling of_node_put(child), causing the device node reference leak. Fixes: 981dd162b635 ("regulator: bq257xx: Add bq257xx boost regulator driver") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Link: https://patch.msgid.link/202...
```diff diff --git a/drivers/regulator/bq257xx-regulator.c b/drivers/regulator/bq257xx-regulator.c index fc1ccede4468..dab8f1ab4450 100644 --- a/drivers/regulator/bq257xx-regulator.c +++ b/drivers/regulator/bq257xx-regulator.c @@ -115,11 +115,10 @@ static void bq257xx_reg_dt_parse_gpio(struct platform_device *pdev) ...
0902010c8d163f7b62e655efda1a843529152c7c
Analyze and fix the following issue in the Linux kernel code: regulator: fp9931: Fix PM runtime reference leak in fp9931_hwmon_read()
Problem Details: In fp9931_hwmon_read(), if regmap_read() failed, the function returned the error code without calling pm_runtime_put_autosuspend(), causing a PM reference leak. Fixes: 12d821bd13d4 ("regulator: Add FP9931/JD9930 driver") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Reviewed-by: Andreas Kemnade <andreas...
```diff diff --git a/drivers/regulator/fp9931.c b/drivers/regulator/fp9931.c index 7fbcc6327cc6..abea3b69d8a0 100644 --- a/drivers/regulator/fp9931.c +++ b/drivers/regulator/fp9931.c @@ -144,13 +144,12 @@ static int fp9931_hwmon_read(struct device *dev, enum hwmon_sensor_types type, return ret; ret = regmap_read...
74b6e83942dcc9f3cca9e561b205a5b19940a344
Analyze and fix the following issue in the Linux kernel code: drm/gpusvm: Fix drm_gpusvm_pages_valid_unlocked() kernel-doc
Problem Details: The kernel-doc for drm_gpusvm_pages_valid_unlocked() was stale and still referenced old range-based arguments and naming. Update the documentation to match the current function arguments and signature. Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankh...
```diff diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c index 24180bfdf5a2..9ef9e52c0547 100644 --- a/drivers/gpu/drm/drm_gpusvm.c +++ b/drivers/gpu/drm/drm_gpusvm.c @@ -1338,14 +1338,14 @@ bool drm_gpusvm_range_pages_valid(struct drm_gpusvm *gpusvm, EXPORT_SYMBOL_GPL(drm_gpusvm_range_pages_va...
62c015373e1cdb1cdca824bd2dbce2dac0819467
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Move link recovery for hibern8 exit failure to wl_resume
Problem Details: Move the link recovery trigger from ufshcd_uic_pwr_ctrl() to __ufshcd_wl_resume(). Ensure link recovery is only attempted when hibern8 exit fails during resume, not during hibern8 enter in suspend. Improve error handling and prevent unnecessary link recovery attempts. Fixes: 35dabf4503b9 ("scsi: ufs: ...
```diff diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 4dc7fbc2a6db..85987373b961 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -4390,14 +4390,6 @@ out_unlock: spin_unlock_irqrestore(hba->host->host_lock, flags); mutex_unlock(&hba->uic_cmd_mutex); - /* - * If...
30df81f2228d65bddf492db3929d9fcaffd38fc5
Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Fix possible NULL pointer dereference in ufshcd_add_command_trace()
Problem Details: The kernel log indicates a crash in ufshcd_add_command_trace, due to a NULL pointer dereference when accessing hwq->id. This can happen if ufshcd_mcq_req_to_hwq() returns NULL. This patch adds a NULL check for hwq before accessing its id field to prevent a kernel crash. Kernel log excerpt: [<ffffffd...
```diff diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 571a73860561..4dc7fbc2a6db 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -518,8 +518,8 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, struct scsi_cmnd *cmd, if (hba->mcq_enabled) { struct uf...
92ab53b9bb2a72581c32073755077af916eb9aee
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8-apalis: Fix LEDs name collision
Problem Details: Ixora boards have multiple instances of status leds, to avoid a name collision add the function-enumerator property. This fixes the following Linux kernel warnings: leds-gpio leds: Led green:status renamed to green:status_1 due to name collision leds-gpio leds: Led red:status renamed to red:statu...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8-apalis-ixora-v1.1.dtsi b/arch/arm64/boot/dts/freescale/imx8-apalis-ixora-v1.1.dtsi index 2677bc761b39..93f485140b20 100644 --- a/arch/arm64/boot/dts/freescale/imx8-apalis-ixora-v1.1.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8-apalis-ixora-v1.1.dtsi @@ -21,6 +21,...
fb20ccf70cf695f178d7c32e2d33b376560df0ff
Analyze and fix the following issue in the Linux kernel code: clk: sunxi-ng: sun55i-a523-r: Add missing r-spi module clock
Problem Details: When the PRCM clk driver was added, somehow the r-spi module clock was skipped over. Add it so that r-spi can actually work. Fixes: 8cea339cfb81 ("clk: sunxi-ng: add support for the A523/T527 PRCM CCU") Reviewed-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@g...
```diff diff --git a/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c b/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c index 0339c4af0fe5..db0e36d8838e 100644 --- a/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c +++ b/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c @@ -83,9 +83,22 @@ static SUNXI_CCU_MUX_DATA_WITH_GATE(r_pwmctrl_clk, "r-pwmctrl"...
ad90ecedad755e2f3e31364ec3130e5bb2f4b64a
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix out-of-bounds array access bugs reported by ASAN
Problem Details: - kmem_cache_iter: remove unnecessary debug output - lwt_seg6local: change the type of foobar to char[] - the sizeof(foobar) returned the pointer size and not a string length as intended - verifier_log: increase prog_name buffer size in verif_log_subtest() - compiler has a conservative estimate...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/kmem_cache_iter.c b/tools/testing/selftests/bpf/prog_tests/kmem_cache_iter.c index 6e35e13c2022..399fe9103f83 100644 --- a/tools/testing/selftests/bpf/prog_tests/kmem_cache_iter.c +++ b/tools/testing/selftests/bpf/prog_tests/kmem_cache_iter.c @@ -104,11 +104,8...
3e711c8e4707c46cc45d9775b50204d0f2790d77
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix array bounds warning in jit_disasm_helpers
Problem Details: Compiler cannot infer upper bound for labels.cnt and warns about potential buffer overflow in snprintf. Add an explicit bounds check (... && i < MAX_LOCAL_LABELS) in the loop condition to fix the warning. Acked-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux....
```diff diff --git a/tools/testing/selftests/bpf/jit_disasm_helpers.c b/tools/testing/selftests/bpf/jit_disasm_helpers.c index febd6b12e372..364c557c5115 100644 --- a/tools/testing/selftests/bpf/jit_disasm_helpers.c +++ b/tools/testing/selftests/bpf/jit_disasm_helpers.c @@ -122,15 +122,15 @@ static int disasm_one_func(...
71dca2950fe9abf8e6fd3d9f5e6342da6634b898
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix resource leaks caused by missing cleanups
Problem Details: ASAN reported a number of resource leaks: - Add missing *__destroy(skel) calls - Replace bpf_link__detach() with bpf_link__destroy() where appropriate - cgrp_local_storage: Add bpf_link__destroy() when bpf_iter_create fails - dynptr: Add missing bpf_object__close() Acked-by: Eduard Zingerman ...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c b/tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c index 9015e2c2ab12..478a77cb67e6 100644 --- a/tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c +++ b/tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c @@ -2...
68b8bea1eec392aa50736a859b8f1418067a3bc4
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix double thread join in uprobe_multi_test
Problem Details: ASAN reported a "joining already joined thread" error. The release_child() may be called multiple times for the same struct child. Fix by resetting child->thread to 0 after pthread_join. Also memset(0) static child variable in test_attach_api(). Acked-by: Mykyta Yatsenko <yatsenko@meta.com> Acked-by...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c b/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c index 2ee17ef1dae2..56cbea280fbd 100644 --- a/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c +++ b/tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c @@ -62,8 ...
f7ac552be7f13e834a942f64b1ac87e7755b32f4
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix use-after-free in xdp_metadata test
Problem Details: ASAN reported a use-after-free in close_xsk(). The xsk->socket internally references xsk->umem via socket->ctx->umem, so the socket must be deleted before the umem. Fix the order of operations in close_xsk(). Acked-by: Mykyta Yatsenko <yatsenko@meta.com> Signed-off-by: Ihor Solodrai <ihor.solodrai@li...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c b/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c index 19f92affc2da..5c31054ad4a4 100644 --- a/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c +++ b/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c @@ -126,10 +126,10 @@ static ...
ff9511410d5fbdec21a3bbfaa477aa1f56735b33
Analyze and fix the following issue in the Linux kernel code: veristat: Fix a memory leak for preset ENUMERATOR
Problem Details: ASAN detected a memory leak in veristat. The cleanup code handling ENUMERATOR value missed freeing strdup-ed svalue. Fix it. Acked-by: Mykyta Yatsenko <yatsenko@meta.com> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev> Link: https://lore.kernel.org/r/20260223190736.649171-13-ihor.solodrai@linux...
```diff diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c index 1be1e353d40a..75f85e0362f5 100644 --- a/tools/testing/selftests/bpf/veristat.c +++ b/tools/testing/selftests/bpf/veristat.c @@ -3378,6 +3378,8 @@ int main(int argc, char **argv) } } free(env.presets[i].a...
3eb4a2e399c6766ea0c8291e2adb5e6dc42b6e68
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix cleanup in check_fd_array_cnt__fd_array_too_big()
Problem Details: The Close() macro uses the passed in expression three times, which leads to repeated execution in case it has side effects. That is, Close(i--) would decrement i three times. ASAN caught a stack-buffer-undeflow error at a point where this was overlooked. Fix it. Acked-by: Eduard Zingerman <eddyz87@gm...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/fd_array.c b/tools/testing/selftests/bpf/prog_tests/fd_array.c index c534b4d5f9da..3078d8264deb 100644 --- a/tools/testing/selftests/bpf/prog_tests/fd_array.c +++ b/tools/testing/selftests/bpf/prog_tests/fd_array.c @@ -412,8 +412,8 @@ static void check_fd_arra...
9d0272c91fbc3ae86f2c3b6ba0a0b0ee77d862e3
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix memory leaks in tests
Problem Details: Fix trivial memory leaks detected by userspace ASAN: - htab_update: free value buffer in test_reenter_update cleanup - test_xsk: inline pkt_stream_replace() in testapp_stats_rx_full() and testapp_stats_fill_empty() - testing_helpers: free buffer allocated by getline() in parse_test_list_f...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/htab_update.c b/tools/testing/selftests/bpf/prog_tests/htab_update.c index d0b405eb2966..ea1a6766fbe9 100644 --- a/tools/testing/selftests/bpf/prog_tests/htab_update.c +++ b/tools/testing/selftests/bpf/prog_tests/htab_update.c @@ -61,6 +61,7 @@ static void tes...
a1a771bd649212ef32cf9b0bcc63213a762d354a
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Refactor bpf_get_ksyms() trace helper
Problem Details: ASAN reported a memory leak in bpf_get_ksyms(): it allocates a struct ksyms internally and never frees it. Move struct ksyms to trace_helpers.h and return it from the bpf_get_ksyms(), giving ownership to the caller. Add filtered_syms and filtered_cnt fields to the ksyms to hold the filtered array of s...
```diff diff --git a/tools/testing/selftests/bpf/benchs/bench_trigger.c b/tools/testing/selftests/bpf/benchs/bench_trigger.c index aeec9edd3851..f74b313d6ae4 100644 --- a/tools/testing/selftests/bpf/benchs/bench_trigger.c +++ b/tools/testing/selftests/bpf/benchs/bench_trigger.c @@ -230,8 +230,8 @@ static void trigger_f...
c5c1e313493cd836863bb673bb2b8beaa915cad9
Analyze and fix the following issue in the Linux kernel code: resolve_btfids: Fix memory leaks reported by ASAN
Problem Details: Running resolve_btfids with ASAN reveals memory leaks in btf_id handling. - Change get_id() to use a local buffer - Make btf_id__add() strdup the name internally - Add btf_id__free_all() that frees all nodese of a tree - Call the cleanup function on exit for every tree Acked-by: Jiri Olsa <jolsa@kern...
```diff diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c index ca7fcd03efb6..5208f650080f 100644 --- a/tools/bpf/resolve_btfids/main.c +++ b/tools/bpf/resolve_btfids/main.c @@ -226,7 +226,7 @@ static struct btf_id *btf_id__find(struct rb_root *root, const char *name) } static struct bt...
4021848a903e65f74cf88997c12b96d6bc2453e6
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Pass through build flags to bpftool and resolve_btfids
Problem Details: EXTRA_* and SAN_* build flags were not correctly propagated to bpftool and resolve_btids when building selftests/bpf. This led to various build errors on attempt to build with SAN_CFLAGS="-fsanitize=address", for example. Fix the makefiles to address this: - Pass SAN_CFLAGS/SAN_LDFLAGS to bpftool an...
```diff diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile index 1733a6e93a07..ef083602b73a 100644 --- a/tools/bpf/resolve_btfids/Makefile +++ b/tools/bpf/resolve_btfids/Makefile @@ -65,6 +65,9 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OU LIBELF_FL...
e46f25f5a81f6f1a9ab93bcda80d5dfaea9f4897
Analyze and fix the following issue in the Linux kernel code: cxl/region: Test CXL_DECODER_F_NORMALIZED_ADDRESSING as a bitmask
Problem Details: The CXL decoder flags are defined as bitmasks, not bit indices. Using test_bit() to check them interprets the mask value as a bit index, which is the wrong test. For CXL_DECODER_F_NORMALIZED_ADDRESSING the test reads beyond the flags word, making the flag sometimes appear set and blocking creation of ...
```diff diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index 780ec947ecf2..42874948b589 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -1105,7 +1105,7 @@ static void cxl_region_setup_flags(struct cxl_region *cxlr, clear_bit(CXL_REGION_F_NEEDS_RESET, &cxlr->flags); } ...
0a70b7cd397e545e926c93715ff6366b67c716f6
Analyze and fix the following issue in the Linux kernel code: cxl: Test CXL_DECODER_F_LOCK as a bitmask
Problem Details: The CXL decoder flags are defined as bitmasks, not bit indices. Using test_bit() to check them interprets the mask value as a bit index, which is the wrong test. For CXL_DECODER_F_LOCK the test reads beyond the defined bits, causing the test to always return false and allowing resets that should have ...
```diff diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c index e3f0c39e6812..c222e98ae736 100644 --- a/drivers/cxl/core/hdm.c +++ b/drivers/cxl/core/hdm.c @@ -904,7 +904,7 @@ static void cxl_decoder_reset(struct cxl_decoder *cxld) if ((cxld->flags & CXL_DECODER_F_ENABLE) == 0) return; - if (test_bit(...
60b5d1f68338aff2c5af0113f04aefa7169c50c2
Analyze and fix the following issue in the Linux kernel code: cxl/mbox: validate payload size before accessing contents in cxl_payload_from_user_allowed()
Problem Details: cxl_payload_from_user_allowed() casts and dereferences the input payload without first verifying its size. When a raw mailbox command is sent with an undersized payload (ie: 1 byte for CXL_MBOX_OP_CLEAR_LOG, which expects a 16-byte UUID), uuid_equal() reads past the allocated buffer, triggering a KASAN...
```diff diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c index fa6dd0c94656..e7a6452bf544 100644 --- a/drivers/cxl/core/mbox.c +++ b/drivers/cxl/core/mbox.c @@ -311,6 +311,7 @@ static bool cxl_mem_raw_command_allowed(u16 opcode) * cxl_payload_from_user_allowed() - Check contents of in_payload. * @opco...
96a1fd0d84b17360840f344826897fa71049870e
Analyze and fix the following issue in the Linux kernel code: cxl: Fix race of nvdimm_bus object when creating nvdimm objects
Problem Details: Found issue during running of cxl-translate.sh unit test. Adding a 3s sleep right before the test seems to make the issue reproduce fairly consistently. The cxl_translate module has dependency on cxl_acpi and causes orphaned nvdimm objects to reprobe after cxl_acpi is removed. The nvdimm_bus object is ...
```diff diff --git a/drivers/cxl/core/pmem.c b/drivers/cxl/core/pmem.c index b652e3486038..68462e38a977 100644 --- a/drivers/cxl/core/pmem.c +++ b/drivers/cxl/core/pmem.c @@ -115,6 +115,15 @@ static void unregister_nvb(void *_cxl_nvb) device_unregister(&cxl_nvb->dev); } +static bool cxl_nvdimm_bridge_failed_attach...
d116bccf6f1c199b27c9ebdf07cc3cfe868f919c
Analyze and fix the following issue in the Linux kernel code: remoteproc: xlnx: Fix sram property parsing
Problem Details: As per sram bindings, "sram" property can be list of phandles. When more than one sram phandles are listed, driver can't parse second phandle's address correctly. Because, phandle index is passed to the API instead of offset of address from reg property which is always 0 as per sram.yaml bindings. Fix ...
```diff diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index b71ce69afe9f..5a468d959f1e 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -1005,7 +1005,7 @@ static int zynqmp_r5_get_sram_banks(struct zynqmp_r5_core *r5_c...
07ed4f05bbfd2bc014974dcc4297fd3aa1cb88c0
Analyze and fix the following issue in the Linux kernel code: hwmon: (it87) Check the it87_lock() return value
Problem Details: Return early in it87_resume() if it87_lock() fails instead of ignoring the return value of that function. This patch suppresses a Clang thread-safety warning. Cc: Frank Crawford <frank@crawford.emu.id.au> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Jean Delvare <jdelvare@suse.com> Cc: linux-hwmon@vger....
```diff diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index e233aafa8856..5cfb98a0512f 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -3590,10 +3590,13 @@ static int it87_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct it87_data *data = dev_ge...
364410170ab33f6e7ef0eb2afb12bf89b0feb3a6
Analyze and fix the following issue in the Linux kernel code: nfsd: report the requested maximum number of threads instead of number running
Problem Details: The current netlink and /proc interfaces deviate from their traditional values when dynamic threading is enabled, and there is currently no way to know what the current setting is. This patch brings the reporting back in line with traditional behavior. Make these interfaces report the requested maximu...
```diff diff --git a/Documentation/netlink/specs/nfsd.yaml b/Documentation/netlink/specs/nfsd.yaml index badb2fe57c98..f87b5a05e5e9 100644 --- a/Documentation/netlink/specs/nfsd.yaml +++ b/Documentation/netlink/specs/nfsd.yaml @@ -152,7 +152,7 @@ operations: - compound-ops - name: threads-set -...
d3f36fa57aa289c43e01da16c928a2cd971ad5dc
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: fix aux device registration for multi-GPU systems
Problem Details: The auxiliary device registration was using a hardcoded ID of 0, which caused probe() to fail on multi-GPU systems with: sysfs: cannot create duplicate filename '/bus/auxiliary/devices/NovaCore.nova-drm.0' Fix this by using an atomic counter to generate unique IDs for each GPU's aux device registr...
```diff diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs index e39885c0d5ca..84b0e1703150 100644 --- a/drivers/gpu/nova-core/driver.rs +++ b/drivers/gpu/nova-core/driver.rs @@ -14,11 +14,20 @@ use kernel::{ }, prelude::*, sizes::SZ_16M, - sync::Arc, // + sync::{ + ...
ab39cc4cb8ceecdc2b61747433e7237f1ac2b789
Analyze and fix the following issue in the Linux kernel code: cpufreq: intel_pstate: Fix NULL pointer dereference in update_cpu_qos_request()
Problem Details: The update_cpu_qos_request() function attempts to initialize the 'freq' variable by dereferencing 'cpudata' before verifying if the 'policy' is valid. This issue occurs on systems booted with the "nosmt" parameter, where all_cpu_data[cpu] is NULL for the SMT sibling threads. As a result, any call to u...
```diff diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index a48af3540c74..bdc37080d319 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -1647,8 +1647,8 @@ static ssize_t store_no_turbo(struct kobject *a, struct kobj_attribute *b, static void update_cpu_...
e5a80f5e67ce95c41615471d89ae7412b298cd85
Analyze and fix the following issue in the Linux kernel code: net: l2tp_eth: Replace deprecated strcpy with strscpy in l2tp_eth_create
Problem Details: strcpy() has been deprecated [1] because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. Replace it with the safer strscpy(). Use the two-argument version of strscpy() to copy 'cfg->ifname'. Link: https://www.kernel.org/doc/html/latest/process/deprecated....
```diff diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c index cf0b66f4fb29..a4956ef9574c 100644 --- a/net/l2tp/l2tp_eth.c +++ b/net/l2tp/l2tp_eth.c @@ -14,6 +14,7 @@ #include <linux/in.h> #include <linux/etherdevice.h> #include <linux/spinlock.h> +#include <linux/string.h> #include <net/sock.h> #include <ne...
1f8fb2a87b58c2d12b7a9c817b8e781be90fe37d
Analyze and fix the following issue in the Linux kernel code: arm64: dts: axis: artpec9: Fix missing soc unit address
Problem Details: Fix W=1 build warning to comply with Samsuung SoC maintainer profile: artpec9.dtsi:121.11-268.4: Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name Fixes: 3ae2b7442cb8 ("arm64: dts: exynos: axis: Add initial ARTPEC-9 SoC support") Signed-off-by: Krzysztof Kozlo...
```diff diff --git a/arch/arm64/boot/dts/exynos/axis/artpec9.dtsi b/arch/arm64/boot/dts/exynos/axis/artpec9.dtsi index f644198fa80f..f8ed43c6e825 100644 --- a/arch/arm64/boot/dts/exynos/axis/artpec9.dtsi +++ b/arch/arm64/boot/dts/exynos/axis/artpec9.dtsi @@ -118,7 +118,7 @@ method = "smc"; }; - soc: soc { + soc:...
78437ab3b769f80526416570f60173c89858dd84
Analyze and fix the following issue in the Linux kernel code: clk: scu/imx8qxp: do not register driver in probe()
Problem Details: imx_clk_scu_init() registers the imx_clk_scu_driver while commonly being called from IMX driver's probe() callbacks. However, it neither makes sense to register drivers from probe() callbacks of other drivers, nor does the driver core allow registering drivers with a device lock already being held. T...
```diff diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c index 3ae162625bb1..c781425a005e 100644 --- a/drivers/clk/imx/clk-imx8qxp.c +++ b/drivers/clk/imx/clk-imx8qxp.c @@ -346,7 +346,29 @@ static struct platform_driver imx8qxp_clk_driver = { }, .probe = imx8qxp_clk_probe, }; -module_plat...
c8dbdc6e380e7e96a51706db3e4b7870d8a9402d
Analyze and fix the following issue in the Linux kernel code: net: phy: register phy led_triggers during probe to avoid AB-BA deadlock
Problem Details: There is an AB-BA deadlock when both LEDS_TRIGGER_NETDEV and LED_TRIGGER_PHY are enabled: [ 1362.049207] [<8054e4b8>] led_trigger_register+0x5c/0x1fc <-- Trying to get lock "triggers_list_lock" via down_write(&triggers_list_lock); [ 1362.054536] [<80662830>] phy_led_triggers_register+0xd0/...
```diff diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 9b8eaac63b90..cbb4af604aa5 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1866,8 +1866,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, goto error; phy_resume(phyd...