id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
16459fe7e0ca6520a6e8f603de4ccd52b90fd765
Analyze and fix the following issue in the Linux kernel code: x86/kfence: fix booting on 32bit non-PAE systems
Problem Details: The original patch inverted the PTE unconditionally to avoid L1TF-vulnerable PTEs, but Linux doesn't make this adjustment in 2-level paging. Adjust the logic to use the flip_protnone_guard() helper, which is a nop on 2-level paging but inverts the address bits in all other paging modes. This doesn't ...
```diff diff --git a/arch/x86/include/asm/kfence.h b/arch/x86/include/asm/kfence.h index acf9ffa1a171..dfd5c74ba41a 100644 --- a/arch/x86/include/asm/kfence.h +++ b/arch/x86/include/asm/kfence.h @@ -42,7 +42,7 @@ static inline bool kfence_protect_page(unsigned long addr, bool protect) { unsigned int level; pte_t *...
d55493f6d2dae3a8e8b50fe82e947781a7735c51
Analyze and fix the following issue in the Linux kernel code: platform/chrome: lightbar: Fix lightbar_program_ex alignment
Problem Details: Make sure sub-command of lightbar command starts with a 8bit parameter to ensure alignment. Fixes: 9600b8bdbfe4 ("platform/chrome: lightbar: Add support for large sequence") Signed-off-by: Gwendal Grignou <gwendal@google.com> Link: https://lore.kernel.org/r/20260202100621.3608437-1-gwendal@google.com ...
```diff diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h index 144243143034..bddc7568158e 100644 --- a/include/linux/platform_data/cros_ec_commands.h +++ b/include/linux/platform_data/cros_ec_commands.h @@ -2026,10 +2026,10 @@ struct lightbar_program { * EC ...
c28d765ec5da160d3a48d0928528084cef97bf19
Analyze and fix the following issue in the Linux kernel code: net: enetc: Convert 16-bit register reads to 32-bit for ENETC v4
Problem Details: It is not recommended to access the 32‑bit registers of this hardware IP using lower‑width accessors (i.e. 16‑bit), and the only exception to this rule was introduced in the initial ENETC v1 driver for the PMAR1 register, which holds the lower 16 bits of the primary MAC address of an SI. Meanwhile, thi...
```diff diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c index c0859d200a2c..5850540634b0 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c @@ -73,7 +73,7 @@ static void enetc4_pf_get_si_pr...
21d0fc95b5920ae8e69a2c0394bef82b8392bcc9
Analyze and fix the following issue in the Linux kernel code: net: enetc: Convert 16-bit register writes to 32-bit for ENETC v4
Problem Details: For ENETC v4, which is integrated into more complex SoCs (compared to v1), 16‑bit register writes are blocked in the SoC interconnect on some chips. To be fair, it is not recommended to access 32‑bit registers of this IP using lower‑width accessors (i.e. 16‑bit), and the only exception to this rule wa...
```diff diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c index 498346dd996a..c0859d200a2c 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c @@ -59,10 +59,10 @@ static void enetc4_pf_set_si_...
9ae13b2e64fcd2ca00a76b7d60fc4641a6b9209d
Analyze and fix the following issue in the Linux kernel code: net: enetc: Remove CBDR cacheability AXI settings for ENETC v4
Problem Details: For ENETC v4 these settings are controlled by the global ENETC command cache attribute registers (EnCAR), from the IERB register block. The hardcoded CDBR cacheability settings were inherited from LS1028A, and should be removed from the ENETC v4 driver as they conflict with the global IERB settings. ...
```diff diff --git a/drivers/net/ethernet/freescale/enetc/enetc_cbdr.c b/drivers/net/ethernet/freescale/enetc/enetc_cbdr.c index 3d5f31879d5c..a635bfdc30af 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_cbdr.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_cbdr.c @@ -74,10 +74,6 @@ int enetc4_setup_cbdr(stru...
a69c17230cab07bd156f894fdc82bd78b43ea72f
Analyze and fix the following issue in the Linux kernel code: net: enetc: Remove SI/BDR cacheability AXI settings for ENETC v4
Problem Details: For ENETC v4 these settings are controlled by the global ENETC message and buffer cache attribute registers (EnBCAR and EnMCAR), from the IERB register block. The hardcoded cacheability settings were inherited from LS1028A, and should be removed from the ENETC v4 driver as they conflict with the globa...
```diff diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c index 53b26cece16a..e380a4f39855 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -2512,10 +2512,13 @@ int enetc_configure_si(struct enetc_ndev_...
74d9391e8849e70ded5309222d09b0ed0edbd039
Analyze and fix the following issue in the Linux kernel code: tipc: use kfree_sensitive() for session key material
Problem Details: The rx->skey field contains a struct tipc_aead_key with GCM-AES encryption keys used for TIPC cluster communication. Using plain kfree() leaves this sensitive key material in freed memory pages where it could potentially be recovered. Switch to kfree_sensitive() to ensure the key material is zeroed be...
```diff diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c index 751904f10aab..970db62bd029 100644 --- a/net/tipc/crypto.c +++ b/net/tipc/crypto.c @@ -1219,7 +1219,7 @@ void tipc_crypto_key_flush(struct tipc_crypto *c) rx = c; tx = tipc_net(rx->net)->crypto_tx; if (cancel_delayed_work(&rx->work)) { - kfree(r...
dc9fd14bd75967d039262d73189fdd123edc5dce
Analyze and fix the following issue in the Linux kernel code: net: add a debug check in __skb_push()
Problem Details: Add the following check, to detect bugs sooner for CONFIG_DEBUG_NET=y builds. DEBUG_NET_WARN_ON_ONCE(skb->data < skb->head); Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20260130160253.2936789-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
```diff diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index e6bfe5d0c525..8b399ddf1b9b 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -2813,6 +2813,7 @@ static inline void *__skb_push(struct sk_buff *skb, unsigned int len) DEBUG_NET_WARN_ON_ONCE(len > INT_MAX); skb->data -= len...
dbbec8c5a79f4c7aa8d07da8c0b5a34d76c50699
Analyze and fix the following issue in the Linux kernel code: net: stmmac: fix stm32 (and potentially others) resume regression
Problem Details: Marek reported that suspending stm32 causes the following errors when the interface is administratively down: $ echo devices > /sys/power/pm_test $ echo mem > /sys/power/state ... ck_ker_eth2stp already disabled ... ck_ker_eth2stp already unprepared ... On suspend, stm32 starts the eth2stp clo...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 3f42843cd9ed..a379221b96a3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -8042,7 +8042,7 @@ int stmmac_suspend(stru...
1c172febdf065375359b2b95156e476bfee30b60
Analyze and fix the following issue in the Linux kernel code: net: rss: fix reporting RXH_XFRM_NO_CHANGE as input_xfrm for contexts
Problem Details: Initializing input_xfrm to RXH_XFRM_NO_CHANGE in RSS contexts is problematic. I think I did this to make it clear that the context does not have its own settings applied. But unlike ETH_RSS_HASH_NO_CHANGE which is zero, RXH_XFRM_NO_CHANGE is 0xff. We need to be careful when reading the value back, and ...
```diff diff --git a/net/ethtool/common.c b/net/ethtool/common.c index 369c05cf8163..d47a279eb8b9 100644 --- a/net/ethtool/common.c +++ b/net/ethtool/common.c @@ -862,9 +862,6 @@ ethtool_rxfh_ctx_alloc(const struct ethtool_ops *ops, ctx->key_off = key_off; ctx->priv_size = ops->rxfh_priv_size; - ctx->hfunc = ETH_...
61cef6454cfbb9fcdbe41401fb53895f86603081
Analyze and fix the following issue in the Linux kernel code: bnxt_en: Allow ntuple filters for drops
Problem Details: It appears that in commit 7efd79c0e689 ("bnxt_en: Add drop action support for ntuple"), bnxt gained support for ntuple filters for packet drops. However, support for this does not seem to work in recent kernels or against net-next: % sudo ethtool -U eth0 flow-type udp4 src-ip 1.1.1.1 action -1 ...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 6b15fedbb16f..53a83b6680c4 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -1346,16 +1346,17 @@ static int bnxt_add_n...
83b67cc9be9223183caf91826d9c194d7fb128fa
Analyze and fix the following issue in the Linux kernel code: linkwatch: use __dev_put() in callers to prevent UAF
Problem Details: After linkwatch_do_dev() calls __dev_put() to release the linkwatch reference, the device refcount may drop to 1. At this point, netdev_run_todo() can proceed (since linkwatch_sync_dev() sees an empty list and returns without blocking), wait for the refcount to become 1 via netdev_wait_allrefs_any(), a...
```diff diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 212cde35affa..25c455c10a01 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -185,10 +185,6 @@ static void linkwatch_do_dev(struct net_device *dev) netif_state_change(dev); } - /* Note: our callers are responsible for callin...
3e91b44c93ad2871f89fc2a98c5e4fe6ca5db3d9
Analyze and fix the following issue in the Linux kernel code: tpm: st33zp24: Fix missing cleanup on get_burstcount() error
Problem Details: get_burstcount() can return -EBUSY on timeout. When this happens, st33zp24_send() returns directly without releasing the locality acquired earlier. Use goto out_err to ensure proper cleanup when get_burstcount() fails. Fixes: bf38b8710892 ("tpm/tpm_i2c_stm_st33: Split tpm_i2c_tpm_st33 in 2 layers (co...
```diff diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c index 2ed7815e4899..e2b7451ea7cc 100644 --- a/drivers/char/tpm/st33zp24/st33zp24.c +++ b/drivers/char/tpm/st33zp24/st33zp24.c @@ -328,8 +328,10 @@ static int st33zp24_send(struct tpm_chip *chip, unsigned char *buf, for ...
bbd6e97c836cbeb9606d7b7e5dcf8a1d89525713
Analyze and fix the following issue in the Linux kernel code: tpm: tpm_i2c_infineon: Fix locality leak on get_burstcount() failure
Problem Details: get_burstcount() can return -EBUSY on timeout. When this happens, the function returns directly without releasing the locality that was acquired at the beginning of tpm_tis_i2c_send(). Use goto out_err to ensure proper cleanup when get_burstcount() fails. Fixes: aad628c1d91a ("char/tpm: Add new drive...
```diff diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c index bdf1f329a679..8b7d32de0b2e 100644 --- a/drivers/char/tpm/tpm_i2c_infineon.c +++ b/drivers/char/tpm/tpm_i2c_infineon.c @@ -544,8 +544,10 @@ static int tpm_tis_i2c_send(struct tpm_chip *chip, u8 *buf, size_t bufsiz, bu...
341d72ebc2303670936713f5004a2825edc4e7ea
Analyze and fix the following issue in the Linux kernel code: dt-bindings: clk: rs9: Fix DIF pattern match
Problem Details: The pattern match [0-19] is incorrect and does not cover range of 0..19, use pattern 1?[0-9] to cover range 0..19 instead. Update the example to validate all parts of the pattern match and prevent such failures in the future. Fixes: 26c1bc67aa2f ("dt-bindings: clk: rs9: Add Renesas 9-series I2C PCIe c...
```diff diff --git a/Documentation/devicetree/bindings/clock/renesas,9series.yaml b/Documentation/devicetree/bindings/clock/renesas,9series.yaml index af6319697b1c..a85f78ce2970 100644 --- a/Documentation/devicetree/bindings/clock/renesas,9series.yaml +++ b/Documentation/devicetree/bindings/clock/renesas,9series.yaml @...
5ec820fc28d0b8a0f3890d476b1976f20e8343cc
Analyze and fix the following issue in the Linux kernel code: clk: rs9: Reserve 8 struct clk_hw slots for for 9FGV0841
Problem Details: The 9FGV0841 has 8 outputs and registers 8 struct clk_hw, make sure there are 8 slots for those newly registered clk_hw pointers, else there is going to be out of bounds write when pointers 4..7 are set into struct rs9_driver_data .clk_dif[4..7] field. Since there are other structure members past this...
```diff diff --git a/drivers/clk/clk-renesas-pcie.c b/drivers/clk/clk-renesas-pcie.c index 4c3a5e4eb77a..f94a9c4d0b67 100644 --- a/drivers/clk/clk-renesas-pcie.c +++ b/drivers/clk/clk-renesas-pcie.c @@ -64,7 +64,7 @@ struct rs9_driver_data { struct i2c_client *client; struct regmap *regmap; const struct rs9_chip...
d8c128fb6c2277d95f3f6a4ce28b82c8370031f6
Analyze and fix the following issue in the Linux kernel code: pinctrl: canaan: k230: Fix NULL pointer dereference when parsing devicetree
Problem Details: When probing the k230 pinctrl driver, the kernel triggers a NULL pointer dereference. The crash trace showed: [ 0.732084] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000068 [ 0.740737] ... [ 0.776296] epc : k230_pinctrl_probe+0x1be/0x4fc In k230_pinctrl_parse...
```diff diff --git a/drivers/pinctrl/pinctrl-k230.c b/drivers/pinctrl/pinctrl-k230.c index d716f23d837f..20f7c0f70eb7 100644 --- a/drivers/pinctrl/pinctrl-k230.c +++ b/drivers/pinctrl/pinctrl-k230.c @@ -65,6 +65,7 @@ struct k230_pmx_func { }; struct k230_pinctrl { + struct device *dev; struct pinctrl_desc pctl; ...
353353309b0f7afa407df29e455f9d15b5acc296
Analyze and fix the following issue in the Linux kernel code: pinctrl: single: fix refcount leak in pcs_add_gpio_func()
Problem Details: of_parse_phandle_with_args() returns a device_node pointer with refcount incremented in gpiospec.np. The loop iterates through all phandles but never releases the reference, causing a refcount leak on each iteration. Add of_node_put() calls to release the reference after extracting the needed argument...
```diff diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 998f23d6c317..d85e6c1f6321 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1359,6 +1359,7 @@ static int pcs_add_gpio_func(struct device_node *node, struct pcs_device *pcs) } rang...
e56aa18eba32fb68ac5e19e44670010095bb189c
Analyze and fix the following issue in the Linux kernel code: pinctrl: meson: amlogic-a4: Fix device node reference leak in bank helpers
Problem Details: of_parse_phandle_with_fixed_args() increments the reference count of the returned device node, so it must be explicitly released using of_node_put() after use. Fix the reference leak in aml_bank_pins() and aml_bank_number() by adding the missing of_node_put() calls. Fixes: 6e9be3abb78c ("pinctrl: Add...
```diff diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c index ded7b218e2ec..40542edd557e 100644 --- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c +++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c @@ -725,8 +725,9 @@ static u32 aml_bank_pins(struct device_node *np) if...
eabf273c8466af3f033473c2d2267a6ea7946d57
Analyze and fix the following issue in the Linux kernel code: pinctrl: qcom: sm8250-lpass-lpi: Fix i2s2_data_groups definition
Problem Details: The i2s2_data function is available on both gpio12 and gpio13. Fix the groups definition. Fixes: 6e261d1090d6 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver") Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Konra...
```diff diff --git a/drivers/pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c index 64494a86490e..c27452eece3e 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c @@ -73,7 +73,7 @@ static const char * const i2s1_ws_g...
0a4614fe85ef130ab3769afdf9d174cc9e645dea
Analyze and fix the following issue in the Linux kernel code: dt-bindings: pinctrl: spacemit: fix drive-strength check warning
Problem Details: The problem is that one value from drive-strength may match to more than two different enum groups which lead to DT complaint, switch to use 'anyOf' to fix this kind warning. Fixes: c3efac0592f8 ("dt-bindings: pinctrl: spacemit: convert drive strength to schema format") Signed-off-by: Yixun Lan <dlan@...
```diff diff --git a/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml index ebcbaf4d85bb..3e734aeb01cc 100644 --- a/Documentation/devicetree/bindings/pinctrl/spacemit,k1-pinctrl.yaml +++ b/Documentation/devicetree/bindings/pinctrl/sp...
ea9975c221151b9541458b2038593f5863889ee9
Analyze and fix the following issue in the Linux kernel code: pinctrl: fix kismet issues with GENERIC_PINCTRL
Problem Details: lkp reported that GENERIC_PINCTRL can be select when its dependencies are not. Swap the "depends on" out for "select", as is used in other parts of the pinctrl core that are expected to be selected by drivers. Fixes: 43722575e5cd ("pinctrl: add generic functions + pins mapper") Reported-by: kernel tes...
```diff diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 6cc5e214f4f3..afecd9407f53 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -27,9 +27,9 @@ config GENERIC_PINCONF config GENERIC_PINCTRL bool - depends on GENERIC_PINCONF - depends on GENERIC_PINCTRL_GROUPS - depends ...
8a066a81ee0c1b6cdbd81393536c3b2d19ccef25
Analyze and fix the following issue in the Linux kernel code: ASoC: qcom: q6asm: drop DSP responses for closed data streams
Problem Details: 'Commit a354f030dbce ("ASoC: qcom: q6asm: handle the responses after closing")' attempted to ignore DSP responses arriving after a stream had been closed. However, those responses were still handled, causing lockups. Fix this by unconditionally dropping all DSP responses associated with closed data s...
```diff diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c index d76d29fa0099..1bb295407c60 100644 --- a/sound/soc/qcom/qdsp6/q6asm.c +++ b/sound/soc/qcom/qdsp6/q6asm.c @@ -636,7 +636,6 @@ static int32_t q6asm_stream_callback(struct apr_device *adev, client_event = ASM_CLIENT_EVENT_CMD_OUT_FLU...
943c4d0637cff358f7be8e71694475538e7b1ce3
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: Limit sleep while waiting for H2G credits
Problem Details: Instead of endlessly increasing the sleep timeout while waiting for the H2G credits, use exponential increase only up to the given limit, like it was initially done in the GuC submission code. While here, fix the actual timeout to the 1s as it was documented. Suggested-by: Matthew Brost <matthew.bros...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c index dfbf76037b04..d4111124cd5f 100644 --- a/drivers/gpu/drm/xe/xe_guc_ct.c +++ b/drivers/gpu/drm/xe/xe_guc_ct.c @@ -32,6 +32,7 @@ #include "xe_guc_tlb_inval.h" #include "xe_map.h" #include "xe_pm.h" +#include "xe_sleep.h" #includ...
9f9c117ac566cb567dd56cc5b7564c45653f7a2a
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix kerneldoc for xe_tlb_inval_job_alloc_dep
Problem Details: Correct the function name in the kerneldoc. It is for below warning: "Warning: drivers/gpu/drm/xe/xe_tlb_inval_job.c:210 expecting prototype for xe_tlb_inval_alloc_dep(). Prototype was for xe_tlb_inval_job_alloc_dep() instead" Fixes: 15366239e2130 ("drm/xe: Decouple TLB invalidations from GT") Reviewe...
```diff diff --git a/drivers/gpu/drm/xe/xe_tlb_inval_job.c b/drivers/gpu/drm/xe/xe_tlb_inval_job.c index 6a7bd6315797..01c413a2537e 100644 --- a/drivers/gpu/drm/xe/xe_tlb_inval_job.c +++ b/drivers/gpu/drm/xe/xe_tlb_inval_job.c @@ -198,7 +198,7 @@ static void xe_tlb_inval_job_destroy(struct kref *ref) } /** - * xe_t...
0651dbb9d6a72e99569576fbec4681fd8160d161
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix kerneldoc for xe_gt_tlb_inval_init_early
Problem Details: Correct the function name in the kerneldoc. It is for below warning: "Warning: drivers/gpu/drm/xe/xe_tlb_inval.c:136 expecting prototype for xe_gt_tlb_inval_init(). Prototype was for xe_gt_tlb_inval_init_early() instead" v2: add () for the function. (Michal) Fixes: db16f9d90c1d9 ("drm/xe: Split TLB i...
```diff diff --git a/drivers/gpu/drm/xe/xe_tlb_inval.c b/drivers/gpu/drm/xe/xe_tlb_inval.c index 989fe0e7f8ee..933f30fb617d 100644 --- a/drivers/gpu/drm/xe/xe_tlb_inval.c +++ b/drivers/gpu/drm/xe/xe_tlb_inval.c @@ -125,7 +125,7 @@ static void primelockdep(struct xe_tlb_inval *tlb_inval) } /** - * xe_gt_tlb_inval_in...
9fd8da717934f05125b9ba6782622c459a368dc0
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix kerneldoc for xe_migrate_exec_queue
Problem Details: Correct the function name in the kerneldoc. It is for below warning: "Warning: drivers/gpu/drm/xe/xe_migrate.c:1262 expecting prototype for xe_get_migrate_exec_queue(). Prototype was for xe_migrate_exec_queue() instead" Fixes: 916ee4704a865 ("drm/xe/vf: Register CCS read/write contexts with Guc") Revi...
```diff diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index 6e202428aac2..078a9bc2821d 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -1254,7 +1254,7 @@ void xe_migrate_ccs_rw_copy_clear(struct xe_bo *src_bo, } /** - * xe_get_migrate_exec_queue...
451c3a0356099483218535aed17fcf94ab5764a3
Analyze and fix the following issue in the Linux kernel code: rcu: Mark lockdep_assert_rcu_helper() __always_inline
Problem Details: There are some configurations in which lockdep_assert_rcu_helper() ends up not being inlined, for some reason. This leads to a link failure because now the caller tries to pass a nonexistant __ctx_lock_RCU structure: ld: lib/test_context-analysis.o: in function `test_rcu_assert_variants': test_context...
```diff diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index d828a4673441..f0aa48bb5d12 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -435,7 +435,7 @@ static inline void rcu_preempt_sleep_check(void) { } // See RCU_LOCKDEP_WARN() for an explanation of the double call to /...
a56a38fd9196fc89401e498d70b7aa9c9679fa6e
Analyze and fix the following issue in the Linux kernel code: uprobes: Fix incorrect lockdep condition in filter_chain()
Problem Details: The list_for_each_entry_rcu() in filter_chain() uses rcu_read_lock_trace_held() as the lockdep condition, but the function holds consumer_rwsem, not the RCU trace lock. This gives me the following output when running with some locking debug option enabled: kernel/events/uprobes.c:1141 RCU-list trav...
```diff diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index dfbce021fb02..424ef2235b07 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1138,7 +1138,7 @@ static bool filter_chain(struct uprobe *uprobe, struct mm_struct *mm) bool ret = false; down_read(&uprobe->consumer_rwsem...
171efc70097a9f5f207461bed03478a1b0a3dfa6
Analyze and fix the following issue in the Linux kernel code: x86/ibs: Fix typo in dc_l2tlb_miss comment
Problem Details: The comment for dc_l2tlb_miss incorrectly describes it as a "hit". This contradicts the field name and the actual bit definition. Fix the comment to correctly describe it as a "miss". Signed-off-by: Xiang-Bin Shi <eric91102091@gmail.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Li...
```diff diff --git a/arch/x86/include/asm/amd/ibs.h b/arch/x86/include/asm/amd/ibs.h index 3ee5903982c2..fcc8a5abe54e 100644 --- a/arch/x86/include/asm/amd/ibs.h +++ b/arch/x86/include/asm/amd/ibs.h @@ -110,7 +110,7 @@ union ibs_op_data3 { __u64 ld_op:1, /* 0: load op */ st_op:1, /* 1: store op */ dc_l1t...
7833570dae833028337bb53b7f389825b910c100
Analyze and fix the following issue in the Linux kernel code: jfs: avoid -Wtautological-constant-out-of-range-compare warning
Problem Details: A recent change for the range check started triggering a clang warning: fs/jfs/jfs_dtree.c:2906:31: error: result of comparison of constant 128 with expression of type 's8' (aka 'signed char') is always false [-Werror,-Wtautological-constant-out-of-range-compare] 2906 | if (st...
```diff diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c index 0ab83bb7bbdf..9ab3f2fc61d1 100644 --- a/fs/jfs/jfs_dtree.c +++ b/fs/jfs/jfs_dtree.c @@ -2903,7 +2903,7 @@ int jfs_readdir(struct file *file, struct dir_context *ctx) stbl = DT_GETSTBL(p); for (i = index; i < p->header.nextindex; i++) { - if (s...
75ce02f4bc9a8b8350b6b1b01872467b0cc960cc
Analyze and fix the following issue in the Linux kernel code: PM: wakeup: Handle empty list in wakeup_sources_walk_start()
Problem Details: In the case of an empty wakeup_sources list, wakeup_sources_walk_start() will return an invalid but non-NULL address. This also affects wrappers of the aforementioned function, like for_each_wakeup_source(). Update wakeup_sources_walk_start() to return NULL in case of an empty list. Fixes: b4941adb24...
```diff diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index 1e1a0e7eeac5..e69033d16fba 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -275,9 +275,7 @@ EXPORT_SYMBOL_GPL(wakeup_sources_read_unlock); */ struct wakeup_source *wakeup_sources_walk_start(void) { - s...
4544e9c4ec9a5955a37fdd8204a3d98106f97ab7
Analyze and fix the following issue in the Linux kernel code: selftests/sched_ext: Fix init_enable_count flakiness
Problem Details: The init_enable_count test is flaky. The test forks 1024 children before attaching the scheduler to verify that existing tasks get ops.init_task() called. The children were using sleep(1) before exiting. 7900aa699c34 ("sched_ext: Fix cgroup exit ordering by moving sched_ext_free() to finish_task_switc...
```diff diff --git a/tools/testing/selftests/sched_ext/init_enable_count.c b/tools/testing/selftests/sched_ext/init_enable_count.c index eddf9e0e26e7..82c71653977b 100644 --- a/tools/testing/selftests/sched_ext/init_enable_count.c +++ b/tools/testing/selftests/sched_ext/init_enable_count.c @@ -4,6 +4,7 @@ * Copyright...
5248d8474e594d156bee1ed10339cc16e207a28b
Analyze and fix the following issue in the Linux kernel code: pNFS: fix a missing wake up while waiting on NFS_LAYOUT_DRAIN
Problem Details: It is possible to have a task get stuck on waiting on the NFS_LAYOUT_DRAIN in the following scenario 1. cpu a: waiter test NFS_LAYOUT_DRAIN (1) and plh_outstanding (1) 2. cpu b: atomic_dec_and_test() -> clear bit -> wake up 3. cpu c: sets NFS_LAYOUT_DRAIN again 4. cpu a: calls wait_on_bit() sleeps for...
```diff diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index cff225721d1c..ff8483d3373a 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -463,7 +463,8 @@ pnfs_mark_layout_stateid_invalid(struct pnfs_layout_hdr *lo, }; struct pnfs_layout_segment *lseg, *next; - set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags); + if (...
c2a6859138e7f73ad904be17dd7d1da6cc7f06b3
Analyze and fix the following issue in the Linux kernel code: drm/xe/query: Fix topology query pointer advance
Problem Details: The topology query helper advanced the user pointer by the size of the pointer, not the size of the structure. This can misalign the output blob and corrupt the following mask. Fix the increment to use sizeof(*topo). There is no issue currently, as sizeof(*topo) happens to be equal to sizeof(topo) on 6...
```diff diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c index b7b4261968e0..34db266b723f 100644 --- a/drivers/gpu/drm/xe/xe_query.c +++ b/drivers/gpu/drm/xe/xe_query.c @@ -487,7 +487,7 @@ static int copy_mask(void __user **ptr, if (copy_to_user(*ptr, topo, sizeof(*topo))) return -EFAUL...
568d9d0d83f5b55144c4486fefe26bd132a66ea1
Analyze and fix the following issue in the Linux kernel code: drm/xe: use entry_dump callbacks for xe2+ PAT dumps
Problem Details: Move xe2+ PAT entry printing into the entry_dump op so platform specific logic stays localized, simplifying future maintenance. v2: - Do not null xe->pat.ops for VFs. - Skip PAT init and dump on VFs (-EOPNOTSUPP), avoiding NULL ops use. v3: - fixed typo v4: (Matt) - Switch xe2_dump() to use the ...
```diff diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c index 14d0dce5190a..2cd3fd1c3953 100644 --- a/drivers/gpu/drm/xe/xe_pat.c +++ b/drivers/gpu/drm/xe/xe_pat.c @@ -88,6 +88,7 @@ struct xe_pat_ops { void (*program_media)(struct xe_gt *gt, const struct xe_pat_table_entry table[], in...
f89dbe14a0c8854b7aaf960dd842c10698b3ff19
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: Fix kernel-doc warning in GuC scheduler ABI header
Problem Details: The GuC scheduler ABI header contains a file-level comment that is not intended to document a kernel-doc symbol. Using kernel-doc comment syntax (/** */) triggers kernel-doc warnings. With "-Werror", this causes the build to fail. Convert the comment to a regular block comment. HDRTEST drivers/gpu/dr...
```diff diff --git a/drivers/gpu/drm/xe/abi/guc_scheduler_abi.h b/drivers/gpu/drm/xe/abi/guc_scheduler_abi.h index 513b22a87428..19ec89bf39c5 100644 --- a/drivers/gpu/drm/xe/abi/guc_scheduler_abi.h +++ b/drivers/gpu/drm/xe/abi/guc_scheduler_abi.h @@ -8,7 +8,7 @@ #include <linux/types.h> -/** +/* * Generic define...
dd8ea2f2ab71b98887fdc426b0651dbb1d1ea760
Analyze and fix the following issue in the Linux kernel code: drm/xe/guc: Fix CFI violation in debugfs access.
Problem Details: xe_guc_print_info is void-returning, but the function pointer it is assigned to expects an int-returning function, leading to the following CFI error: [ 206.873690] CFI failure at guc_debugfs_show+0xa1/0xf0 [xe] (target: xe_guc_print_info+0x0/0x370 [xe]; expected type: 0xbe3bc66a) Fix this by updati...
```diff diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c index 2efc4678fa73..c0eeaf08479d 100644 --- a/drivers/gpu/drm/xe/xe_guc.c +++ b/drivers/gpu/drm/xe/xe_guc.c @@ -1672,7 +1672,7 @@ void xe_guc_runtime_resume(struct xe_guc *guc) xe_guc_submit_unpause(guc); } -void xe_guc_print_info(struc...
52fb36a5f9c15285b7d67c0ff87dc17b3206b5df
Analyze and fix the following issue in the Linux kernel code: hwmon: (gpio-fan) Allow to stop FANs when CONFIG_PM is disabled
Problem Details: When CONFIG_PM is disabled, the GPIO controlled FANs can't be stopped by using the sysfs attributes since commit 0d01110e6356 ("hwmon: (gpio-fan) Add regulator support"). Using either the 'pwm1' or the 'fan1_target' attribute fails the same way: $ echo 0 > /sys/class/hwmon/hwmon1/pwm1 ash: write ...
```diff diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index d7fa021f376e..a8892ced1e54 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c @@ -148,7 +148,7 @@ static int set_fan_speed(struct gpio_fan_data *fan_data, int speed_index) int ret; ret = pm_runtime_put_sync(fan_data...
f5c092787c48296633c2dd7240752f88fa9710fc
Analyze and fix the following issue in the Linux kernel code: hwmon: (gpio-fan) Fix set_rpm() return value
Problem Details: The set_rpm function is used as a 'store' callback of a device attribute, and as such it should return with the number of bytes consumed. However since commit 0d01110e6356 ("hwmon: (gpio-fan) Add regulator support"), the function returns with zero on success. Due to this, the function gets called agai...
```diff diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index 516c34bb61c9..d7fa021f376e 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c @@ -291,7 +291,7 @@ static ssize_t set_rpm(struct device *dev, struct device_attribute *attr, { struct gpio_fan_data *fan_data = dev_get_drvda...
98f51c466aebdb5afa7cb7d54aa7eb9f04b468ee
Analyze and fix the following issue in the Linux kernel code: docs: kdoc: Fix pdfdocs build for tools
Problem Details: the "\1" inside a docstring requires proper scaping to not be considered a hex character and break the build. Reported-by: Akira Yokosawa <akiyks@gmail.com> Closes: https://lore.kernel.org/linux-doc/63e99049-cc72-4156-83af-414fdde34312@gmail.com/ Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@ke...
```diff diff --git a/tools/lib/python/kdoc/kdoc_re.py b/tools/lib/python/kdoc/kdoc_re.py index 2816bd9f90f8..0bf9e01cdc57 100644 --- a/tools/lib/python/kdoc/kdoc_re.py +++ b/tools/lib/python/kdoc/kdoc_re.py @@ -228,14 +228,18 @@ class NestedMatch: yield line[t[0]:t[2]] def sub(self, regex, sub, line...
0ad9a71933e73c8a2af101d28e9a1dc35bae02d5
Analyze and fix the following issue in the Linux kernel code: modsign: Enable ML-DSA module signing
Problem Details: Allow ML-DSA module signing to be enabled. Note that OpenSSL's CMS_*() function suite does not, as of OpenSSL-3.6, support the use of CMS_NOATTR with ML-DSA, so the prohibition against using signedAttrs with module signing has to be removed. The selected digest then applies only to the algorithm used...
```diff diff --git a/Documentation/admin-guide/module-signing.rst b/Documentation/admin-guide/module-signing.rst index a8667a777490..7f2f127dc76f 100644 --- a/Documentation/admin-guide/module-signing.rst +++ b/Documentation/admin-guide/module-signing.rst @@ -28,10 +28,12 @@ trusted userspace bits. This facility uses...
78a00cac1e962aacfe67ffa0ce295e709e0e6c5b
Analyze and fix the following issue in the Linux kernel code: docs: fix 're-use' -> 'reuse' in documentation
Problem Details: Signed-off-by: Rhys Tumelty <rhys@tumelty.co.uk> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260128220233.179439-1-rhys@tumelty.co.uk>
```diff diff --git a/Documentation/ABI/testing/pstore b/Documentation/ABI/testing/pstore index d3cff4a7ee10..dfe2d9801c3a 100644 --- a/Documentation/ABI/testing/pstore +++ b/Documentation/ABI/testing/pstore @@ -26,7 +26,7 @@ Description: Generic interface to platform dependent persistent storage. Once the informat...
1482f61ccd984440529d0d37002bc66378be88bb
Analyze and fix the following issue in the Linux kernel code: docs: ioctl-number: fix a typo in ioctl-number.rst
Problem Details: "userspace" was misspelled as "userpace". Signed-off-by: Gabriel Whigham <gabewhigham@gmail.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260130042131.51975-1-gabewhigham@gmail.com>
```diff diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst b/Documentation/userspace-api/ioctl/ioctl-number.rst index 7232b3544cec..b5c6447455fd 100644 --- a/Documentation/userspace-api/ioctl/ioctl-number.rst +++ b/Documentation/userspace-api/ioctl/ioctl-number.rst @@ -15,7 +15,7 @@ macros defined in <linu...
67b3da8d3051fba7e1523b3afce4f71c658f15f8
Analyze and fix the following issue in the Linux kernel code: smb/client: fix memory leak in SendReceive()
Problem Details: Reproducer: 1. server: supports SMB1, directories are exported read-only 2. client: mount -t cifs -o vers=1.0 //${server_ip}/export /mnt 3. client: dd if=/dev/zero of=/mnt/file bs=512 count=1000 oflag=direct 4. client: umount /mnt 5. client: sleep 1 6. client: modprobe -r cifs The error m...
```diff diff --git a/fs/smb/client/cifstransport.c b/fs/smb/client/cifstransport.c index 28d1cee90625..98287132626e 100644 --- a/fs/smb/client/cifstransport.c +++ b/fs/smb/client/cifstransport.c @@ -251,13 +251,15 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses, rc = cifs_send_recv(xid, ses, ses->server, ...
e3a43633023e3cacaca60d4b8972d084a2b06236
Analyze and fix the following issue in the Linux kernel code: smb/client: fix memory leak in smb2_open_file()
Problem Details: Reproducer: 1. server: directories are exported read-only 2. client: mount -t cifs //${server_ip}/export /mnt 3. client: dd if=/dev/zero of=/mnt/file bs=512 count=1000 oflag=direct 4. client: umount /mnt 5. client: sleep 1 6. client: modprobe -r cifs The error message is as follows: ==...
```diff diff --git a/fs/smb/client/smb2file.c b/fs/smb/client/smb2file.c index 7f11ae6bb785..2dd08388ea87 100644 --- a/fs/smb/client/smb2file.c +++ b/fs/smb/client/smb2file.c @@ -178,6 +178,7 @@ int smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, rc = SMB2_open(xid, oparms, smb2_path, &smb2_opl...
b84bb7bd913d8ca2f976ee6faf4a174f91c02b8d
Analyze and fix the following issue in the Linux kernel code: nvme: fix admin queue leak on controller reset
Problem Details: When nvme_alloc_admin_tag_set() is called during a controller reset, a previous admin queue may still exist. Release it properly before allocating a new one to avoid orphaning the old queue. This fixes a regression introduced by commit 03b3bcd319b3 ("nvme: fix admin request_queue lifetime"). Cc: Keit...
```diff diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 83efc88ac0f9..c12986495e71 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4860,6 +4860,13 @@ int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, if (ret) return ret; + /* + * If ...
99a2ef500906138ba58093b9893972a5c303c734
Analyze and fix the following issue in the Linux kernel code: cgroup/dmem: avoid pool UAF
Problem Details: An UAF issue was observed: BUG: KASAN: slab-use-after-free in page_counter_uncharge+0x65/0x150 Write of size 8 at addr ffff888106715440 by task insmod/527 CPU: 4 UID: 0 PID: 527 Comm: insmod 6.19.0-rc7-next-20260129+ #11 Tainted: [O]=OOT_MODULE Call Trace: <TASK> dump_stack_lvl+0x82/0xd0 kasan_rep...
```diff diff --git a/kernel/cgroup/dmem.c b/kernel/cgroup/dmem.c index 787b334e0f5d..1ea6afffa985 100644 --- a/kernel/cgroup/dmem.c +++ b/kernel/cgroup/dmem.c @@ -14,6 +14,7 @@ #include <linux/mutex.h> #include <linux/page_counter.h> #include <linux/parser.h> +#include <linux/refcount.h> #include <linux/rculist.h> ...
592a68212c5664bcaa88f24ed80bf791282790fe
Analyze and fix the following issue in the Linux kernel code: cgroup/dmem: avoid rcu warning when unregister region
Problem Details: A warnning was detected: WARNING: suspicious RCU usage 6.19.0-rc7-next-20260129+ #1101 Tainted: G O kernel/cgroup/dmem.c:456 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 1 lock held by insmod/532: #0: ...
```diff diff --git a/kernel/cgroup/dmem.c b/kernel/cgroup/dmem.c index 1f0d6caaf2fb..787b334e0f5d 100644 --- a/kernel/cgroup/dmem.c +++ b/kernel/cgroup/dmem.c @@ -423,7 +423,7 @@ static void dmemcg_free_region(struct kref *ref) */ void dmem_cgroup_unregister_region(struct dmem_cgroup_region *region) { - struct list...
43151f812886be1855d2cba059f9c93e4729460b
Analyze and fix the following issue in the Linux kernel code: cgroup/dmem: fix NULL pointer dereference when setting max
Problem Details: An issue was triggered: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: Oops: 0000 [#1] SMP NOPTI CPU: 15 UID: 0 PID: 658 Comm: bash Tainted: 6.19.0-rc6-next-2026012 Tainted: ...
```diff diff --git a/kernel/cgroup/dmem.c b/kernel/cgroup/dmem.c index e12b946278b6..1f0d6caaf2fb 100644 --- a/kernel/cgroup/dmem.c +++ b/kernel/cgroup/dmem.c @@ -700,6 +700,9 @@ static ssize_t dmemcg_limit_write(struct kernfs_open_file *of, if (!region_name[0]) continue; + if (!options || !*options) + retu...
6b95cc562de2889a9333843dda073ba875f9e808
Analyze and fix the following issue in the Linux kernel code: ftrace: Fix direct_functions leak in update_ftrace_direct_del
Problem Details: Alexei reported memory leak in update_ftrace_direct_del. We miss cleanup of the replaced direct_functions in the success path in update_ftrace_direct_del, adding that. Fixes: 8d2c1233f371 ("ftrace: Add update_ftrace_direct_del function") Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com> C...
```diff diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 8574932e66b6..b12dbd93ae1c 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -6537,6 +6537,7 @@ int update_ftrace_direct_del(struct ftrace_ops *ops, struct ftrace_hash *hash) /* free the new_direct_functions */ old_direct_fun...
2e06d54ea9a25e2925a31eb5410af0f16baa8f19
Analyze and fix the following issue in the Linux kernel code: tools/sched_ext: Fix data header access during free in scx_sdt
Problem Details: Fix a pointer arithmetic error in scx_sdt during freeing that causes the allocator to use the wrong memory address for the allocation's data header. Fixes: 36929ebd17ae ("tools/sched_ext: add arena based scheduler") Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com> Acked-by: Andrea Righi <arighi@n...
```diff diff --git a/tools/sched_ext/scx_sdt.bpf.c b/tools/sched_ext/scx_sdt.bpf.c index d965f7d209de..31b09958e8d5 100644 --- a/tools/sched_ext/scx_sdt.bpf.c +++ b/tools/sched_ext/scx_sdt.bpf.c @@ -312,7 +312,7 @@ int scx_alloc_free_idx(struct scx_allocator *alloc, __u64 idx) pos = idx & mask; data = chunk->data[p...
41d9a6795b95d6ea28439ac1e9ce8c95bbca20fc
Analyze and fix the following issue in the Linux kernel code: spi: tegra: Fix a memory leak in tegra_slink_probe()
Problem Details: In tegra_slink_probe(), when platform_get_irq() fails, it directly returns from the function with an error code, which causes a memory leak. Replace it with a goto label to ensure proper cleanup. Fixes: eb9913b511f1 ("spi: tegra: Fix missing IRQ check in tegra_slink_probe()") Signed-off-by: Felix Gu ...
```diff diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index fe452d03c1ee..709669610840 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c @@ -1086,8 +1086,10 @@ static int tegra_slink_probe(struct platform_device *pdev) reset_control_deassert(tspi->rst)...
0c4762e26879acc101790269382f230f22fd6905
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: nv: Avoid NV stage-2 code when NV is not supported
Problem Details: The NV stage-2 manipulation functions kvm_nested_s2_unmap(), kvm_nested_s2_wp(), and others, are being called for any stage-2 manipulation regardless of whether nested virtualization is supported or enabled for the VM. For protected KVM (pKVM), `struct kvm_pgtable` uses the `pkvm_mappings` member of t...
```diff diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c index cdeeb8f09e72..d03e9b71bf6c 100644 --- a/arch/arm64/kvm/nested.c +++ b/arch/arm64/kvm/nested.c @@ -1101,6 +1101,9 @@ void kvm_nested_s2_wp(struct kvm *kvm) lockdep_assert_held_write(&kvm->mmu_lock); + if (!kvm->arch.nested_mmus_size) + r...
bb0c99e08ab9aa6d04b40cb63c72db9950d51749
Analyze and fix the following issue in the Linux kernel code: arm64: Fix non-atomic __READ_ONCE() with CONFIG_LTO=y
Problem Details: The implementation of __READ_ONCE() under CONFIG_LTO=y incorrectly qualified the fallback "once" access for types larger than 8 bytes, which are not atomic but should still happen "once" and suppress common compiler optimizations. The cast `volatile typeof(__x)` applied the volatile qualifier to the p...
```diff diff --git a/arch/arm64/include/asm/rwonce.h b/arch/arm64/include/asm/rwonce.h index 78beceec10cd..fc0fb42b0b64 100644 --- a/arch/arm64/include/asm/rwonce.h +++ b/arch/arm64/include/asm/rwonce.h @@ -58,7 +58,7 @@ default: \ atomic = 0; \ } \ - atomic ? (typeof(*__x))__u.__val : (*(volat...
2c3a0b730012ef87aaaf35243e1fbe9880666f7c
Analyze and fix the following issue in the Linux kernel code: dlm: Avoid -Wflex-array-member-not-at-end warning
Problem Details: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Move the conflicting declaration to the end of the corresponding structure. Notice that `struct dlm_message` is a flexible structure, this is a structure that contains a flexible-array member. Fi...
```diff diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index d534a4bc162b..9df842421ae0 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h @@ -606,7 +606,6 @@ struct dlm_ls { struct dlm_rsb ls_local_rsb; /* for returning errors */ struct dlm_lkb ls_local_lkb; /* for returning errors */ -...
af07330e28ad65352126270b0b3af226df46e307
Analyze and fix the following issue in the Linux kernel code: io_uring/zcrx: fix rq flush locking
Problem Details: zcrx needs to keep the rq lock for uref manipulations, for now move all zcrx_return_buffers() under the lock. Fixes: 475eb39b00478 ("io_uring/zcrx: add sync refill queue flushing") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
```diff diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index f18c173a7bcb..3d398283cf34 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -1069,8 +1069,6 @@ static unsigned zcrx_parse_rq(netmem_ref *netmem_array, unsigned nr, unsigned int mask = zcrx->rq_entries - 1; unsigned int i; - guard(spinlock_bh)(&zcrx...
0ae91d8ab70922fb74c22c20bedcb69459579b1c
Analyze and fix the following issue in the Linux kernel code: io_uring/zcrx: fix page array leak
Problem Details: d9f595b9a65e ("io_uring/zcrx: fix leaking pages on sg init fail") fixed a page leakage but didn't free the page array, release it as well. Fixes: b84621d96ee02 ("io_uring/zcrx: allocate sgtable for umem areas") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@ker...
```diff diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index b99cf2c6670a..f18c173a7bcb 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -197,6 +197,7 @@ static int io_import_umem(struct io_zcrx_ifq *ifq, GFP_KERNEL_ACCOUNT); if (ret) { unpin_user_pages(pages, nr_pages); + kvfree(pages); return ret;...
65d466b6298470ce21ab21ebfdb51309d515737d
Analyze and fix the following issue in the Linux kernel code: blk-mq-debugfs: warn about possible deadlock
Problem Details: Creating new debugfs entries can trigger fs reclaim, hence we can't do this with queue frozen, meanwhile, other locks that can be held while queue is frozen should not be held as well. Signed-off-by: Yu Kuai <yukuai@fnnas.com> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Reviewed-by: Ming Lei <ming...
```diff diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 5c7cadf51a88..faeaa1fc86a7 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -608,9 +608,23 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = { {}, }; -static void debugfs_create_files(struct dentry *...
3c17a346ffc613615f48c6f1ed30cdf328bab805
Analyze and fix the following issue in the Linux kernel code: blk-rq-qos: fix possible debugfs_mutex deadlock
Problem Details: Currently rq-qos debugfs entries are created from rq_qos_add(), while rq_qos_add() can be called while queue is still frozen. This can deadlock because creating new entries can trigger fs reclaim. Fix this problem by delaying creating rq-qos debugfs entries after queue is unfrozen. - For wbt, 1) it c...
```diff diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c index 654478dfbc20..d7ce99ce2e80 100644 --- a/block/blk-rq-qos.c +++ b/block/blk-rq-qos.c @@ -347,13 +347,6 @@ int rq_qos_add(struct rq_qos *rqos, struct gendisk *disk, enum rq_qos_id id, blk_queue_flag_set(QUEUE_FLAG_QOS_ENABLED, q); blk_mq_unfreeze_qu...
3f0bea9f3b9e7d9bdc3794103575168ef007d309
Analyze and fix the following issue in the Linux kernel code: blk-mq-debugfs: factor out a helper to register debugfs for all rq_qos
Problem Details: There is already a helper blk_mq_debugfs_register_rqos() to register one rqos, however this helper is called synchronously when the rqos is created with queue frozen. Prepare to fix possible deadlock to create blk-mq debugfs entries while queue is still frozen. Reviewed-by: Ming Lei <ming.lei@redhat....
```diff diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 4896525b1c05..4fe164b6d648 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -631,14 +631,7 @@ void blk_mq_debugfs_register(struct request_queue *q) blk_mq_debugfs_register_hctx(q, hctx); } - if (q->rq_qos) { - struct ...
41afaeeda5099d9cd07eaa7dc6c3d20c6f1dd9e9
Analyze and fix the following issue in the Linux kernel code: blk-wbt: fix possible deadlock to nest pcpu_alloc_mutex under q_usage_counter
Problem Details: If wbt is disabled by default and user configures wbt by sysfs, queue will be frozen first and then pcpu_alloc_mutex will be held in blk_stat_alloc_callback(). Fix this problem by allocating memory first before queue frozen. Signed-off-by: Yu Kuai <yukuai@fnnas.com> Reviewed-by: Nilay Shroff <nilay@l...
```diff diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 0a37d97bda75..665760274e60 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -93,7 +93,7 @@ struct rq_wb { struct rq_depth rq_depth; }; -static int wbt_init(struct gendisk *disk); +static int wbt_init(struct gendisk *disk, struct rq_wb *rwb); stat...
2751b90051a0211ed7c78f26eb2a9b7038804b9b
Analyze and fix the following issue in the Linux kernel code: blk-wbt: factor out a helper wbt_set_lat()
Problem Details: To move implementation details inside blk-wbt.c, prepare to fix possible deadlock to call wbt_init() while queue is frozen in the next patch. Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> Signed-off-by: Yu Kuai <yukuai@fnnas.com> Reviewed-by: Hannes Reinec...
```diff diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index e0a70d26972b..a580688c3ad5 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -636,11 +636,8 @@ out: static ssize_t queue_wb_lat_store(struct gendisk *disk, const char *page, size_t count) { - struct request_queue *q = disk->queue; - struc...
e4aa247d94a04574297a8bc9fabbede0dcba1ab6
Analyze and fix the following issue in the Linux kernel code: HID: Intel-thc-hid: Intel-thc: Fix wrong register fields updating
Problem Details: Clear the target bit fields in register before setting new values. This ensures proper field updates by removing any existing bits that might interfere with the new configuration. Fixes: 22da60f0304b ("HID: Intel-thc-hid: Intel-thc: Introduce interrupt delay control") Fixes: 45e92a093099 ("HID: Intel-...
```diff diff --git a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c index 7e220a4c5ded..d8e195189e4b 100644 --- a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c +++ b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c @@ -1597,6 +1597,7 @@ int thc_i2c_set...
56f7db581ee73af53cd512e00a6261a025bf1d58
Analyze and fix the following issue in the Linux kernel code: HID: intel-ish-hid: fix NULL-ptr-deref in ishtp_bus_remove_all_clients
Problem Details: During a warm reset flow, the cl->device pointer may be NULL if the reset occurs while clients are still being enumerated. Accessing cl->device->reference_count without a NULL check leads to a kernel panic. This issue was identified during multi-unit warm reboot stress clycles. Add a defensive NULL ch...
```diff diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c index c3915f3a060e..b890fbf97a75 100644 --- a/drivers/hid/intel-ish-hid/ishtp/bus.c +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c @@ -730,7 +730,7 @@ void ishtp_bus_remove_all_clients(struct ishtp_device *ishtp_dev, spin_...
4c6b74d58766ce7cd66ae8e14babf877039adef6
Analyze and fix the following issue in the Linux kernel code: ASoC: es8328: Fix DAC deemphasis control handling
Problem Details: The DAC deemphasis control updated the hardware before updating the cached state, causing the previous setting to be applied. Update the cached deemphasis state first and then apply the setting. Also check and propagate errors from es8328_set_deemph() in hw_params(). Signed-off-by: Hsieh Hung-En <hu...
```diff diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c index 38340f292282..46868b7924a0 100644 --- a/sound/soc/codecs/es8328.c +++ b/sound/soc/codecs/es8328.c @@ -163,12 +163,11 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol, if (es8328->deemph == deemph) return 0; + es8328->de...
9058798652c8bc0584ed1fb0766a1015046c06e8
Analyze and fix the following issue in the Linux kernel code: apparmor: fix aa_label to return state from compount and component match
Problem Details: aa-label_match is not correctly returning the state in all cases. The only reason this didn't cause a error is that all callers currently ignore the return value. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202602020631.wXgZosyU-lkp@intel.com/ Fixes: a4...
```diff diff --git a/security/apparmor/label.c b/security/apparmor/label.c index 0852fa95081e..03a92a52acf9 100644 --- a/security/apparmor/label.c +++ b/security/apparmor/label.c @@ -1334,7 +1334,7 @@ fail: * @request: permissions to request * @perms: an initialized perms struct to add accumulation to * - * Retur...
102ada7ca37ed8358bd70c6f8e6475ebacf6f76d
Analyze and fix the following issue in the Linux kernel code: apparmor: fix fmt string type error in process_strs_entry
Problem Details: pointer subtraction has a type of int when using clang on hexagon, microblaze (and possibly other archs). We know the subtraction is postive so cast the expression to unsigned long to match what is in the fmt string. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbu...
```diff diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index f86133f36f33..175445c09896 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -474,7 +474,7 @@ static int process_strs_entry(char *str, int size, bool multi) if (!*str) { AA_D...
742048f2e128c06d0ef89ffc334519cb8e991f66
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl_sai: add IMX_SCMI_MISC_DRV dependency
Problem Details: The sai driver now links against the SCMI code directly, causing a link failure when that is in a loadable module: aarch64-linux-ld: sound/soc/fsl/fsl_sai.o: in function `fsl_sai_probe': fsl_sai.c:(.text+0x1fe4): undefined reference to `scmi_imx_misc_ctrl_set' Move the dependency from SND_SOC_FSL_MQS...
```diff diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index c4a00b22bc2a..828524c90f17 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -19,6 +19,7 @@ config SND_SOC_FSL_ASRC config SND_SOC_FSL_SAI tristate "Synchronous Audio Interface (SAI) module support" + depends on IMX_SCMI_MISC_...
cad9720dd7e4dcdaec8e854fb2c1d1d45fd6dbad
Analyze and fix the following issue in the Linux kernel code: ASoC: sophgo: fix 64-bit division build failure
Problem Details: cv1800b_adc_setbclk_div() does four 64-bit divisions in a row, which is rather inefficient on 32-bit systems, and using the plain division causes a build failure as a result: ERROR: modpost: "__aeabi_uldivmod" [sound/soc/sophgo/cv1800b-sound-adc.ko] undefined! Consolidate those into a single division...
```diff diff --git a/sound/soc/sophgo/cv1800b-sound-adc.c b/sound/soc/sophgo/cv1800b-sound-adc.c index 794030b713e9..b66761156b99 100644 --- a/sound/soc/sophgo/cv1800b-sound-adc.c +++ b/sound/soc/sophgo/cv1800b-sound-adc.c @@ -105,11 +105,8 @@ static int cv1800b_adc_setbclk_div(struct cv1800b_priv *priv, unsigned int r...
1db63f6af17945aed7497ce34a5648add0c1b6d9
Analyze and fix the following issue in the Linux kernel code: ASoC: rt5575: fix SPI dependency
Problem Details: The rt5575 driver fails to link when SPI support is in a loadable module but the codec is built-in: x86_64-linux-ld: vmlinux.o: in function `rt5575_i2c_probe': rt5575.c:(.text+0x9792ce): undefined reference to `rt5575_spi_get_device' rt5575.c:(.text+0x979332): undefined reference to `rt5575_spi_fw_loa...
```diff diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index f34d7b510c91..e78ac302da15 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -1801,9 +1801,10 @@ config SND_SOC_RT5575 depends on I2C config SND_SOC_RT5575_SPI - tristate "Realtek ALC5575 Codec - SPI" + bool "Realt...
10db9f6899dd3a2dfd26efd40afd308891dc44a8
Analyze and fix the following issue in the Linux kernel code: firmware: cs_dsp: rate-limit log messages in KUnit builds
Problem Details: Use the dev_*_ratelimit() macros if the cs_dsp KUnit tests are enabled in the build, and allow the KUnit tests to disable message output. Some of the KUnit tests cause a very large number of log messages from cs_dsp, because the tests perform many different test cases. This could cause some lines to b...
```diff diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c index 525ac0f0a75d..73d201e7d992 100644 --- a/drivers/firmware/cirrus/cs_dsp.c +++ b/drivers/firmware/cirrus/cs_dsp.c @@ -9,6 +9,7 @@ * Cirrus Logic International Semiconductor Ltd. */ +#include <kunit...
611c7d2262d5645118e0b3a9a88475d35a8366f2
Analyze and fix the following issue in the Linux kernel code: ASoC: amd: yc: Add quirk for HP 200 G2a 16
Problem Details: Fix the missing mic on HP 200 G2a 16 by adding quirk with the board ID 8EE4 Signed-off-by: Dirk Su <dirk.su@canonical.com> Link: https://patch.msgid.link/20260129065038.39349-1-dirk.su@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
```diff diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c index c18da0915baa..67f2fee19398 100644 --- a/sound/soc/amd/yc/acp6x-mach.c +++ b/sound/soc/amd/yc/acp6x-mach.c @@ -640,6 +640,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_BOARD_NAME, "8BD6"), } ...
3734b9463bd4fb5ac350842db55e2e0ccbf1b7a5
Analyze and fix the following issue in the Linux kernel code: apparmor: fix kernel-doc comments for inview
Problem Details: subns was renamed inview to better reflect the function of the flag. Unfortunately the kernel-doc was not properly updated in 2 places. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202602020737.vGCZFds1-lkp@intel.com/ Closes: https://lore.kernel.org/oe-k...
```diff diff --git a/security/apparmor/label.c b/security/apparmor/label.c index ef3448ecdf5f..0852fa95081e 100644 --- a/security/apparmor/label.c +++ b/security/apparmor/label.c @@ -1330,7 +1330,7 @@ fail: * @rules: ruleset to search * @label: label to check access permissions for * @start: state to start match ...
3e28a67a85f9b569066f6dfcddadb39294c0c9d4
Analyze and fix the following issue in the Linux kernel code: drm/i915/display: fix the pixel normalization handling for xe3p_lpd
Problem Details: Pixel normalizer is enabled with normalization factor as 1.0 for FP16 formats in order to support FBC for those formats in xe3p_lpd. Previously pixel normalizer gets disabled during the plane disable routine. But there could be plane format settings without explicitly calling the plane disable in-betwe...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h index 6c74d6b0cc48..13f2a629981f 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -193,6 +193,7 @@ struct intel_disp...
24989330fb99189cf9ec4accef6ac81c7b1c31f7
Analyze and fix the following issue in the Linux kernel code: time/kunit: Document handling of negative years of is_leap()
Problem Details: The code local is_leap() helper was tried to be replaced by the RTC is_leap_year() function. Unfortunately the two aren't exactly equivalent, as the kunit variant uses a signed value for the year and the RTC an unsigned one. Since the KUnit tests cover a 16000 year range around the epoch they use year...
```diff diff --git a/kernel/time/time_test.c b/kernel/time/time_test.c index 2889763165e5..1b99180da288 100644 --- a/kernel/time/time_test.c +++ b/kernel/time/time_test.c @@ -4,7 +4,9 @@ #include <linux/time.h> /* - * Traditional implementation of leap year evaluation. + * Traditional implementation of leap year ev...
df9ac55abd18628bd8cff687ea043660532a3654
Analyze and fix the following issue in the Linux kernel code: apparmor: fix invalid deref of rawdata when export_binary is unset
Problem Details: If the export_binary parameter is disabled on runtime, profiles that were loaded before that will still have their rawdata stored in apparmorfs, with a symbolic link to the rawdata on the policy directory. When one of those profiles are replaced, the rawdata is set to NULL, but when trying to resolve t...
```diff diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 9b4f833e36cd..5a848c1be056 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -1648,6 +1648,15 @@ static const char *rawdata_get_link_base(struct dentry *dentry, label = aa_get_label_rcu(&prox...
fb21cb08566ebed91d5c876db5c013cc8af83b89
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Use standard seq_file iterator for vgic-debug debugfs
Problem Details: The current implementation uses `vgic_state_iter` in `struct vgic_dist` to track the sequence position. This effectively makes the iterator shared across all open file descriptors for the VM. This approach has significant drawbacks: - It enforces mutual exclusion, preventing concurrent reads of the ...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c index ec3d0c1fe703..2c6776a1779b 100644 --- a/arch/arm64/kvm/vgic/vgic-debug.c +++ b/arch/arm64/kvm/vgic/vgic-debug.c @@ -104,58 +104,42 @@ static void *vgic_debug_start(struct seq_file *s, loff_t *pos) struct kvm *kvm = s->priva...
5ab24969705a9adadbc1d3cff4c1c15df174eafb
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Reimplement vgic-debug XArray iteration
Problem Details: The vgic-debug interface implementation uses XArray marks (`LPI_XA_MARK_DEBUG_ITER`) to "snapshot" LPIs at the start of iteration. This modifies global state for a read-only operation and complicates reference counting, leading to leaks if iteration is aborted or fails. Reimplement the iterator to use...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c index bb92853d1fd3..ec3d0c1fe703 100644 --- a/arch/arm64/kvm/vgic/vgic-debug.c +++ b/arch/arm64/kvm/vgic/vgic-debug.c @@ -25,11 +25,9 @@ struct vgic_state_iter { int nr_cpus; int nr_spis; - int nr_lpis; int dist_id; int vc...
dcd79ed450934421158d81600f1be4c2e2af20bf
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Use standard seq_file iterator for idregs debugfs
Problem Details: The current implementation uses `idreg_debugfs_iter` in `struct kvm_arch` to track the sequence position. This effectively makes the iterator shared across all open file descriptors for the VM. This approach has significant drawbacks: - It enforces mutual exclusion, preventing concurrent reads of the ...
```diff diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index ac7f970c7883..643a199f6e9e 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -373,9 +373,6 @@ struct kvm_arch { /* Maximum number of counters for the guest */ u8 nr_pmu_counters; ...
c0dc68f4e2aa7eddb9ec6d95931f9576d8fe7334
Analyze and fix the following issue in the Linux kernel code: drm/i915/display: fix the pixel normalization handling for xe3p_lpd
Problem Details: Pixel normalizer is enabled with normalization factor as 1.0 for FP16 formats in order to support FBC for those formats in xe3p_lpd. Previously pixel normalizer gets disabled during the plane disable routine. But there could be plane format settings without explicitly calling the plane disable in-betwe...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_display_device.h b/drivers/gpu/drm/i915/display/intel_display_device.h index 13558bc648ab..e84c190dcc4f 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.h +++ b/drivers/gpu/drm/i915/display/intel_display_device.h @@ -193,6 +193,7 @@ struct intel_disp...
78f1421dc3ac2588fb59b55e2b4c2c55a442913e
Analyze and fix the following issue in the Linux kernel code: Revert "drm/gma500: use drm_crtc_vblank_crtc()"
Problem Details: This reverts commit d930ffa5d6e8867a290db9c6aad1c62731aeb2c3. According to Thomas, commit d930ffa5d6e8 ("drm/gma500: use drm_crtc_vblank_crtc()") breaks the driver with a NULL-ptr oops on startup. This is because the IRQ initialization in gma_irq_install() now uses CRTCs that are only allocated later ...
```diff diff --git a/drivers/gpu/drm/gma500/psb_irq.c b/drivers/gpu/drm/gma500/psb_irq.c index 3a946b472064..c224c7ff353c 100644 --- a/drivers/gpu/drm/gma500/psb_irq.c +++ b/drivers/gpu/drm/gma500/psb_irq.c @@ -250,7 +250,6 @@ static irqreturn_t gma_irq_handler(int irq, void *arg) void gma_irq_preinstall(struct drm_de...
ba90a7af74a56326f4ff774674ff4f510dcddee1
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: use wiphy_hrtimer_work for CAC timeout
Problem Details: Prior initiating communication in a DFS channel, there should be a monitoring of RADAR in that channel for a minimum of 600 seconds if it is a Weather RADAR channel and 60 seconds for other DFS channels. This Channel Availability Check(CAC) is currently implemented by scheduling a work item for executi...
```diff diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 964f440e31cd..3551049d64b3 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1916,7 +1916,7 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev, if (sdata->wdev.links[link_id].cac_started) { chandef = link_conf-...
ab89060fbc92edd6e852bf0f533f29140afabe0e
Analyze and fix the following issue in the Linux kernel code: pidfs: return -EREMOTE when PIDFD_GET_INFO is called on another ns
Problem Details: Currently it is not possible to distinguish between the case where a process has already exited and the case where a process is in a different namespace, as both return -ESRCH. glibc's pidfd_getpid() procfs-based implementation returns -EREMOTE in the latter, so that distinguishing the two is possible,...
```diff diff --git a/fs/pidfs.c b/fs/pidfs.c index dba703d4ce4a..8e66d3993dd8 100644 --- a/fs/pidfs.c +++ b/fs/pidfs.c @@ -329,7 +329,7 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg) * namespace hierarchy. */ if (!pid_in_current_pidns(pid)) - return -ESRCH; + return -EREMOTE...
c33efdfcfa6f80e05ce1ee33694c1bad4994cd78
Analyze and fix the following issue in the Linux kernel code: dma: contiguous: Check return value of dma_contiguous_reserve_area()
Problem Details: Commit 8f1fc1bf1a3d ("dma: contiguous: Reserve default CMA heap") introduced a bug where dma_heap_cma_register_heap() is called with a NULL pointer when dma_contiguous_reserve_area() fails to reserve the CMA area. When dma_contiguous_reserve_area() fails, dma_contiguous_default_area remains NULL (init...
```diff diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index 0e266979728b..c56004d314dc 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -257,10 +257,12 @@ void __init dma_contiguous_reserve(phys_addr_t limit) pr_debug("%s: reserving %ld MiB for global area\n", __func__, (un...
daafcc0ef0b358d9d622b6e3b7c43767aa3814ee
Analyze and fix the following issue in the Linux kernel code: tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow
Problem Details: The dma_map_sg tracepoint can trigger a perf buffer overflow when tracing large scatter-gather lists. With devices like virtio-gpu creating large DRM buffers, nents can exceed 1000 entries, resulting in: phys_addrs: 1000 * 8 bytes = 8,000 bytes dma_addrs: 1000 * 8 bytes = 8,000 bytes lengths: ...
```diff diff --git a/include/trace/events/dma.h b/include/trace/events/dma.h index b3fef140ae15..33e99e792f1a 100644 --- a/include/trace/events/dma.h +++ b/include/trace/events/dma.h @@ -275,6 +275,8 @@ TRACE_EVENT(dma_free_sgt, sizeof(u64), sizeof(u64))) ); +#define DMA_TRACE_MAX_ENTRIES 128 + TRACE_EVENT(dma...
05c8de4f09b08e97c6ecb190dcec0e68b167cb03
Analyze and fix the following issue in the Linux kernel code: md: fix return value of mddev_trylock
Problem Details: A return value of 0 is treaded as successful lock acquisition. In fact, a return value of 1 means getting the lock successfully. Link: https://lore.kernel.org/linux-raid/20260127073951.17248-1-xni@redhat.com Fixes: 9e59d609763f ("md: call del_gendisk in control path") Reported-by: Bart Van Assche <bva...
```diff diff --git a/drivers/md/md.h b/drivers/md/md.h index e6d3d88698ed..ac84289664cd 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -735,8 +735,8 @@ static inline int mddev_trylock(struct mddev *mddev) int ret; ret = mutex_trylock(&mddev->reconfig_mutex); - if (!ret && test_bit(MD_DELETED, &mddev->flags...
6abc7d5dcf0ee0f85e16e41c87fbd06231f28753
Analyze and fix the following issue in the Linux kernel code: md/raid1: fix memory leak in raid1_run()
Problem Details: raid1_run() calls setup_conf() which registers a thread via md_register_thread(). If raid1_set_limits() fails, the previously registered thread is not unregistered, resulting in a memory leak of the md_thread structure and the thread resource itself. Add md_unregister_thread() to the error path to pro...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 79faec11b79e..867db18bc3ba 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -3236,6 +3236,7 @@ static int raid1_run(struct mddev *mddev) if (!mddev_is_dm(mddev)) { ret = raid1_set_limits(mddev); if (ret) { + md_unregister_thread(mdd...
0a4524bc69882a4ddb235bb6b279597721bda197
Analyze and fix the following issue in the Linux kernel code: xfrm: skip templates check for packet offload tunnel mode
Problem Details: In packet offload, hardware is responsible to check templates. The result of its operation is forwarded through secpath by relevant drivers. That secpath is actually removed in __xfrm_policy_check2(). In case packet is forwarded, this secpath is reset in RX, but pushed again to TX where policy is rech...
```diff diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 62486f866975..5428185196a1 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -3801,8 +3801,8 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, struct xfrm_tmpl *tp[XFRM_MAX_DEPTH]; struct xfrm_tmpl...
1799d8abeabc68ec05679292aaf6cba93b343c05
Analyze and fix the following issue in the Linux kernel code: xfrm6: fix uninitialized saddr in xfrm6_get_saddr()
Problem Details: xfrm6_get_saddr() does not check the return value of ipv6_dev_get_saddr(). When ipv6_dev_get_saddr() fails to find a suitable source address (returns -EADDRNOTAVAIL), saddr->in6 is left uninitialized, but xfrm6_get_saddr() still returns 0 (success). This causes the caller xfrm_tmpl_resolve_one() to us...
```diff diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 1f19b6f14484..125ea9a5b8a0 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c @@ -57,6 +57,7 @@ static int xfrm6_get_saddr(xfrm_address_t *saddr, struct dst_entry *dst; struct net_device *dev; struct inet6_dev *idev; + in...
e08dd1ee49838750a514e83c0aa60cd12ba6ecbb
Analyze and fix the following issue in the Linux kernel code: xenbus: Use .freeze/.thaw to handle xenbus devices
Problem Details: The goal is to fix s2idle and S3 for Xen PV devices. A domain resuming from s3 or s2idle disconnects its PV devices during resume. The backends are not expecting this and do not reconnect. b3e96c0c7562 ("xen: use freeze/restore/thaw PM events for suspend/ resume/chkpt") changed xen_suspend()/do_susp...
```diff diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c index 6d1819269cbe..199917b6f77c 100644 --- a/drivers/xen/xenbus/xenbus_probe_frontend.c +++ b/drivers/xen/xenbus/xenbus_probe_frontend.c @@ -148,11 +148,9 @@ static void xenbus_frontend_dev_shutdown(struct devi...
0949c646d64697428ff6257d52efa5093566868d
Analyze and fix the following issue in the Linux kernel code: Partial revert "x86/xen: fix balloon target initialization for PVH dom0"
Problem Details: This partially reverts commit 87af633689ce16ddb166c80f32b120e50b1295de so the current memory target for PV guests is still fetched from start_info->nr_pages, which matches exactly what the toolstack sets the initial memory target to. Using get_num_physpages() is possible on PV also, but needs adjustin...
```diff diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 53282dc7d5ac..23b91bf9b663 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -470,7 +470,7 @@ int __init arch_xen_unpopulated_init(struct resource **res) * driver to know how much of the physmap is unpopulated and ...
82ef60ec084b2ea418c50fca2c8776fb8ec27067
Analyze and fix the following issue in the Linux kernel code: ata: pata_cypress: fix typo in error message
Problem Details: An error message in the pata_cypress driver has a typo "mome" for "mode". Fix it. Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
```diff diff --git a/drivers/ata/pata_cypress.c b/drivers/ata/pata_cypress.c index ae347b5c2871..3b0e6858d727 100644 --- a/drivers/ata/pata_cypress.c +++ b/drivers/ata/pata_cypress.c @@ -62,7 +62,7 @@ static void cy82c693_set_piomode(struct ata_port *ap, struct ata_device *adev) u32 addr; if (ata_timing_compute(a...
a5338e365c4559d7b4d7356116b0eb95b12e08d5
Analyze and fix the following issue in the Linux kernel code: PCI/IOV: Fix race between SR-IOV enable/disable and hotplug
Problem Details: Commit 05703271c3cd ("PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV") tried to fix a race between the VF removal inside sriov_del_vfs() and concurrent hot unplug by taking the PCI rescan/remove lock in sriov_del_vfs(). Similarly the PCI rescan/remove lock was also taken in sriov...
```diff diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 7de5b18647be..4a659c34935e 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -495,7 +495,9 @@ static ssize_t sriov_numvfs_store(struct device *dev, if (num_vfs == 0) { /* disable VFs */ + pci_lock_rescan_remove(); ret = pdev->driver->sr...
2fa119c0e5e528453ebae9e70740e8d2d8c0ed5a
Analyze and fix the following issue in the Linux kernel code: Revert "PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV"
Problem Details: This reverts commit 05703271c3cd ("PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV"), which causes a deadlock by recursively taking pci_rescan_remove_lock when sriov_del_vfs() is called as part of pci_stop_and_remove_bus_device(). For example with the following sequence of command...
```diff diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 00784a60ba80..7de5b18647be 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -629,18 +629,15 @@ static int sriov_add_vfs(struct pci_dev *dev, u16 num_vfs) if (dev->no_vf_scan) return 0; - pci_lock_rescan_remove(); for (i = 0; i < num_vfs;...
6c65db809796717f0a96cf22f80405dbc1a31a4b
Analyze and fix the following issue in the Linux kernel code: Revert "drm/nouveau/disp: Set drm_mode_config_funcs.atomic_(check|commit)"
Problem Details: This reverts commit 604826acb3f53c6648a7ee99a3914ead680ab7fb. Apparently there is more to supporting atomic modesetting than providing atomic_(check|commit) callbacks. Before this revert: WARNING: [] drivers/gpu/drm/drm_plane.c:389 at .__drm_universal_plane_init+0x13c/0x794 [drm], CPU#1: modprobe/179...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 829c2b573971..00515623a2cc 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -352,8 +352,6 @@ nouveau_user_framebuffer_create(struct drm_device *dev, ...
289b14592cefe95f7d0ef334873c12b96ce3824f
Analyze and fix the following issue in the Linux kernel code: driver core: fix inverted "locked" suffix of driver_match_device()
Problem Details: In the current implementation driver_match_device() expects the device lock to be held, while driver_match_device_locked() acquires the device lock. By convention it should be the other way around, hence swap the name of both functions. Fixes: dc23806a7c47 ("driver core: enforce device_lock for drive...
```diff diff --git a/drivers/base/base.h b/drivers/base/base.h index 5bc1439d3498..8c2175820da9 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -179,19 +179,19 @@ void device_release_driver_internal(struct device *dev, const struct device_driv void driver_detach(const struct device_driver *drv); void dr...
726c262060252e13d5805f9acc382fb9f081ba07
Analyze and fix the following issue in the Linux kernel code: rust: io: move MIN_SIZE and io_addr_assert to IoKnownSize
Problem Details: `MIN_SIZE` and `io_addr_assert` are only ever used for IO types which implement `IoKnownSize` and do not make sense for types that don't. It looks like they should have been there since the beginning, so move them while the code is still fresh. Also update `IoKnownSize`'s documentation since it is no...
```diff diff --git a/rust/kernel/io.rs b/rust/kernel/io.rs index 056a3ec71647..c1cca7b438c3 100644 --- a/rust/kernel/io.rs +++ b/rust/kernel/io.rs @@ -301,9 +301,6 @@ pub trait IoCapable<T> {} /// For MMIO regions, all widths (u8, u16, u32, and u64 on 64-bit systems) are typically /// supported. For PCI configuration...
72bfbe50ffbf36937c77b39e19143aabdb69b080
Analyze and fix the following issue in the Linux kernel code: rust: pci: re-export ConfigSpace
Problem Details: Re-export ConfigSpace, such that users can refer to the type as kernel::pci::ConfigSpace, rather than kernel::pci::io::ConfigSpace. Fixes: 4dc0bacb1d3c ("rust: pci: add config space read/write support") Reported-by: Gary Guo <gary@garyguo.net> Closes: https://lore.kernel.org/rust-for-linux/DG2D5ONS18F...
```diff diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs index f347c2f7c3a6..af74ddff6114 100644 --- a/rust/kernel/pci.rs +++ b/rust/kernel/pci.rs @@ -42,6 +42,7 @@ pub use self::id::{ }; pub use self::io::{ Bar, + ConfigSpace, ConfigSpaceKind, ConfigSpaceSize, Extended, ```
0713b26190addfa3a774b386c8658952ef9f7faf
Analyze and fix the following issue in the Linux kernel code: iio: magn: mmc5633: Fix Kconfig for combination of I3C as module and driver builtin
Problem Details: Fix based on similar fix in: commit 83b645ee43f7 ("hwmon: tmp108: fix I3C dependency") Note to keep things simple I'm now requiring I2C. That can probably be relaxed in future, but I want to reduce the test set of builds for now given this is blocker for the main IIO pull request. Fixes: e559c8641460...
```diff diff --git a/drivers/iio/magnetometer/Kconfig b/drivers/iio/magnetometer/Kconfig index 2b81b22c9550..9345fb6d5317 100644 --- a/drivers/iio/magnetometer/Kconfig +++ b/drivers/iio/magnetometer/Kconfig @@ -141,9 +141,10 @@ config MMC35240 config MMC5633 tristate "MEMSIC MMC5633 3-axis magnetic sensor" - selec...