id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
08886fa69c0f56f886b63d7835da0632ea4082f7
Analyze and fix the following issue in the Linux kernel code: arm64: dts: freescale: fsl-ls1028a-tqmls1028a-mbls1028a: switch mmc aliases
Problem Details: All modern TQ-Systems boards follow the convention that mmc0 is the eMMC and mmc1 is the SD-card when both interfaces exist, reducing differences between boards for both documentation and U-Boot code (which uses the same Device Trees). Adjust the recently added MBLS1028A Device Tree accordingly. Fixes...
```diff diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-tqmls1028a-mbls1028a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1028a-tqmls1028a-mbls1028a.dtsi index cf338b2e8006..426a81e1743f 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-tqmls1028a-mbls1028a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a...
5b19ca527471903920d713bc48518a036a95bf6b
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8mp-kontron: Fix GPIO for display power switch
Problem Details: The GPIO that controls the power supply for the LVDS display connector has changed between early prototypes and the current production design of the hardware. Reflect this change in the devicetree to properly switch on the panel supply. This was working before even with the wrong GPIO due to the bidir...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mp-kontron-bl-osm-s.dts b/arch/arm64/boot/dts/freescale/imx8mp-kontron-bl-osm-s.dts index 75ae46642782..29ce863403b8 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-kontron-bl-osm-s.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-kontron-bl-osm-s.dts @@ -49,7 +49,...
748835fcb2eb2120234aef9556d282272501b96b
Analyze and fix the following issue in the Linux kernel code: arm64: dts: tqma8mpql-mba8mpxl: configure sai clock in audio codec as well
Problem Details: With deferrable card binding the sound card driver tries to get the mclk configuration before it is setup in sai3 node. Fix this by setting the sai clock config for the audio codec as well. Fixes: d8f9d8126582 ("arm64: dts: imx8mp: Add analog audio output on i.MX8MP TQMa8MPxL/MBa8MPxL") Signed-off-by:...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts index 890d1e525a48..6b0f944095e7 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts @@ -6...
65210e81f7837a871a17237d15e4b1191d5e8771
Analyze and fix the following issue in the Linux kernel code: arm64: dts: s32g3: Fix SWT8 watchdog address
Problem Details: Add missing hex annotation to fix the SWT8 watchdog address in 'reg' property, as reported by dtc W=1: s32g3.dtsi:863.27-869.5: Warning (simple_bus_reg): /soc@0/watchdog@40500000: simple-bus unit address format error, expected "269fb20" Lack of hex '0x' meant address would be interpreted as decimal...
```diff diff --git a/arch/arm64/boot/dts/freescale/s32g3.dtsi b/arch/arm64/boot/dts/freescale/s32g3.dtsi index 42646b2d16b0..6a1e0665d73e 100644 --- a/arch/arm64/boot/dts/freescale/s32g3.dtsi +++ b/arch/arm64/boot/dts/freescale/s32g3.dtsi @@ -900,7 +900,7 @@ swt8: watchdog@40500000 { compatible = "nxp,s32g3-sw...
13a37b30e464503515625ba891018aec0264c7d2
Analyze and fix the following issue in the Linux kernel code: arm64: dts: lx2162a-clearfog: use rev2 SoC dtsi
Problem Details: LX2160A and LX2162A are different packages of the same silicon. While LX2160A had two revisions, LX2162A was released later based on LX2160A revision 2. Commit a8fe6c8dfc40 ("arm64: dts: fsl-lx2160a: add rev2 support") has added a new soc dtsi for revision 2. Update LX2162A Clearfog description to us...
```diff diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2162a-clearfog.dts b/arch/arm64/boot/dts/freescale/fsl-lx2162a-clearfog.dts index 9d50d3e2761d..f95e9c19bfc7 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2162a-clearfog.dts +++ b/arch/arm64/boot/dts/freescale/fsl-lx2162a-clearfog.dts @@ -6,7 +6,7 @@ /dts-v...
9ed3013970900fc201379b881fcb7e1cadd572c4
Analyze and fix the following issue in the Linux kernel code: arm64: dts: lx2160a-rev2: extend 32-bit and add 64-bit pci regions
Problem Details: LX2160 SoC PCIe controller supports 64-bit memory regions up to 16GB, 32-bit regions up to 3GB and 16-bit regions up to 64k. For each PCIe controller: - extend the existing 32-bit regions to 3GB size - add 64-bit region See [1] and [2] for boot messages showing ranges before and after. On LX2160A Sil...
```diff diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rev2.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rev2.dtsi index f54005e37924..3570399f9b21 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rev2.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rev2.dtsi @@ -14,8 +14,12 @@ 0x80 0x000...
dbecf38e60d4ef08c59836b7bc16e8efca01fc47
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx95: Correct PCIe outbound address space configuration
Problem Details: Fix the PCIe outbound memory ranges for both pcie0 and pcie1 controllers on i.MX95. The memory window size was incorrectly set to 256MB during initial bring-up, but the hardware supports up to 4GB of outbound address space per controller. Additionally, the ECAM region cannot be mapped as I/O space. U...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx95.dtsi b/arch/arm64/boot/dts/freescale/imx95.dtsi index b4ca507b650a..d6c549c16047 100644 --- a/arch/arm64/boot/dts/freescale/imx95.dtsi +++ b/arch/arm64/boot/dts/freescale/imx95.dtsi @@ -1947,8 +1947,9 @@ <0 0x4c360000 0 0x10000>, <0 0x4c340000...
2521addd5df7e8ab805622d4a0eff9735a45fa11
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx94: fix DDR PMU interrupt number
Problem Details: The DDR Performance Monitor node was added with incorrect interrupt number 91, which actually belongs to the wdog4 watchdog. Fix it to the correct interrupt number 374. Fixes: e918e5f847b3 ("arm64: dts: imx94: add DDR Perf Monitor node") Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Xu Yan...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx94.dtsi b/arch/arm64/boot/dts/freescale/imx94.dtsi index 589f4aadc742..03889092eaf5 100644 --- a/arch/arm64/boot/dts/freescale/imx94.dtsi +++ b/arch/arm64/boot/dts/freescale/imx94.dtsi @@ -1569,7 +1569,7 @@ ddr-pmu@4e090dc0 { compatible = "fsl,imx94-ddr-pmu",...
65c16cd0def939e86552f1b22ffdbd63b69eebe4
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx943-evk: Fix PCIe EP vpcie-supply
Problem Details: The vpcie-supply property should reference the regulator that controls the actual M.2 power supply, not the W_DISABLE1# signal. On imx943-evk: - reg_m2_wlan controls M.2 W_DISABLE1# signal - reg_m2_pwr controls the actual M.2 power supply Fix the vpcie-supply to use reg_m2_pwr for proper power control...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx943-evk.dts b/arch/arm64/boot/dts/freescale/imx943-evk.dts index fe4fc512d95d..426b5a4ec47c 100644 --- a/arch/arm64/boot/dts/freescale/imx943-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx943-evk.dts @@ -1043,7 +1043,7 @@ &pcie0_ep { pinctrl-0 = <&pinctrl_pcie0>...
95f5bc1632ab8f243e517357b5da0dd28d1c6c92
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8mp-kontron: Reduce EERAM SPI clock frequency
Problem Details: There is an onboard level shifter for the SPI signals that causes additional propagation delay and renders the SPI transmission unreliable at 20 MHz. Reduce the clock frequency to a safe value. Fixes: 946ab10e3f40 ("arm64: dts: Add support for Kontron OSM-S i.MX8MP SoM and BL carrier board") Signed-of...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mp-kontron-bl-osm-s.dts b/arch/arm64/boot/dts/freescale/imx8mp-kontron-bl-osm-s.dts index 0924ac50fd2d..75ae46642782 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-kontron-bl-osm-s.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-kontron-bl-osm-s.dts @@ -63,7 +63,...
1521d560b7a1a39e437d37fffd9b55435d329ad1
Analyze and fix the following issue in the Linux kernel code: RDMA/irdma: Initialize iwmr->access during MR registration
Problem Details: Initialize iwmr->access during initial user mem registration so that it contains a valid value during a subsequent rereg_mr. Otherwise, a rereg_mr that doesn't set IB_MR_REREG_ACCESS (for example, one that only changes the PD) ends up clearing the access flags in HW since iwmr->access is zero-initiali...
```diff diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index 231b2854bb14..b79f5afe68e5 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -3306,6 +3306,7 @@ static int irdma_reg_user_mr_type_mem(struct irdma_mr *iwmr, int access, int ...
4385ddd654d90245eeb83b3cb539670ab5c85ba4
Analyze and fix the following issue in the Linux kernel code: RDMA/irdma: Fix OOB read during CQ MR registration
Problem Details: Sashiko pointed out an unrelated bug during a previous patch: https://sashiko.dev/#/patchset/20260512183852.614045-1-jmoroni%40google.com This change fixes the bug by eliminating the cqmr->split field which was not being set properly and instead just checks the CQ resize feature flag directly. The cq...
```diff diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index 284dfba4e984..231b2854bb14 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -2557,7 +2557,6 @@ static int irdma_create_cq(struct ib_cq *ibcq, } cqmr_shadow = &iwpbl_s...
7d29f7e9dbd844cae4d3e559cf78324b9642fd6b
Analyze and fix the following issue in the Linux kernel code: RDMA/siw: bound Read Response placement to the RREAD length
Problem Details: In drivers/infiniband/sw/siw/siw_qp_rx.c, siw_proc_rresp() places each inbound Read Response DDP segment at sge->laddr + wqe->processed and then accumulates wqe->processed, but it never checks the running total against the sink buffer length on continuation segments. siw_check_sge() resolves and valida...
```diff diff --git a/drivers/infiniband/sw/siw/siw_qp_rx.c b/drivers/infiniband/sw/siw/siw_qp_rx.c index 34d03584160c..b566d163c5aa 100644 --- a/drivers/infiniband/sw/siw/siw_qp_rx.c +++ b/drivers/infiniband/sw/siw/siw_qp_rx.c @@ -844,6 +844,15 @@ int siw_proc_rresp(struct siw_qp *qp) } mem_p = *mem; + if (unlike...
a26b499b757cfc8bbff1088bb1b844639e250893
Analyze and fix the following issue in the Linux kernel code: vfio: prevent infinite loop in vfio_mig_get_next_state() on blocked arc
Problem Details: vfio_mig_get_next_state() walks vfio_from_fsm_table[] one step at a time, looping to skip optional states the device does not support until *next_fsm is supported. A blocked transition is encoded as VFIO_DEVICE_STATE_ERROR, which the trailing return reports as -EINVAL. The skip loop does not account f...
```diff diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index 6222376ab6ab..5e0422014523 100644 --- a/drivers/vfio/vfio_main.c +++ b/drivers/vfio/vfio_main.c @@ -858,7 +858,8 @@ int vfio_mig_get_next_state(struct vfio_device *device, * logical state, as per the above comment. */ *next_fsm = vfi...
0d32eabccbe4b2f8d45be3192c5f3c76c8af703d
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix state and counter desync on loopback enable failure
Problem Details: In mlx5_ib_enable_lb(), dev->lb.enabled was unconditionally set to true even if mlx5_nic_vport_update_local_lb() failed. Fix this by only setting dev->lb.enabled on success. On failure, roll back the reference counters and return the error. Link: https://patch.msgid.link/r/20260601095818.2227-1-liron...
```diff diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index e2e8feb1b60d..a558ac5bb219 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -2024,6 +2024,9 @@ int mlx5_ib_enable_lb(struct mlx5_ib_dev *dev, bool td, bool qp) dev->lb.qps == 1...
309cacf953aa7e289ce50b3e7e4424c63103c333
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix error propagation in __mlx5_ib_add
Problem Details: __mlx5_ib_add() currently returns -ENOMEM on any stage initialization failure, losing the actual error code returned by the init function. This makes it impossible for callers to distinguish between different failure reasons (e.g. -EINVAL, -EIO, -EOPNOTSUPP) and leads to misleading error handling. Fix...
```diff diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 12bfefc91b02..e2e8feb1b60d 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -5116,7 +5116,7 @@ err_out: if (profile->stage[i].cleanup) profile->stage[i].cleanup(dev); } - re...
1516134cb65526aba5319bb446c296fc8a192f84
Analyze and fix the following issue in the Linux kernel code: ALSA: hda: fix Kconfig dependency of HD Audio PCI
Problem Details: With commit 2d9223d2d64c ("ALSA: hda: Move controller drivers into sound/hda/controllers directory") the HD Audio drivers have been moved from linux/sound/pci/hda to linux/sound/hda. But the Kconfig dependency for SND_HDA_INTEL stayed on SND_PCI instead of depending on PCI directly. To make the "HD Au...
```diff diff --git a/sound/hda/controllers/Kconfig b/sound/hda/controllers/Kconfig index 72855f2df451..5d6a77e68588 100644 --- a/sound/hda/controllers/Kconfig +++ b/sound/hda/controllers/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config SND_HDA_INTEL tristate "HD Audio PCI" - depends on SND_PCI...
65cbdffa324d6d50dc14f762c1430a2d1dafb7d4
Analyze and fix the following issue in the Linux kernel code: accel/amdxdna: Require carveout when PASID and force_iova are disabled
Problem Details: When both PASID and force_iova are disabled, carveout memory should be used. Reject buffer allocations that cannot use carveout memory in this configuration and return an error. Fixes: 3cc5d7a59519 ("accel/amdxdna: Add carveout memory support for non-IOMMU systems") Reviewed-by: Mario Limonciello (AMD...
```diff diff --git a/drivers/accel/amdxdna/amdxdna_pci_drv.c b/drivers/accel/amdxdna/amdxdna_pci_drv.c index c677293c1ae7..1f066ed8d236 100644 --- a/drivers/accel/amdxdna/amdxdna_pci_drv.c +++ b/drivers/accel/amdxdna/amdxdna_pci_drv.c @@ -120,8 +120,14 @@ static int amdxdna_drm_open(struct drm_device *ddev, struct drm_...
e659112a39cd93150d93c4661444a439d512e1ca
Analyze and fix the following issue in the Linux kernel code: KVM: RISC-V: SBI FWFT: Fix stale feature exposure after runtime extension changes
Problem Details: Fix a bug where FWFT features could be incorrectly exposed to guests after userspace disables their dependent ISA extensions at runtime. The 'supported' field in kvm_sbi_fwft_config was set once during vCPU initialization based on the initial hardware/extension availability. However, when userspace su...
```diff diff --git a/arch/riscv/kvm/vcpu_sbi_fwft.c b/arch/riscv/kvm/vcpu_sbi_fwft.c index aee951f2b8e6..ab39ac464ffd 100644 --- a/arch/riscv/kvm/vcpu_sbi_fwft.c +++ b/arch/riscv/kvm/vcpu_sbi_fwft.c @@ -303,6 +303,8 @@ static int kvm_fwft_get_feature(struct kvm_vcpu *vcpu, u32 feature, if (!tconf->supported || !tco...
86957e5b4bff60c2f97d79c922e5dfafe0d94151
Analyze and fix the following issue in the Linux kernel code: KVM: RISC-V: SBI FWFT: Add optional init() callback for hardware probing
Problem Details: Add an optional init() callback to separate one-time hardware probing from runtime availability checks. For pointer masking, this allows probing supported PMM lengths during initialization while checking ISA extension availability at runtime. Fix try_to_set_pmm() to restore the previous HENVCFG.PMM va...
```diff diff --git a/arch/riscv/kvm/vcpu_sbi_fwft.c b/arch/riscv/kvm/vcpu_sbi_fwft.c index 5e4aafb0cbf1..aee951f2b8e6 100644 --- a/arch/riscv/kvm/vcpu_sbi_fwft.c +++ b/arch/riscv/kvm/vcpu_sbi_fwft.c @@ -35,6 +35,16 @@ struct kvm_sbi_fwft_feature { */ bool (*supported)(struct kvm_vcpu *vcpu); + /** + * @init: Pr...
63224b02748ddc6ee0ad0ee691768151da4a752d
Analyze and fix the following issue in the Linux kernel code: KVM: RISC-V: SBI FWFT: Mark vCPU CSRs dirty after setting feature value
Problem Details: Mark the vCPU CSRs as dirty after successfully setting an FWFT feature value. FWFT features may modify CSRs (e.g., pointer masking modifies henvcfg.PMM), and failing to mark them dirty can lead to the guest observing stale CSR state after vCPU scheduling or migration. Fixes: 1323a5cfe52c ("KVM: riscv:...
```diff diff --git a/arch/riscv/kvm/vcpu_sbi_fwft.c b/arch/riscv/kvm/vcpu_sbi_fwft.c index 2eab15339694..5e4aafb0cbf1 100644 --- a/arch/riscv/kvm/vcpu_sbi_fwft.c +++ b/arch/riscv/kvm/vcpu_sbi_fwft.c @@ -521,6 +521,7 @@ static int kvm_sbi_ext_fwft_set_reg(struct kvm_vcpu *vcpu, unsigned long reg_num break; case 2: ...
9b2207bc5cdb955bdae34b3eec80f04979e17081
Analyze and fix the following issue in the Linux kernel code: IB/cm: Fix av cm device leak on an error path in cm_init_av_by_path()
Problem Details: Codex pointed out that cm_init_av_by_path() can call cm_set_av_port() which takes a reference on the cm device, but then can immediately return error if ib_init_ah_attr_from_path() fails. Since callers like ib_send_cm_req() put the av on the stack this leaks that cm device reference. Re-order cm_init...
```diff diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 6ab9a0aee1ec..1a2c2775b14d 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -530,6 +530,7 @@ static int cm_init_av_by_path(struct sa_path_rec *path, struct rdma_ah_attr new_ah_attr; struct cm_device...
0ee8ac903e5aa100a70bef8d0afc19a336ffa775
Analyze and fix the following issue in the Linux kernel code: RDMA/hfi1: Open-code rvt_set_ibdev_name()
Problem Details: clang warns about a function missing a printf attribute: include/rdma/rdma_vt.h:457:47: error: diagnostic behavior may be improved by adding the 'format(printf, 2, 3)' attribute to the declaration of 'rvt_set_ibdev_name' [-Werror,-Wmissing-format-attribute] 447 | static inline void rvt_set_ibdev_nam...
```diff diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index 8b5a5b32b0fa..b7fd8b1fbbbd 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -1206,6 +1206,7 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_...
09ea6837a0434fb4db99528a5055b6d822135dcf
Analyze and fix the following issue in the Linux kernel code: RDMA/umem: Be careful about boundary conditions in ib_umem_find_best_pgsz()
Problem Details: Several corner cases, especially important on 32 bits: - umem->iova is u64, the function argument should pass in u64 or iova will be truncated - Check that the length is not too large for the iova - Check that lengths > 4G don't overflow the GENMASK Link: https://patch.msgid.link/r/2-v1-88303e9e509...
```diff diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index e424a9de66c1..fd8f3888da52 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c @@ -84,14 +84,17 @@ static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int d */ unsigned long ...
f64c723741c911544cca4c838d7a291b06b3ad1d
Analyze and fix the following issue in the Linux kernel code: bpf: Replace scratch PTE atomically when allocating arena pages
Problem Details: apply_range_set_cb() maps the pages for a new arena allocation and returned -EBUSY when the target PTE was already populated. Kernel-fault recovery leaves the per-arena scratch page in unallocated arena PTEs, so a later bpf_arena_alloc_pages() over such a page hits that -EBUSY, and every subsequent all...
```diff diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 984f0502c9d0..3ce0f2a6cab6 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -1842,6 +1842,17 @@ static inline bool ptep_try_set(pte_t *ptep, pte_t new_pte) } #define ptep_try_set ptep_...
07ebe87915d8accdaba20c4f88c5ae430fe62fbb
Analyze and fix the following issue in the Linux kernel code: misc: fastrpc: fix use-after-free race in fastrpc_map_create
Problem Details: fastrpc_map_lookup returns a raw pointer after releasing fl->lock. The caller fastrpc_map_create then calls fastrpc_map_get (kref_get_unless_zero) on this unprotected pointer. A concurrent MEM_UNMAP can free the map between the lock release and the kref operation, resulting in a use-after-free on the f...
```diff diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 47cf3d21b51d..f3a49384586d 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -388,7 +388,7 @@ static int fastrpc_map_get(struct fastrpc_map *map) static int fastrpc_map_lookup(struct fastrpc_user *fl, int fd, - struc...
5401fb4fe10fac6134c308495df18ed74aebb9c4
Analyze and fix the following issue in the Linux kernel code: misc: fastrpc: Fix NULL pointer dereference in rpmsg callback
Problem Details: A NULL pointer dereference was observed on Hawi at boot when the DSP sends a glink message before fastrpc_rpmsg_probe() has completed initialization: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000178 pc : _raw_spin_lock_irqsave+0x34/0x8c lr : fastrpc_rpmsg_call...
```diff diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index cca7489605c5..47cf3d21b51d 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -2460,7 +2460,6 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) kref_init(&data->refcount); - dev_set_drvdata(&rpdev->dev, data); ...
464c6ad2aa16e1e1df9d559289199356493d1e00
Analyze and fix the following issue in the Linux kernel code: misc: fastrpc: fix DMA address corruption due to find_vma misuse
Problem Details: fastrpc_get_args() uses find_vma() to look up the VMA for a user-provided pointer and compute a DMA address offset. When the address falls in a gap before the returned VMA, (ptr & PAGE_MASK) - vma->vm_start underflows, corrupting the DMA address sent to the DSP. Replace find_vma() with vma_lookup(), w...
```diff diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 48f8262af539..cca7489605c5 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1090,7 +1090,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx) pages[i].addr = ctx->maps[i]->dma_addr; mmap_read...
e85eb5feca8e254905ffa6c57a3c99c89a674a0f
Analyze and fix the following issue in the Linux kernel code: misc: fastrpc: fix use-after-free of fastrpc_user in workqueue context
Problem Details: There is a race between fastrpc_device_release() and the workqueue that processes DSP responses. When the user closes the file descriptor, fastrpc_device_release() frees the fastrpc_user structure. Concurrently, an in-flight DSP invocation can complete and fastrpc_rpmsg_callback() schedules context cle...
```diff diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 1080f9acf70a..48f8262af539 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -310,6 +310,8 @@ struct fastrpc_user { spinlock_t lock; /* lock for allocations */ struct mutex mutex; + /* Reference count */ + struct kref ref...
d5803e3345dae9c6470bb61869885236276b9a35
Analyze and fix the following issue in the Linux kernel code: ntfs: validate attribute values on lookup
Problem Details: ntfs_attr_find() and ntfs_external_attr_find() check that generic resident attribute values fit in their attribute records and that fixed-size resident values are large enough. For variable-length resident formats, however, the fixed part is not enough: embedded length fields can still point callers pa...
```diff diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c index 2872b4ce1835..71704ab58fa8 100644 --- a/fs/ntfs/attrib.c +++ b/fs/ntfs/attrib.c @@ -596,6 +596,97 @@ static u32 ntfs_resident_attr_min_value_length(const __le32 type) } } +static bool ntfs_file_name_attr_value_is_valid(const u8 *value, const u32 value_...
ec4f061f2219e0f0c6465d56d0380bf749235a53
Analyze and fix the following issue in the Linux kernel code: ntfs: detect mapping-pairs LCN accumulator overflow
Problem Details: The NTFS mapping-pairs parser accumulates relative LCN deltas in a signed integer. A corrupted attribute can drive that addition past the representable range. One corrupt runlist shape sets the accumulated LCN to S64_MAX and then adds a delta of 1 in the next mapping-pairs entry. Signed overflow is ...
```diff diff --git a/fs/ntfs/runlist.c b/fs/ntfs/runlist.c index d8e8aa7b5bc0..cbb6576cf725 100644 --- a/fs/ntfs/runlist.c +++ b/fs/ntfs/runlist.c @@ -860,7 +860,11 @@ struct runlist_element *ntfs_mapping_pairs_decompress(const struct ntfs_volume * for (deltaxcn = (s8)buf[b--]; b > b2; b--) deltaxcn = (deltaxc...
e9e50ce4f13dc721014af622613409455c734942
Analyze and fix the following issue in the Linux kernel code: ntfs: serialize volume label accesses
Problem Details: Protect vol->volume_label with a mutex and snaphost the label before copy_to_user. This prevent a use-after-free when FS_IOC_SETFSLABEL replaces the vol->volume_label and FS_IOC_GETTSLABEL reads it concurrently. Cc: stable@vger.kernel.org # v7.1 Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-o...
```diff diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index e8bea22b81a7..264cf8404385 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c @@ -707,12 +707,21 @@ static int ntfs_ioctl_get_volume_label(struct file *filp, unsigned long arg) { struct ntfs_volume *vol = NTFS_SB(file_inode(filp)->i_sb); char __user *buf = (...
18760a74ef7c28df93726445b5595162e62ed341
Analyze and fix the following issue in the Linux kernel code: ntfs: fix off-by-one in mapping pairs decoding bounds checks
Problem Details: In ntfs_mapping_pairs_decompress(), attr_end points one byte past the end of the attribute record: attr_end = (u8 *)attr + le32_to_cpu(attr->length); The two bounds checks validating that mapping pair data bytes fit within the attribute use strict greater-than (>), which allows a one-byte out-of-...
```diff diff --git a/fs/ntfs/runlist.c b/fs/ntfs/runlist.c index f27d78013856..d8e8aa7b5bc0 100644 --- a/fs/ntfs/runlist.c +++ b/fs/ntfs/runlist.c @@ -763,7 +763,7 @@ struct runlist_element *ntfs_mapping_pairs_decompress(const struct ntfs_volume * buf = (u8 *)attr + le16_to_cpu(attr->data.non_resident.mapping_pair...
aa496720618f1a6054f1c870bf10b4f6c99bf656
Analyze and fix the following issue in the Linux kernel code: bpf: Reject fragmented frames in devmap
Problem Details: Devmap broadcast redirects clone the packet for all but the last destination. For native XDP, that clone path copies only the linear xdp_frame data, while fragmented frames keep skb_shared_info in tailroom outside the linear area. Cloning such a frame leaves XDP_FLAGS_HAS_FRAGS set but without valid f...
```diff diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c index cc0a43ebab6b..5b9eac5342a9 100644 --- a/kernel/bpf/devmap.c +++ b/kernel/bpf/devmap.c @@ -581,6 +581,10 @@ static int dev_map_enqueue_clone(struct bpf_dtab_netdev *obj, { struct xdp_frame *nxdpf; + /* Frags live outside the linear frame and canno...
9974fe1db2b5d8b188000e0c2e15d1607b8f17f3
Analyze and fix the following issue in the Linux kernel code: ntfs: Fix spelling mistake "etnry" -> "entry"
Problem Details: There is a spelling mistake in a ntfs_error message. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
```diff diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c index 00e17637f771..8371ff4303e7 100644 --- a/fs/ntfs/index.c +++ b/fs/ntfs/index.c @@ -340,7 +340,7 @@ int ntfs_index_entries_inconsistent(const struct ntfs_volume *vol, if (le16_to_cpu(ie->length) < sizeof(struct index_entry_header)) { ntfs_error(vol->sb...
8488c4d066e6a52937fa5d82ab131c7554ddc9d8
Analyze and fix the following issue in the Linux kernel code: ntfs: free link name from ntfs_name_cache
Problem Details: ntfs_link() converts the new link name with ntfs_nlstoucs() using NTFS_MAX_NAME_LEN. In this case ntfs_nlstoucs() allocates the result from ntfs_name_cache, and its contract requires callers to release the buffer with kmem_cache_free(ntfs_name_cache, ...). All other ntfs_nlstoucs() callers in namei.c ...
```diff diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index c4f82846c58c..9c1c36acfad2 100644 --- a/fs/ntfs/namei.c +++ b/fs/ntfs/namei.c @@ -1532,8 +1532,7 @@ static int ntfs_link(struct dentry *old_dentry, struct inode *dir, if (uname_len < 0) { if (uname_len != -ENAMETOOLONG) ntfs_error(sb, "Failed to conv...
55f2ea9ff83cc27a85526b14bc9b32f96a08d6ec
Analyze and fix the following issue in the Linux kernel code: slimbus: qcom-ngd-ctrl: Avoid ABBA on tx_lock/ctrl->lock
Problem Details: During the SSR/PDR down notification the tx_lock is taken with the intent to provide synchronization with active DMA transfers. But during this period qcom_slim_ngd_down() is invoked, which ends up in slim_report_absent(), which takes the slim_controller lock. In multiple other codepaths these two loc...
```diff diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 8b207efeadbc..3071e46d03be 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1471,15 +1471,12 @@ static int qcom_slim_ngd_ssr_pdr_notify(struct qcom_slim_ngd_ctrl *ctrl, switch (action) { ...
6a003446b725c44b9e3ffa111b0effbaa2d43085
Analyze and fix the following issue in the Linux kernel code: slimbus: qcom-ngd-ctrl: Balance pm_runtime enablement for NGD
Problem Details: The pm_runtime_enable() and pm_runtime_use_autosuspend() calls are supposed to be balanced on exit, add these calls. Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> Signed-off-by: Srinivas Ka...
```diff diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 540a62999655..8b207efeadbc 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1582,8 +1582,11 @@ static int qcom_slim_ngd_probe(struct platform_device *pdev) pm_runtime_enable(dev); pm_ru...
07c564ea5fb859b7381429de935d5df4781947c6
Analyze and fix the following issue in the Linux kernel code: slimbus: qcom-ngd-ctrl: Initialize controller resources in controller
Problem Details: The work structs and work queue are controller resources, create and destroy them in the controller context. Creating them as part of the child device's probe path seems to be okay now that the controller's probe has been updated, but if for some reason the child does not probe successfully a SSR or PD...
```diff diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index c1f26b7de519..540a62999655 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1582,25 +1582,8 @@ static int qcom_slim_ngd_probe(struct platform_device *pdev) pm_runtime_enable(dev); pm_ru...
2a9d50e9ea406e0c8735938484adc20515ef1b47
Analyze and fix the following issue in the Linux kernel code: slimbus: qcom-ngd-ctrl: Register callbacks after creating the ngd
Problem Details: When the remoteproc starts in parallel with the NGD driver being probed, or the remoteproc is already up when the PDR lookup is being registered, or in the theoretical event that we get an interrupt from the hardware, these callbacks will operate on uninitialized data. This result in issues to boot the...
```diff diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index e9238927cd2a..c1f26b7de519 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1609,6 +1609,7 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev) { struct device *dev = &pd...
960b53a3f76fa214c2fc493734ae7b3c5e713bbf
Analyze and fix the following issue in the Linux kernel code: slimbus: qcom-ngd-ctrl: Correct PDR and SSR cleanup ownership
Problem Details: PDR and SSR callbacks are registred from the controller probe function, but currently released from the child device's remove function. The remove() function should only be unwinding what was done in the same device's probe() function. Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")...
```diff diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 6b91a6f11cb6..e9238927cd2a 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1683,6 +1683,9 @@ static void qcom_slim_ngd_ctrl_remove(struct platform_device *pdev) { struct qcom_slim_ngd_c...
2c22ff152d380ec3d3af099fa05d0ac5ca9b4c1e
Analyze and fix the following issue in the Linux kernel code: slimbus: qcom-ngd-ctrl: Fix probe error path ordering
Problem Details: qcom_slim_ngd_ctrl_probe() first registers the SSR callback then allocates the PDR context, as such the error path needs to come in opposite order to allow us to unroll each step. Fixes: 16f14551d0df ("slimbus: qcom-ngd: cleanup in probe error path") Cc: stable@vger.kernel.org Reviewed-by: Dmitry Bary...
```diff diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 47ba9fb34d25..6b91a6f11cb6 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1660,22 +1660,21 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev) if (IS_ERR(ctrl->pdr)) { ...
8663e8334d7b6007f5d8a4e5dd270246f35107a6
Analyze and fix the following issue in the Linux kernel code: slimbus: qcom-ngd-ctrl: Fix up platform_driver registration
Problem Details: Device drivers should not invoke platform_driver_register()/unregister() in their probe and remove paths. They should further not rely on platform_driver_unregister() as their only means of "deleting" their child devices. Introduce a helper to unregister the child device and move the platform_driver_r...
```diff diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 428266949fdd..47ba9fb34d25 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1560,6 +1560,13 @@ static int of_qcom_slim_ngd_register(struct device *parent, return -ENODEV; } +static voi...
120134fe75c6b0ae38f14eb8b548ad1e5761f912
Analyze and fix the following issue in the Linux kernel code: slimbus: qcom-ngd-ctrl: fix OF node refcount
Problem Details: Platform devices created with platform_device_alloc() call platform_device_release() when the last reference to the device's kobject is dropped. This function calls of_node_put() unconditionally. This works fine for devices created with platform_device_register_full() but users of the split approach (p...
```diff diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 1ed6be6e85d2..428266949fdd 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1542,7 +1542,7 @@ static int of_qcom_slim_ngd_register(struct device *parent, kfree(ngd); return ret; ...
76bc14c7097ff678b2b5dbfd4fa33b46897d87ce
Analyze and fix the following issue in the Linux kernel code: ntfs: skip extent mft records in writeback to prevent deadlock
Problem Details: This patch fixes the ABBA deadlock between extent_lock and extent mrec_lock triggered by xfstests generic/113, that occurs since the commit 6994acf33bae ("ntfs: use base mft_no when looking up base inode for extent record"). Path A (inode writeback): VFS writeback -> ntfs_write_inode() -...
```diff diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index a7d10ee41b34..a5019e80951b 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -743,23 +743,6 @@ static int ntfs_test_inode_wb(struct inode *vi, u64 ino, void *data) * * If the mft record is not a FILE record or it is a base mft record, we can * safely write ...
8f4b6e8bda121ae3d4d8e332b789664604d3e9d2
Analyze and fix the following issue in the Linux kernel code: ntfs: only alias volume $UpCase to default on exact match
Problem Details: load_and_init_upcase() currently aliases vol->upcase to the global default upcase whenever the shared prefix matches, and then truncates vol->upcase_len to that shorter prefix. The result is correct only by accident: upcase[] accesses in name collation are gated by upcase_len, so the prefix-equality a...
```diff diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 7e3561265b47..e51573be2182 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -1323,7 +1323,6 @@ static bool load_and_init_upcase(struct ntfs_volume *vol) u8 *addr; pgoff_t index, max_index; unsigned int size; - int i, max; ntfs_debug("Entering."...
5b6b6fc491899d583eaa75344e094796ae9b530b
Analyze and fix the following issue in the Linux kernel code: nvmem: core: fix use-after-free bugs in error paths
Problem Details: Fix several instances of error paths in which we call __nvmem_device_put() - which may end up freeing the underlying memory and other resources - and then keep on using the nvmem structure. Always put the reference to the nvmem device as the last step before returning the error code. Cc: stable@vger.k...
```diff diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 311cb2e5a5c0..e871181751f3 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1468,18 +1468,16 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, const char *id) cell_entry = nvmem_find_cell_entry_by_node(nvmem, cell_np)...
ea41020b9018e31c2ea7e9d89021e3e6d7470883
Analyze and fix the following issue in the Linux kernel code: nvmem: layouts: onie-tlv: fix hang on unknown types
Problem Details: The EEPROM on my board has a vendor specific entry of type 0x41. When stumbling upon that, this driver hangs in an endless loop. Fix it by keep incrementing the offset on unknown entries, so the loop will eventually stop. Fixes: d3c0d12f6474 ("nvmem: layouts: onie-tlv: Add new layout driver") Cc: Sta...
```diff diff --git a/drivers/nvmem/layouts/onie-tlv.c b/drivers/nvmem/layouts/onie-tlv.c index 0967a32319a2..8b0f3c1b8a0e 100644 --- a/drivers/nvmem/layouts/onie-tlv.c +++ b/drivers/nvmem/layouts/onie-tlv.c @@ -119,7 +119,7 @@ static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem, cell.name ...
b0f02608fbcd607b5131cceb91fc0a035264e61c
Analyze and fix the following issue in the Linux kernel code: netfilter: conntrack: call nf_ct_gre_keymap_destroy() if master helper is pptp
Problem Details: For GRE flows, validate that the ct master helper (if any) is pptp before calling nf_ct_gre_keymap_destroy(), so the helper data area can be accessed safely. Note that only the pptp helper provides a .destroy callback. Fixes: e56894356f60 ("netfilter: conntrack: remove l4proto destroy hook") Signed-of...
```diff diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 91255fd3b35d..4fb3a2d18631 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -562,9 +562,23 @@ static void destroy_gre_conntrack(struct nf_conn *ct) { #ifdef CONFIG_NF_CT_PROTO_GRE ...
35e21a4dccc5c255ba59ccfbfeb4629ed21da972
Analyze and fix the following issue in the Linux kernel code: netfilter: conntrack: revert ct extension genid infrastructure
Problem Details: This infrastructure is not used anymore after moving ct timeout and helper to use datapath refcount to track object use. Revert commit c56716c69ce1 ("netfilter: extensions: introduce extension genid count") this patch disables all ct extensions (leading to NULL) for unconfirmed conntracks, when this i...
```diff diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 0b247248b032..fd5c4dbf72ca 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h @@ -38,7 +38,6 @@ enum nf_ct_ext_id { struct nf_ct_ext { u8 offset...
4cc0cc0b297c17c2b106d6892bd13d9c32fe66ce
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: Add 802.3 multicast encapsulation offload support
Problem Details: mac80211 converts 802.3 multicast packets to 802.11 format before driver TX, even when Ethernet encapsulation offload is enabled. This prevents drivers that support multicast Ethernet encapsulation offload from receiving frames in native 802.3 format. Introduce the IEEE80211_OFFLOAD_ENCAP_MCAST flag t...
```diff diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 7dd558f4025b..4f95da023746 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -2014,12 +2014,16 @@ enum ieee80211_vif_flags { * @IEEE80211_OFFLOAD_DECAP_ENABLED: rx encapsulation offload is enabled * The driver supports pass...
091ab6d70dc444f56ed14faedbcacfc979f4c613
Analyze and fix the following issue in the Linux kernel code: iommufd: Avoid partial fault group delivery in iommufd_fault_fops_read()
Problem Details: The cookie returned by xa_alloc() in iommufd_fault_fops_read() is per fault group, but the inner copy_to_user() runs per fault inside the group. If a copy fails mid-group, xa_erase clears the cookie and the group is restored to the deliver list, yet done is not rolled back. The function returns the par...
```diff diff --git a/drivers/iommu/iommufd/eventq.c b/drivers/iommu/iommufd/eventq.c index 1c010e691f97..5129e3bf5461 100644 --- a/drivers/iommu/iommufd/eventq.c +++ b/drivers/iommu/iommufd/eventq.c @@ -139,6 +139,8 @@ static ssize_t iommufd_fault_fops_read(struct file *filep, char __user *buf, mutex_lock(&fault->m...
172fc8b19825a0f5884c38f2289188284e2d45ee
Analyze and fix the following issue in the Linux kernel code: iommufd: Break the loop on failure in iommufd_fault_fops_read()
Problem Details: On a copy_to_user() failure inside the inner list_for_each_entry, only the inner loop breaks; the outer while re-fetches the just-restored fault group and retries the failing copy_to_user() forever, spinning the reader at 100% CPU with fault->mutex held. Check rc after the inner loop and break the out...
```diff diff --git a/drivers/iommu/iommufd/eventq.c b/drivers/iommu/iommufd/eventq.c index 613024ca8f1f..1c010e691f97 100644 --- a/drivers/iommu/iommufd/eventq.c +++ b/drivers/iommu/iommufd/eventq.c @@ -168,6 +168,8 @@ static ssize_t iommufd_fault_fops_read(struct file *filep, char __user *buf, } done += fault_...
47916a54eeb2a9e654512ee609f71bd5b29db702
Analyze and fix the following issue in the Linux kernel code: iommufd: Reject invalid read count in iommufd_fault_fops_read()
Problem Details: The read count must be large enough to hold one fault or a group's faults. iommufd_fault_fops_read() does not validate the count, but returns 0 as if the read had succeeded while leaving the pending fault in the queue. Return -EINVAL in the undersize cases. Fixes: 07838f7fd529 ("iommufd: Add iommufd...
```diff diff --git a/drivers/iommu/iommufd/eventq.c b/drivers/iommu/iommufd/eventq.c index f55d173c59f6..613024ca8f1f 100644 --- a/drivers/iommu/iommufd/eventq.c +++ b/drivers/iommu/iommufd/eventq.c @@ -142,6 +142,9 @@ static ssize_t iommufd_fault_fops_read(struct file *filep, char __user *buf, if (done >= count || ...
489e63dd120bad52eba63f5506c214750cd5bc75
Analyze and fix the following issue in the Linux kernel code: iommufd: Propagate allocation failure in iommufd_veventq_deliver_fetch()
Problem Details: When the kzalloc_obj() fails in iommufd_veventq_deliver_fetch(), it returns NULL, falsely advertising to userspace that the queue is empty. Propagate the -ENOMEM properly to the caller. Fixes: e36ba5ab808e ("iommufd: Add IOMMUFD_OBJ_VEVENTQ and IOMMUFD_CMD_VEVENTQ_ALLOC") Link: https://patch.msgid.li...
```diff diff --git a/drivers/iommu/iommufd/eventq.c b/drivers/iommu/iommufd/eventq.c index ac485d010a43..f55d173c59f6 100644 --- a/drivers/iommu/iommufd/eventq.c +++ b/drivers/iommu/iommufd/eventq.c @@ -264,8 +264,10 @@ iommufd_veventq_deliver_fetch(struct iommufd_veventq *veventq) /* Make a copy of the lost_events_...
00203ca8323f9714630408c19a209b52397975e6
Analyze and fix the following issue in the Linux kernel code: iommufd: Reject invalid read count in iommufd_veventq_fops_read()
Problem Details: The read count must be large enough to hold a vEVENT header. For a normal vEVENT, it must also hold the trailing data following the header. iommufd_veventq_fops_read() does not validate the count, but returns 0 as if the read had succeeded while leaving the pending event in the queue. Return -EINVAL ...
```diff diff --git a/drivers/iommu/iommufd/eventq.c b/drivers/iommu/iommufd/eventq.c index 896f45be0d2e..ac485d010a43 100644 --- a/drivers/iommu/iommufd/eventq.c +++ b/drivers/iommu/iommufd/eventq.c @@ -310,6 +310,9 @@ static ssize_t iommufd_veventq_fops_read(struct file *filep, char __user *buf, if (*ppos) retu...
01e41ad76c12ae5c49ab4ef4fc7dd54e9b8784d6
Analyze and fix the following issue in the Linux kernel code: iommufd: Rewind header length in done if iommufd_veventq_fops_read() fails
Problem Details: When the first event copy fails, rc = -EFAULT will not be reported as done is set to the length of the copied header. Rewind it to report rc correctly. Fixes: e36ba5ab808e ("iommufd: Add IOMMUFD_OBJ_VEVENTQ and IOMMUFD_CMD_VEVENTQ_ALLOC") Link: https://patch.msgid.link/r/78f8caeb6a5d667a26b870e3068ce...
```diff diff --git a/drivers/iommu/iommufd/eventq.c b/drivers/iommu/iommufd/eventq.c index 1f1e415285b1..896f45be0d2e 100644 --- a/drivers/iommu/iommufd/eventq.c +++ b/drivers/iommu/iommufd/eventq.c @@ -336,6 +336,7 @@ static ssize_t iommufd_veventq_fops_read(struct file *filep, char __user *buf, if (cur->data_len &...
a5f28da54f36f1a8b289d9bdd3e780b2ede0da6f
Analyze and fix the following issue in the Linux kernel code: x86/cpu: Remove obsolete aperfmperf_get_khz() declaration
Problem Details: aperfmperf_get_khz() was replaced by arch_freq_get_on_cpu(). The remaining declaration in the header file is no longer used and should be removed. Fixes: f3eca381bd49 ("x86/aperfmperf: Replace arch_freq_get_on_cpu()") Signed-off-by: Junxiao Chang <junxiao.chang@intel.com> Signed-off-by: Ingo Molnar <m...
```diff diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h index 5c7a3a71191a..dca2d5845e42 100644 --- a/arch/x86/kernel/cpu/cpu.h +++ b/arch/x86/kernel/cpu/cpu.h @@ -75,7 +75,6 @@ static inline struct amd_northbridge *amd_init_l3_cache(int index) } #endif -unsigned int aperfmperf_get_khz(int cpu); ...
17f073f78fc43280891ecde8f8ec3f84f98bb37c
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Correctly identify executable PTEs at stage-2
Problem Details: KVM invalidates the I-cache before installing an executable PTE on implementations without DIC. Unfortunately, support for FEAT_XNX broke this check as KVM_PTE_LEAF_ATTR_HI_S2_XN was expanded to a bitfield. Fix it by reusing kvm_pgtable_stage2_pte_prot() and testing the abstract permission bits instea...
```diff diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c index 0c1defa5fb0f..91a7dfad6686 100644 --- a/arch/arm64/kvm/hyp/pgtable.c +++ b/arch/arm64/kvm/hyp/pgtable.c @@ -925,7 +925,9 @@ static bool stage2_pte_cacheable(struct kvm_pgtable *pgt, kvm_pte_t pte) static bool stage2_pte_executable...
49b32ddb87a3a109afecea89e55d70f73956b8bc
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: nv: Fix handling of XN[0] when !FEAT_XNX
Problem Details: XN has already been extracted from its bitfield position so using FIELD_PREP() on the mask that clears XN[0] is completely broken, having the effect of unconditionally granting execute permissions... Fix the obvious mistake by manipulating the right bit. Cc: stable@vger.kernel.org Fixes: d93febe2ed2e...
```diff diff --git a/arch/arm64/include/asm/kvm_nested.h b/arch/arm64/include/asm/kvm_nested.h index dc2957662ff2..cdf3e8422ea1 100644 --- a/arch/arm64/include/asm/kvm_nested.h +++ b/arch/arm64/include/asm/kvm_nested.h @@ -132,7 +132,7 @@ static inline bool kvm_s2_trans_exec_el0(struct kvm *kvm, struct kvm_s2_trans *t ...
6f9b73071c15001530e6697491b6db1bf639f4c7
Analyze and fix the following issue in the Linux kernel code: pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup
Problem Details: The cycle register is always u32, so cycles_to_ns() can take a u32 instead of a u64. With that narrowing, cycles * NSEC_PER_SEC is at most u32::MAX * 1e9 (~4.3e18), which fits in u64 without overflow. The saturating arithmetic is therefore no longer needed, and the ceiling division can use Rust's u64::...
```diff diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs index ddd44a5ce497..933c1ec59c2a 100644 --- a/drivers/pwm/pwm_th1520.rs +++ b/drivers/pwm/pwm_th1520.rs @@ -67,16 +67,10 @@ fn ns_to_cycles(ns: u64, rate_hz: u64) -> u64 { ns.saturating_mul(rate_hz) / NSEC_PER_SEC_U64 } -fn cycles_to_ns(...
19b206b9534a85266efa78febeb4ae185e75bccd
Analyze and fix the following issue in the Linux kernel code: mm/slub: preserve original size in _kmalloc_nolock_noprof retry path
Problem Details: _kmalloc_nolock_noprof() retries from the next kmalloc bucket when the initial allocation fails. The retry currently reuses `size` as the bucket selector and overwrites it with s->object_size + 1. That value is later passed as the original allocation size to __slab_alloc_node(), slab_post_alloc_hook()...
```diff diff --git a/mm/slub.c b/mm/slub.c index 492128ae3af9..ff83345d7f95 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -5359,6 +5359,7 @@ EXPORT_SYMBOL(__kmalloc_noprof); void *kmalloc_nolock_noprof(size_t size, gfp_t gfp_flags, int node) { gfp_t alloc_gfp = __GFP_NOWARN | __GFP_NOMEMALLOC | gfp_flags; + size_t orig...
265b861bece38318b8e0fc8fac0643d4ef906d31
Analyze and fix the following issue in the Linux kernel code: crypto: chacha20poly1305 - validate poly1305 template argument
Problem Details: chachapoly_create() still accepts the compatibility poly1305 parameter in the template name, but it assumes the second template argument is always present and immediately passes it to strcmp(). When the argument is missing, crypto_attr_alg_name() returns an error pointer. Check for that before compari...
```diff diff --git a/crypto/chacha20poly1305.c b/crypto/chacha20poly1305.c index b4b5a7198d84..27df9e1eb058 100644 --- a/crypto/chacha20poly1305.c +++ b/crypto/chacha20poly1305.c @@ -375,6 +375,7 @@ static int chachapoly_create(struct crypto_template *tmpl, struct rtattr **tb, struct aead_instance *inst; struct cha...
ed459fe319376e876de433d12b6c6772e612ca36
Analyze and fix the following issue in the Linux kernel code: crypto: pcrypt - restore callback for non-parallel fallback
Problem Details: pcrypt installs pcrypt_aead_done() on the child AEAD request before trying to submit it through padata. If padata_do_parallel() returns -EBUSY, pcrypt falls back to calling the child AEAD directly. That fallback must not keep the padata completion callback. Otherwise an asynchronous completion runs ...
```diff diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c index ed0feaba2383..9f372442981e 100644 --- a/crypto/pcrypt.c +++ b/crypto/pcrypt.c @@ -122,6 +122,8 @@ static int pcrypt_aead_encrypt(struct aead_request *req) return -EINPROGRESS; if (err == -EBUSY) { /* try non-parallel mode */ + aead_request_set_callba...
4e67f504ee9ded15e256b64f4fde150e917381d7
Analyze and fix the following issue in the Linux kernel code: crypto: nx - fix nx_crypto_ctx_exit argument
Problem Details: nx_crypto_ctx_shash_exit calls nx_crypto_ctx_exit with crypto_shash_ctx(...) but crypto_shash_ctx gives a nx_crypto_ctx *, not a crypto_tfm *. Fix the type in nx_crypto_ctx_exit and drop the bogus crypto_tfm_ctx call. This fixes the following oops: BUG: Unable to handle kernel data access at 0xc04...
```diff diff --git a/drivers/crypto/nx/nx.c b/drivers/crypto/nx/nx.c index 78135fb13f5c..1b7509e2ce44 100644 --- a/drivers/crypto/nx/nx.c +++ b/drivers/crypto/nx/nx.c @@ -714,15 +714,13 @@ int nx_crypto_ctx_aes_xcbc_init(struct crypto_shash *tfm) /** * nx_crypto_ctx_exit - destroy a crypto api context * - * @tfm: ...
ed46f39c47eb5530a9c161481a2080d3a869cfaf
Analyze and fix the following issue in the Linux kernel code: io_uring/net: inherit IORING_CQE_F_BUF_MORE across bundle recv retries
Problem Details: When a bundle recv retries inside io_recv_finish(), the merge logic OR the saved cflags from the previous iteration with the cflags returned by the new iteration: cflags = req->cqe.flags | (cflags & CQE_F_MASK); Bits listed in CQE_F_MASK are inherited from the new iteration, and all other bits (nota...
```diff diff --git a/io_uring/net.c b/io_uring/net.c index 8df15b639358..ee848eb65ec9 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -842,7 +842,8 @@ int io_recvmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) } /* bits to clear in old and inherit in new cflags on bundle retry */ -#define CQE_F_M...
c381039ade2e161ab08c0eda73c4f8b9a7115928
Analyze and fix the following issue in the Linux kernel code: xfrm: espintcp: do not reuse an in-progress partial send
Problem Details: espintcp keeps a single in-flight transmit in ctx->partial. Before building a new sk_msg, espintcp_sendmsg() first tries to flush that state through espintcp_push_msgs(). For blocking callers, espintcp_push_msgs() may return success even when the previous partial send is still pending. espintcp_sendms...
```diff diff --git a/net/xfrm/espintcp.c b/net/xfrm/espintcp.c index a2756186e13a..d9035546375e 100644 --- a/net/xfrm/espintcp.c +++ b/net/xfrm/espintcp.c @@ -346,6 +346,10 @@ static int espintcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) err = -ENOBUFS; goto unlock; } + if (emsg->len) { + err ...
2b5632d72fca0841bea283da2e3a478d24118508
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: qcom: Initialize offload control return value
Problem Details: snd_usb_offload_create_ctl() returns ret after walking the USB PCM list, but ret is only assigned after a playback stream passes the endpoint and PCM-index filters. If all playback streams are skipped, for example because there is no playback endpoint or because all PCM indexes exceed the 0xff control...
```diff diff --git a/sound/usb/qcom/mixer_usb_offload.c b/sound/usb/qcom/mixer_usb_offload.c index 48e55d5872d5..b1591361e76c 100644 --- a/sound/usb/qcom/mixer_usb_offload.c +++ b/sound/usb/qcom/mixer_usb_offload.c @@ -113,7 +113,7 @@ int snd_usb_offload_create_ctl(struct snd_usb_audio *chip, struct device *bedev) st...
7d6a9cdb8d3a51d9cfe546a09a518ab3d2671549
Analyze and fix the following issue in the Linux kernel code: netfilter: cttimeout: detach dataplane timeout policy and repurpose refcount
Problem Details: Add a refcount for struct nf_ct_timeout which is used by ct extension to set the custom ct timeout policy, this tells us that the ct timeout is being used by a conntrack entry. When the last conntrack entry drops the refcount on the ct timeout, the ct timeout is released. Remove the refcount for contr...
```diff diff --git a/include/net/netfilter/nf_conntrack_timeout.h b/include/net/netfilter/nf_conntrack_timeout.h index 3a66d4abb6d6..d60aa86be019 100644 --- a/include/net/netfilter/nf_conntrack_timeout.h +++ b/include/net/netfilter/nf_conntrack_timeout.h @@ -12,6 +12,7 @@ #define CTNL_TIMEOUT_NAME_MAX 32 struct nf_...
9e37388b8070afe73d4ab2d973b28593ed65f3ad
Analyze and fix the following issue in the Linux kernel code: netfilter: synproxy: protect nf_ct_seqadj_init() with conntrack lock
Problem Details: nf_ct_seqadj_init() is called without holding the ct lock. This can race with nf_ct_seq_adjust() when a connection is in CLOSE state due to an RST or connection reopening. In addition for SYN_RECV state, concurrent processing of packets can trigger nf_ct_seq_adjust() too. These situations create a read...
```diff diff --git a/net/netfilter/nf_conntrack_seqadj.c b/net/netfilter/nf_conntrack_seqadj.c index 7ab2b25b57bc..b7e99f34dfce 100644 --- a/net/netfilter/nf_conntrack_seqadj.c +++ b/net/netfilter/nf_conntrack_seqadj.c @@ -17,12 +17,14 @@ int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo, if (of...
992c20bc8a4aba220c8b95b467d049289778dad6
Analyze and fix the following issue in the Linux kernel code: netfilter: synproxy: fix unaligned memory access in timestamp adjustment
Problem Details: Use get_unaligned_be32() and put_unaligned_be32() to safely read and write the timestamp fields. This prevents performance degradation due to unaligned memory access or even a crash on strict alignment architectures. This follows the implementation of timestamp parsing in the networking stack at tcp_p...
```diff diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c index a0bcf188810d..acd360515972 100644 --- a/net/netfilter/nf_synproxy_core.c +++ b/net/netfilter/nf_synproxy_core.c @@ -191,7 +191,7 @@ synproxy_tstamp_adjust(struct sk_buff *skb, unsigned int protoff, const struct nf_c...
22bb132cfb9b94847d52d73614284b8c5ea8d36e
Analyze and fix the following issue in the Linux kernel code: netfilter: synproxy: adjust duplicate timestamp options
Problem Details: RFC 9293 does not mention anything about duplicated options and each networking stack handles it in their own way. Currently, Linux kernel is processing options sequentially and in case of duplicated timestamp options, the value from the latest one overrides the others. As SYNPROXY is modifying only t...
```diff diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c index f99c22f57b7e..a0bcf188810d 100644 --- a/net/netfilter/nf_synproxy_core.c +++ b/net/netfilter/nf_synproxy_core.c @@ -233,7 +233,6 @@ synproxy_tstamp_adjust(struct sk_buff *skb, unsigned int protoff, } inet_proto_csum...
63d29ee95c4ab5976d660182d2e4733bb4a091d8
Analyze and fix the following issue in the Linux kernel code: netfilter: synproxy: drop packets if timestamp adjustment fails
Problem Details: If a packet was malformed or if skb_ensure_writable() failed, the synproxy_tstamp_adjust() function returned 0 indicating an error but it was ignored on the callers. Make the function return a boolean instead to clarify the result and drop the packet if synproxy_tstamp_adjust() failed due to ENOMEM fr...
```diff diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c index ed00114f65f3..f99c22f57b7e 100644 --- a/net/netfilter/nf_synproxy_core.c +++ b/net/netfilter/nf_synproxy_core.c @@ -184,7 +184,7 @@ synproxy_check_timestamp_cookie(struct synproxy_options *opts) opts->options |= opts->tsecr...
f8bf5edf7157984bb8e288c8b04fdb041223b80c
Analyze and fix the following issue in the Linux kernel code: netfilter: nfnetlink_cthelper: use {READ,WRITE}_ONCE for accessing helper flags
Problem Details: Conntrack helper flags are accessed from packet and netlink dump path. Concurrent update of userspace helper flags is not possible, because the nfnl_mutex in held on updates. These flags are only used by userspace helpers. Use {READ,WRITE}_ONCE() to access this flags from lockless paths. Fixes: 12f7a5...
```diff diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index b521b5ebd664..c072a14a306a 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -2213,6 +2213,7 @@ static int nf_confirm_cthelper(struct sk_buff *skb, struct nf_conn *ct, { const stru...
a625c94144c9b66d32e1f374f909f38db46161c1
Analyze and fix the following issue in the Linux kernel code: netfilter: nfnetlink_osf: fix mss parsing on big-endian architectures
Problem Details: The MSS calculation in nf_osf_match_one() manually shifts bytes to construct a 16-bit value before passing it to ntohs(). This works on little-endian hosts but it does not work on big-endian as the bytes are being always shifted and set in the same way for all architectures. Use get_unaligned_be16() ...
```diff diff --git a/net/netfilter/nfnetlink_osf.c b/net/netfilter/nfnetlink_osf.c index acb753ec5697..92002079f8ea 100644 --- a/net/netfilter/nfnetlink_osf.c +++ b/net/netfilter/nfnetlink_osf.c @@ -95,11 +95,7 @@ static bool nf_osf_match_one(const struct sk_buff *skb, switch (*optp) { case OSFOPT_MSS: - m...
4a15044a2b06748c99a8c8c3c6b3ee0a01f8004d
Analyze and fix the following issue in the Linux kernel code: ipvs: add conn_max sysctl to limit connections
Problem Details: Currently, we are using atomic_t to track the number of connections. On 64-bit setups with large memory there is a risk this counter to overflow. Also, setups with many containers may need to tune the limit for connections. Add sysctl control to limit the number of connections to 1,073,741,824 (64-bit...
```diff diff --git a/Documentation/networking/ipvs-sysctl.rst b/Documentation/networking/ipvs-sysctl.rst index a556439f8be7..b6bac2612420 100644 --- a/Documentation/networking/ipvs-sysctl.rst +++ b/Documentation/networking/ipvs-sysctl.rst @@ -56,6 +56,41 @@ conn_lfactor - INTEGER -4: grow if load goes above 6% (bucke...
c8a8a75b733467b00c08b91a38dbaf207a08ed6e
Analyze and fix the following issue in the Linux kernel code: xfrm: iptfs: fix ABBA deadlock in iptfs_destroy_state()
Problem Details: iptfs_destroy_state() calls hrtimer_cancel() while holding a spinlock that the timer callback also acquires, leading to an ABBA deadlock on SMP systems. For the output timer (iptfs_timer): - iptfs_destroy_state() holds x->lock, calls hrtimer_cancel() - iptfs_delay_timer() callback takes x->lock F...
```diff diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c index aea63a000d1d..ad810d1f97c0 100644 --- a/net/xfrm/xfrm_iptfs.c +++ b/net/xfrm/xfrm_iptfs.c @@ -2730,8 +2730,9 @@ static void iptfs_destroy_state(struct xfrm_state *x) if (!xtfs) return; - spin_lock_bh(&xtfs->x->lock); hrtimer_cancel(&xtfs-...
70543358fa08e0f7cebc3447c3b70fe97ad7aaa8
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Reassign nested_mmus array behind mmu_lock
Problem Details: kvm->arch.nested_mmus[] is walked under kvm->mmu_lock, including from the MMU notifier path (kvm_unmap_gfn_range() -> kvm_nested_s2_unmap()), which can run at any time. kvm_vcpu_init_nested() reallocates the array and frees the old buffer while holding only kvm->arch.config_lock, so such a walker can r...
```diff diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c index 38f672e94087..6f7bc9a9992e 100644 --- a/arch/arm64/kvm/nested.c +++ b/arch/arm64/kvm/nested.c @@ -89,21 +89,28 @@ int kvm_vcpu_init_nested(struct kvm_vcpu *vcpu) * again, and there is no reason to affect the whole VM for this. */ num_m...
2986a625740599fe6e7635b0586fed2a95bcd1f7
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Omit tag sync on stage-2 mappings of the zero page
Problem Details: Commit f620d66af316 ("arm64: mte: Do not flag the zero page as PG_mte_tagged") removed the PG_mte_tagged flag from the zero page, but missed a KVM code path that may set this flag on the zero page when it is used in a stage-2 CoW mapping of anonymous memory. So disregard the zero page explicitly ...
```diff diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index d089c107d9b7..445d6cf035c9 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -1479,6 +1479,11 @@ static void sanitise_mte_tags(struct kvm *kvm, kvm_pfn_t pfn, if (!kvm_has_mte(kvm)) return; + if (is_zero_pfn(pfn)) { + WARN_ON_O...
14270179806b876fecefcbf35905e512b56a5867
Analyze and fix the following issue in the Linux kernel code: pinctrl: renesas: rzg2l: Use raw_spinlock_irqsave() on power source update
Problem Details: The rest of the driver uses raw_spin_lock_irqsave() and raw_spin_unlock_irqrestore() for locking. To avoid concurrency issues or deadlocks, use raw_spinlock_irqsave() via the scoped_guard() helper for power source updates as well. Fixes: bbe2277dedbe ("pinctrl: renesas: rzg2l: Add support for selecti...
```diff diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c index 83c61dcb24b1..be52d47d77ae 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -1137,7 +1137,7 @@ static int rzg2l_set_power_source(struct rzg2l_pinctrl *pctrl, ...
f2ca45b50d4216c9cc7ffabf50d9ad1932209251
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Take the SRCU lock for page table walks in fault injection and AT emulation
Problem Details: walk_s1() and kvm_walk_nested_s2() expect to be called while holding kvm->srcu to guard against memslot changes. While this is generally the case, __kvm_at_s12() and __kvm_find_s1_desc_level() call into the respective walkers without taking kvm->srcu. Fix by acquiring kvm->srcu prior to the table walk...
```diff diff --git a/arch/arm64/kvm/at.c b/arch/arm64/kvm/at.c index 9f8f0ae8e86e..889c2c15d7bd 100644 --- a/arch/arm64/kvm/at.c +++ b/arch/arm64/kvm/at.c @@ -1569,7 +1569,8 @@ int __kvm_at_s12(struct kvm_vcpu *vcpu, u32 op, u64 vaddr) /* Do the stage-2 translation */ ipa = (par & GENMASK_ULL(47, 12)) | (vaddr & GE...
13031fb6b8357fbbcded2a7f4cba73e4781ee594
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic-its: Drop the translation cache reference only for the erased entry
Problem Details: vgic_its_invalidate_cache() walks the per-ITS translation cache with xa_for_each() and drops the cache's reference on each entry with vgic_put_irq(). It puts the iterated pointer, though, rather than the value returned by xa_erase(). The function is called from contexts that do not exclude one another...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c index 1d7e5d560af4..1e3706ac3b8e 100644 --- a/arch/arm64/kvm/vgic/vgic-its.c +++ b/arch/arm64/kvm/vgic/vgic-its.c @@ -597,8 +597,10 @@ static void vgic_its_invalidate_cache(struct vgic_its *its) unsigned long idx; xa_for_each(&it...
167883f75f83088a2b32c85ce5e3d0cd1cef157b
Analyze and fix the following issue in the Linux kernel code: irqchip/irq-realtek-rtl: Add/simplify register helpers
Problem Details: The Realtek interrupt controller has two important registers that are used by the driver in several places - GIMR: global interrupt mask register - IRR: Interrupt routing registers The usage of these registers is very inconsistent. GIMR is addressed directly while IRR has a helper that needs a macr...
```diff diff --git a/drivers/irqchip/irq-realtek-rtl.c b/drivers/irqchip/irq-realtek-rtl.c index 942c1f8c363d..f490fb867ded 100644 --- a/drivers/irqchip/irq-realtek-rtl.c +++ b/drivers/irqchip/irq-realtek-rtl.c @@ -37,10 +37,29 @@ static void __iomem *realtek_ictl_base; #define IRR_OFFSET(idx) (4 * (3 - (idx * 4) / 3...
6f6947b2387e94e405f80d472f8a189bfbf2bd6c
Analyze and fix the following issue in the Linux kernel code: x86/resctrl: Only check Intel systems for SNC
Problem Details: topology_num_nodes_per_package() reports values greater than one on certain AMD systems resulting in resctrl's Intel model specific SNC detection printing the confusing message: "CoD enabled system? Resctrl not supported" Add a check for Intel systems before looking at the topology. [ reinette: A...
```diff diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c index 9bd87bae4983..59215fef3924 100644 --- a/arch/x86/kernel/cpu/resctrl/monitor.c +++ b/arch/x86/kernel/cpu/resctrl/monitor.c @@ -377,7 +377,12 @@ static const struct x86_cpu_id snc_cpu_ids[] __initconst = { static _...
2b5ff4db5d7aa5b981d966df02e687f79ad7b311
Analyze and fix the following issue in the Linux kernel code: ALSA: seq: dummy: fix UMP event stack overread
Problem Details: The dummy sequencer port forwards events by copying an incoming struct snd_seq_event into a stack temporary, rewriting source and destination, and dispatching the temporary to subscribers. That legacy event storage is smaller than struct snd_seq_ump_event. When a UMP event reaches the dummy client, th...
```diff diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c index af45f328ae99..8abe80985dad 100644 --- a/sound/core/seq/seq_dummy.c +++ b/sound/core/seq/seq_dummy.c @@ -9,6 +9,7 @@ #include <linux/module.h> #include <sound/core.h> #include "seq_clientmgr.h" +#include "seq_memory.h" #include <sound...
6255da28d4bb5349fe18e84cb043ccd394eba75d
Analyze and fix the following issue in the Linux kernel code: proc: protect ptrace_may_access() with exec_update_lock (FD links)
Problem Details: proc_pid_get_link() and proc_pid_readlink() currently look up the task from the pid once, then do the ptrace access check on that task, then look up the task from the pid a second time to do the actual access. That's racy in several ways. To fix it, pass the task to the ->proc_get_link() handler, and ...
```diff diff --git a/fs/proc/base.c b/fs/proc/base.c index cc99d953a0a3..5042f14d24f3 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -218,33 +218,24 @@ static int get_task_root(struct task_struct *task, struct path *root) return result; } -static int proc_cwd_link(struct dentry *dentry, struct path *path) +st...
6650527444dadc63d84aa939d14ecba4fadb2f69
Analyze and fix the following issue in the Linux kernel code: proc: protect ptrace_may_access() with exec_update_lock (part 1)
Problem Details: Fix the easy cases where procfs currently calls ptrace_may_access() without exec_update_lock protection, where the fix is to simply add the extra lock or use mm_access(): - do_task_stat(): grab exec_update_lock - proc_pid_wchan(): grab exec_update_lock - proc_map_files_lookup(): use mm_access() ins...
```diff diff --git a/fs/proc/array.c b/fs/proc/array.c index 90fb0c6b5f99..479ea8cb4ef4 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -482,6 +482,11 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, unsigned long flags; int exit_code = task->exit_code; struct signal_struct *sig = ta...
b978c424cbfb1f5ab024db12cf7b813fa4e23ca0
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: fold tid_ampdu_rx allocations into a flexible array
Problem Details: Convert the separately-allocated reorder_buf pointer to a C99 flexible array member at the end of struct tid_ampdu_rx, with both the sk_buff_head and the jiffies timestamp in each array element. This collapses three allocations into one and removes the corresponding kfree() pairs from the error and fre...
```diff diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index 0140ac826b23..9629e00069a1 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c @@ -49,9 +49,7 @@ static void ieee80211_free_tid_rx(struct rcu_head *h) int i; for (i = 0; i < tid_rx->buf_size; i++) - __skb_queue_purge(&tid_rx->reo...
c52b14422573a43917f48c094771a80cbe58f568
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: Fix -Wc23-extensions in hwmp_route_info_get()
Problem Details: When building with a version of clang that supports '-fms-anonymous-structs' (which will be used by the kernel instead of the wider '-fms-extensions'), there are a couple warnings after some recent mesg_hwmp.c changes: net/mac80211/mesh_hwmp.c:373:3: error: label followed by a declaration is a C23 e...
```diff diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 84903737271d..7f962b003579 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -369,7 +369,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, fresh_info = true; switch (action) { - case MPATH_P...
06cb687a5132fcffe624c0070576ab852ac6b568
Analyze and fix the following issue in the Linux kernel code: media: v4l2-fwnode: Fix subdev owner overwritten in v4l2_async_register_subdev_sensor()
Problem Details: The v4l2 helper v4l2_async_register_subdev_sensor() calls v4l2_async_register_subdev(), which is a macro that expands to __v4l2_async_register_subdev(sd,THIS_MODULE). Since the macro is expanded inside v4l2-fwnode.c, THIS_MODULE resolves to the v4l2-fwnode module rather than the sensor driver module th...
```diff diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index 77f3298821b5..62a3a452f788 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -1256,7 +1256,7 @@ v4l2_async_nf_parse_fwnode_sensor(struct device *dev, return 0; } ...
1e2fa2b10c234578d3c98c70f89c04a7aba4db92
Analyze and fix the following issue in the Linux kernel code: batman-adv: fix kernel-doc typos and grammar errors
Problem Details: Various minor errors were gathered over the time in batman-adv's kernel-doc comments. Get rid of many of them before they are copied (again) to new functions. Signed-off-by: Sven Eckelmann <sven@narfation.org>
```diff diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c index cb081038d14f..fe7c0113d0df 100644 --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@ -587,7 +587,7 @@ next: } /** - * batadv_v_gw_is_eligible() - check if a originator would be selected as GW + * batadv_v_gw_is_eligible() - check i...
7b915cd40bb2786122d5e336d7bdf46e5d94af70
Analyze and fix the following issue in the Linux kernel code: batman-adv: fix batadv_v_ogm_packet_recv error handling kernel-doc
Problem Details: All receive handlers in batman-adv are consuming the skbuff independent of the result of the handler. The "(without freeing the skb) on failure" is therefore not corrrect anymore for the current implementation. Signed-off-by: Sven Eckelmann <sven@narfation.org>
```diff diff --git a/net/batman-adv/bat_v_ogm.c b/net/batman-adv/bat_v_ogm.c index 72ae8ffc9db6..14920f4bb315 100644 --- a/net/batman-adv/bat_v_ogm.c +++ b/net/batman-adv/bat_v_ogm.c @@ -984,7 +984,7 @@ out: * @if_incoming: the interface where this OGM has been received * * Return: NET_RX_SUCCESS and consume the ...
219b4c46db7fe9627c3ab30e0cfe1a79ca808995
Analyze and fix the following issue in the Linux kernel code: batman-adv: bla: update stale kernel-doc
Problem Details: The bridge-loop-avoidance code was changed recently to avoid inconsistent state and race condition problems. The kernel-doc addded in these commits (and related code) has various minor deficits which are now resolved. Signed-off-by: Sven Eckelmann <sven@narfation.org>
```diff diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 0bd24a19ff20..5c73f6ba16cf 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c @@ -123,7 +123,7 @@ static bool batadv_compare_backbone_gw(const struct hlist_node *node,...
811cb00fa8cdc3f0a7f6eefc000a6888367c8c8f
Analyze and fix the following issue in the Linux kernel code: batman-adv: tp_meter: initialize last_recv_time during init
Problem Details: The last_recv_time is the most important indicator for a receiver session to figure out whether a session timed out or not. But this information was only initialized after the session was added to the tp_receiver_list and after the timer was started. In the worst case, the timer (function) could have ...
```diff diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index 978e32d94e6c..cc72468ca2ab 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -1511,8 +1511,10 @@ batadv_tp_init_recv(struct batadv_priv *bat_priv, tp_vars = batadv_tp_list_find_receiver_session(bat_priv, icmp->o...
1a967a7ec70ff951716e84739f79b6e167ac1e0b
Analyze and fix the following issue in the Linux kernel code: fix a race between d_find_any_alias() and final dput() of NORCU dentries
Problem Details: Refcount of a NORCU dentry must not be incremented after having dropped to zero. Otherwise we might end up with the following race: CPU1: in fast_dput(d), rcu_read_lock(); CPU1: decrements refcount of d to 0 CPU1: notice that it's unhashed CPU2: grab a reference to d CPU2: dput(d), freeing d CPU...
```diff diff --git a/fs/dcache.c b/fs/dcache.c index 0aff2c510beb..fa12e18906b9 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1052,7 +1052,10 @@ repeat: } EXPORT_SYMBOL(dget_parent); -static struct dentry * __d_find_any_alias(struct inode *inode) +/* + * inode is a directory, inode->i_lock is held by the caller + ...
c0837b9cf6eabbad8b8cbddaff1a46a6d0a2e29d
Analyze and fix the following issue in the Linux kernel code: accel/ethosu: fix OOB write in ethosu_gem_cmdstream_copy_and_validate()
Problem Details: The command stream parsing loop increments the index variable a second time when a 64-bit command word is encountered (bit 14 set), but does not re-check the loop bound before writing the second word: for (i = 0; i < size / 4; i++) { bocmds[i] = cmds[0]; if (cmd & 0x4000) { ...
```diff diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c index 2cb7964ddfa5..3401883e207f 100644 --- a/drivers/accel/ethosu/ethosu_gem.c +++ b/drivers/accel/ethosu/ethosu_gem.c @@ -401,6 +401,8 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev, return -E...
4aacf509e537a711fa71bca9f234e5eb6968850e
Analyze and fix the following issue in the Linux kernel code: net: mv643xx: fix OF node refcount
Problem Details: Platform devices created with platform_device_alloc() call platform_device_release() when the last reference to the device's kobject is dropped. This function calls of_node_put() unconditionally. This works fine for devices created with platform_device_register_full() but users of the split approach (p...
```diff diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index f9055b3d6fb1..1881583be5ce 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -2780,7 +2780,7 @@ static int mv643xx_eth_shared_of_add_port(struct pl...
f3c496105472f353ff7428569ea4b6a6a61caf8e
Analyze and fix the following issue in the Linux kernel code: rtnetlink: use dev_isalive() in rtnl_getlink()
Problem Details: rtnl_getlink() uses an RCU lookup to get the netdevice pointer. When/If rtnl_lock() is used, we should check if the netdevice is not being dismantled before potentially perform illegal actions. Move dev_isalive() out of net/core/net-sysfs.c and make it available in net/core/dev.h. Return -ENODEV if ...
```diff diff --git a/net/core/dev.h b/net/core/dev.h index 0cf24b8f5008..9e9431440869 100644 --- a/net/core/dev.h +++ b/net/core/dev.h @@ -396,4 +396,10 @@ int dev_get_hwtstamp_phylib(struct net_device *dev, struct kernel_hwtstamp_config *cfg); int net_hwtstamp_validate(const struct kernel_hwtstamp_config *cfg...
32594b09854970d7ba83eb2dc8c69a2edd158c8e
Analyze and fix the following issue in the Linux kernel code: inet: frags: fix use-after-free caused by the fqdir_pre_exit() flush
Problem Details: On netns teardown, fqdir_pre_exit() walks the fqdir rhashtable and flushes every fragment queue that is not yet complete using inet_frag_queue_flush(). That helper frees all the skbs queued on the fragment queue but does not set INET_FRAG_COMPLETE, and leaves q->fragments_tail and q->last_run_head poin...
```diff diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 393770920abd..1127519b8416 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c @@ -328,6 +328,9 @@ void inet_frag_queue_flush(struct inet_frag_queue *q, reason = reason ?: SKB_DROP_REASON_FRAG_REASM_TIMEOUT; sum = inet_f...
26aa60e0276272ae61b843a05a91748dcb1130f9
Analyze and fix the following issue in the Linux kernel code: cxl/pci: Convert PCIBIOS errors to errno on DVSEC config accesses
Problem Details: PCI config space accessors return positive PCIBIOS_* status codes on failure that are positive integers. Several DVSEC accesses in the CXL core propagated these raw values to callers that test for failure against less than 0. Thus silently misinterpret the return value as success. Convert the positive...
```diff diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c index 43885c59a7f2..e4338fd7e01b 100644 --- a/drivers/cxl/core/pci.c +++ b/drivers/cxl/core/pci.c @@ -89,7 +89,7 @@ static int cxl_dvsec_mem_range_valid(struct cxl_dev_state *cxlds, int id) d + PCI_DVSEC_CXL_RANGE_SIZE_LOW(id), &temp...