id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
ec7ca73144e9ca98ed278523b9bf30e1c775c0a9
Analyze and fix the following issue in the Linux kernel code: iommu/io-pgtable-arm: Remove unused macro iopte_prot
Problem Details: Commit 33729a5fc0ca ("iommu/io-pgtable-arm: Remove split on unmap behavior") removed the last user of the macro iopte_prot. Remove the macro definition of iopte_prot as well as three other related definitions. Fixes: 33729a5fc0ca ("iommu/io-pgtable-arm: Remove split on unmap behavior") Signed-off-by: ...
```diff diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 96425e92f313..7e8e2216c294 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -85,11 +85,6 @@ #define ARM_LPAE_PTE_NS (((arm_lpae_iopte)1) << 5) #define ARM_LPAE_PTE_VALID (((arm_lpae_iopte)1...
f7fa8520f30373ce99c436c4d57c76befdacbef3
Analyze and fix the following issue in the Linux kernel code: iommu/arm-smmu-qcom: Add SM6115 MDSS compatible
Problem Details: Add the SM6115 MDSS compatible to clients compatible list, as it also needs that workaround. Without this workaround, for example, QRB4210 RB2 which is based on SM4250/SM6115 generates a lot of smmu unhandled context faults during boot: arm_smmu_context_fault: 116854 callbacks suppressed arm-smmu c600...
```diff diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c index 62874b18f645..c75023718595 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -379,6 +379,7 @@ static const struct of_device_id qcom_smmu_client_of_...
621a88dbfe9006c318a0cafbd12e677ccfe006e7
Analyze and fix the following issue in the Linux kernel code: cpuidle: psci: Fix cpuhotplug routine with PREEMPT_RT=y
Problem Details: Currently cpu hotplug with the PREEMPT_RT option set in the kernel is not supported because the underlying generic power domain functions used in the cpu hotplug callbacks are incompatible from a lock point of view. This situation prevents the suspend to idle to reach the deepest idle state for the "cl...
```diff diff --git a/drivers/cpuidle/cpuidle-psci.c b/drivers/cpuidle/cpuidle-psci.c index 4e1ba35deda9..b19bc60cc627 100644 --- a/drivers/cpuidle/cpuidle-psci.c +++ b/drivers/cpuidle/cpuidle-psci.c @@ -45,7 +45,6 @@ struct psci_cpuidle_domain_state { static DEFINE_PER_CPU_READ_MOSTLY(struct psci_cpuidle_data, psci_cp...
78c5845fbbf6aaeb9959c5fbaee5cc53ef5f38c2
Analyze and fix the following issue in the Linux kernel code: PM / devfreq: Fix a index typo in trans_stat
Problem Details: Fixes: 4920ee6dcfaf ("PM / devfreq: Convert to use sysfs_emit_at() API") Signed-off-by: pls <pleasurefish@126.com> Link: https://patchwork.kernel.org/project/linux-pm/patch/20250515143100.17849-1-chanwoo@kernel.org/ Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
```diff diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 46f3a8053197..c5f5960e643b 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -1733,7 +1733,7 @@ static ssize_t trans_stat_show(struct device *dev, for (i = 0; i < max_state; i++) { if (len >= PAGE_SIZE - 1) ...
bab7834c03820eb11269bc48f07c3800192460d2
Analyze and fix the following issue in the Linux kernel code: PM / devfreq: Check governor before using governor->name
Problem Details: Commit 96ffcdf239de ("PM / devfreq: Remove redundant governor_name from struct devfreq") removes governor_name and uses governor->name to replace it. But devfreq->governor may be NULL and directly using devfreq->governor->name may cause null pointer exception. Move the check of governor to before using...
```diff diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 18e3f7e063a4..46f3a8053197 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -1376,15 +1376,11 @@ int devfreq_remove_governor(struct devfreq_governor *governor) int ret; struct device *dev = devfreq->dev.paren...
ced24bf4352c2216e413d1b81f6675950473e7f6
Analyze and fix the following issue in the Linux kernel code: iommu/qcom: Fix pgsize_bitmap
Problem Details: qcom uses the ARM_32_LPAE_S1 format which uses the ARM long descriptor page table. Eventually arm_32_lpae_alloc_pgtable_s1() will adjust the pgsize_bitmap with: cfg->pgsize_bitmap &= (SZ_4K | SZ_2M | SZ_1G); So the current declaration is nonsensical. Fix it to be just SZ_4K which is what it has actu...
```diff diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index d599f778e9f4..c5be95e56031 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -335,7 +335,7 @@ static struct iommu_domain *qcom_iommu_domain_alloc_paging(struct...
3141153816bf4f0257747bd4dda176d38f1a9a49
Analyze and fix the following issue in the Linux kernel code: iommu/vt-d: Fix missing PASID in dev TLB flush with cache_tag_flush_all
Problem Details: The function cache_tag_flush_all() was originally implemented with incorrect device TLB invalidation logic that does not handle PASID, in commit c4d27ffaa8eb ("iommu/vt-d: Add cache tag invalidation helpers") This causes regressions where full address space TLB invalidations occur with a PASID attache...
```diff diff --git a/drivers/iommu/intel/cache.c b/drivers/iommu/intel/cache.c index f8bcc5f67463..ff45c4c9609d 100644 --- a/drivers/iommu/intel/cache.c +++ b/drivers/iommu/intel/cache.c @@ -423,22 +423,6 @@ static void cache_tag_flush_devtlb_psi(struct dmar_domain *domain, struct cache_ domain->qi_batch); ...
5c3687d5789cfff8d285a2c76bceb47f145bf01f
Analyze and fix the following issue in the Linux kernel code: iommu/vt-d: Do not wipe out the page table NID when devices detach
Problem Details: The NID is used to control which NUMA node memory for the page table is allocated it from. It should be a permanent property of the page table when it was allocated and not change during attach/detach of devices. Reviewed-by: Wei Wang <wei.w.wang@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.co...
```diff diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 8521566ccf9b..8c99f8bf2065 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -1391,7 +1391,6 @@ void domain_detach_iommu(struct dmar_domain *domain, struct intel_iommu *iommu) if (--info->refcnt == 0) { ...
12724ce3fe1a3d8f30d56e48b4f272d8860d1970
Analyze and fix the following issue in the Linux kernel code: iommu/vt-d: Optimize iotlb_sync_map for non-caching/non-RWBF modes
Problem Details: The iotlb_sync_map iommu ops allows drivers to perform necessary cache flushes when new mappings are established. For the Intel iommu driver, this callback specifically serves two purposes: - To flush caches when a second-stage page table is attached to a device whose iommu is operating in caching m...
```diff diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index 7aa3932251b2..f60201ee4be0 100644 --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -1796,6 +1796,18 @@ static int domain_setup_first_level(struct intel_iommu *iommu, (pgd_t *)pgd, flags, old); } +static...
b1dc7f097b78eb8d25b071ead2384b07a549692b
Analyze and fix the following issue in the Linux kernel code: EDAC/synopsys: Clear the ECC counters on init
Problem Details: Clear the ECC error and counter registers during initialization/probe to avoid reporting stale errors that may have occurred before EDAC registration. For that, unify the Zynq and ZynqMP ECC state reading paths and simplify the code. [ bp: Massage commit message. Fix an -Wsometimes-uninitialize...
```diff diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index 5ed32a3299c4..51143b3257de 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -332,20 +332,26 @@ struct synps_edac_priv { #endif }; +enum synps_platform_type { + ZYNQ, + ZYNQMP, + SYNPS, +}; + /** ...
0745658aebbe77bcb3ba82f184087e12af2f3df5
Analyze and fix the following issue in the Linux kernel code: pmdomain: samsung: Fix splash-screen handover by enforcing a sync_state
Problem Details: It's has been reported that some Samsung platforms fails to boot with genpd's new sync_state support. Typically the problem exists for platforms where bootloaders are turning on the splash-screen and handing it over to be managed by the kernel. However, at this point, it's not clear how to correctly s...
```diff diff --git a/drivers/pmdomain/samsung/exynos-pm-domains.c b/drivers/pmdomain/samsung/exynos-pm-domains.c index 9b502e8751d1..5d478bb37ad6 100644 --- a/drivers/pmdomain/samsung/exynos-pm-domains.c +++ b/drivers/pmdomain/samsung/exynos-pm-domains.c @@ -147,6 +147,15 @@ static int exynos_pd_probe(struct platform_d...
89635eae076cd8eaa5cb752f66538c9dc6c9fdc3
Analyze and fix the following issue in the Linux kernel code: netfs: Fix race between cache write completion and ALL_QUEUED being set
Problem Details: When netfslib is issuing subrequests, the subrequests start processing immediately and may complete before we reach the end of the issuing function. At the end of the issuing function we set NETFS_RREQ_ALL_QUEUED to indicate to the collector that we aren't going to issue any more subreqs and that it c...
```diff diff --git a/fs/netfs/read_pgpriv2.c b/fs/netfs/read_pgpriv2.c index 080d2a6a51d9..8097bc069c1d 100644 --- a/fs/netfs/read_pgpriv2.c +++ b/fs/netfs/read_pgpriv2.c @@ -111,6 +111,7 @@ static struct netfs_io_request *netfs_pgpriv2_begin_copy_to_cache( goto cancel_put; __set_bit(NETFS_RREQ_OFFLOAD_COLLECTIO...
4c238e30774e3022a505fa54311273add7570f13
Analyze and fix the following issue in the Linux kernel code: netfs: Fix copy-to-cache so that it performs collection with ceph+fscache
Problem Details: The netfs copy-to-cache that is used by Ceph with local caching sets up a new request to write data just read to the cache. The request is started and then left to look after itself whilst the app continues. The request gets notified by the backing fs upon completion of the async DIO write, but then ...
```diff diff --git a/fs/netfs/read_pgpriv2.c b/fs/netfs/read_pgpriv2.c index 5bbe906a551d..080d2a6a51d9 100644 --- a/fs/netfs/read_pgpriv2.c +++ b/fs/netfs/read_pgpriv2.c @@ -110,6 +110,7 @@ static struct netfs_io_request *netfs_pgpriv2_begin_copy_to_cache( if (!creq->io_streams[1].avail) goto cancel_put; + __se...
1eec89a671413ce38df9fe9e70f5130a9eb79a59
Analyze and fix the following issue in the Linux kernel code: sched/topology: Remove sched_domain_topology_level::flags
Problem Details: Support for overlapping domains added in commit e3589f6c81e4 ("sched: Allow for overlapping sched_domain spans") also allowed forcefully setting SD_OVERLAP for !NUMA domains via FORCE_SD_OVERLAP sched_feat(). Since NUMA domains had to be presumed overlapping to ensure correct behavior, "sched_domain_t...
```diff diff --git a/include/linux/sched/sd_flags.h b/include/linux/sched/sd_flags.h index b04a5d04dee9..42839cfa2778 100644 --- a/include/linux/sched/sd_flags.h +++ b/include/linux/sched/sd_flags.h @@ -153,14 +153,6 @@ SD_FLAG(SD_ASYM_PACKING, SDF_NEEDS_GROUPS) */ SD_FLAG(SD_PREFER_SIBLING, SDF_NEEDS_GROUPS) -/* ...
634c24068abf8f325e520e663250e4a32a95ea0e
Analyze and fix the following issue in the Linux kernel code: tools/sched: Add dl_bw_dump.py for printing bandwidth accounting info
Problem Details: dl_rq bandwidth accounting information is crucial for the correct functioning of SCHED_DEADLINE. Add a drgn script for accessing that information at runtime, so that it's easier to check and debug issues related to it. Signed-off-by: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Peter Zijlstra (I...
```diff diff --git a/tools/sched/dl_bw_dump.py b/tools/sched/dl_bw_dump.py new file mode 100644 index 000000000000..aae4e42b1769 --- /dev/null +++ b/tools/sched/dl_bw_dump.py @@ -0,0 +1,57 @@ +#!/usr/bin/env drgn +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2025 Juri Lelli <juri.lelli@redhat.com> +# Copyright (...
9fdb12c88e9ba75e2d831fb397dd27f03a534968
Analyze and fix the following issue in the Linux kernel code: tools/sched: Add root_domains_dump.py which dumps root domains info
Problem Details: Root domains information is somewhat hard to access at runtime. Even with sched_debug and sched_verbose, such information is only printed on kernel console when domains are modified. Add a simple drgn script to more easily retrieve root domains information at runtime. Since tools/sched is a new direc...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index a92290fffa16..b986a49383c9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22165,6 +22165,7 @@ F: include/linux/wait.h F: include/uapi/linux/sched.h F: kernel/fork.c F: kernel/sched/ +F: tools/sched/ SCHEDULER - SCHED_EXT R: Tejun Heo <tj@kernel.org> diff --git...
440989c10f4e32620e9e2717ca52c3ed7ae11048
Analyze and fix the following issue in the Linux kernel code: sched/deadline: Fix accounting after global limits change
Problem Details: A global limits change (sched_rt_handler() logic) currently leaves stale and/or incorrect values in variables related to accounting (e.g. extra_bw). Properly clean up per runqueue variables before implementing the change and rebuild scheduling domains (so that accounting is also properly restored) aft...
```diff diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 0abffe3860e3..9c7d9528d5fa 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -3183,6 +3183,9 @@ void sched_dl_do_global(void) if (global_rt_runtime() != RUNTIME_INF) new_bw = to_ratio(global_rt_period(), global_rt_runt...
fcc9276c4d331cd1fe9319d793e80b02e09727f5
Analyze and fix the following issue in the Linux kernel code: sched/deadline: Reset extra_bw to max_bw when clearing root domains
Problem Details: dl_clear_root_domain() doesn't take into account the fact that per-rq extra_bw variables retain values computed before root domain changes, resulting in broken accounting. Fix it by resetting extra_bw to max_bw before restoring back dl-servers contributions. Fixes: 2ff899e351643 ("sched/deadline: Reb...
```diff diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 0d25553f2c17..0abffe3860e3 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -2924,7 +2924,14 @@ void dl_clear_root_domain(struct root_domain *rd) int i; guard(raw_spinlock_irqsave)(&rd->dl_bw.lock); + + /* + * Reset...
9f239df55546ee1d28f0976130136ffd1cad0fd7
Analyze and fix the following issue in the Linux kernel code: sched/deadline: Initialize dl_servers after SMP
Problem Details: dl-servers are currently initialized too early at boot when CPUs are not fully up (only boot CPU is). This results in miscalculation of per runqueue DEADLINE variables like extra_bw (which needs a stable CPU count). Move initialization of dl-servers later on after SMP has been initialized and CPUs are...
```diff diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2f8caa9db78d..89b3ed637465 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8371,6 +8371,8 @@ void __init sched_init_smp(void) init_sched_rt_class(); init_sched_dl_class(); + sched_init_dl_servers(); + sched_smp_initialized = tru...
36569780b0d64de283f9d6c2195fd1a43e221ee8
Analyze and fix the following issue in the Linux kernel code: sched: Change nr_uninterruptible type to unsigned long
Problem Details: The commit e6fe3f422be1 ("sched: Make multiple runqueue task counters 32-bit") changed nr_uninterruptible to an unsigned int. But the nr_uninterruptible values for each of the CPU runqueues can grow to large numbers, sometimes exceeding INT_MAX. This is valid, if, over time, a large number of tasks are...
```diff diff --git a/kernel/sched/loadavg.c b/kernel/sched/loadavg.c index c48900b856a2..52ca8e268cfc 100644 --- a/kernel/sched/loadavg.c +++ b/kernel/sched/loadavg.c @@ -80,7 +80,7 @@ long calc_load_fold_active(struct rq *this_rq, long adjust) long nr_active, delta = 0; nr_active = this_rq->nr_running - adjust; ...
fdfe0133473a528e3f5da69c35419ce6711d6b89
Analyze and fix the following issue in the Linux kernel code: fix a leak in fcntl_dirnotify()
Problem Details: [into #fixes, unless somebody objects] Lifetime of new_dn_mark is controlled by that of its ->fsn_mark, pointed to by new_fsn_mark. Unfortunately, a failure exit had been inserted between the allocation of new_dn_mark and the call of fsnotify_init_mark(), ending up with a leak. Fixes: 1934b212615d "...
```diff diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c index c4cdaf5fa7ed..9fb73bafd41d 100644 --- a/fs/notify/dnotify/dnotify.c +++ b/fs/notify/dnotify/dnotify.c @@ -308,6 +308,10 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned int arg) goto out_err; } + error = file_f_owner_a...
532c8b51b3a8676cbf533a291f8156774f30ea87
Analyze and fix the following issue in the Linux kernel code: xen: fix UAF in dmabuf_exp_from_pages()
Problem Details: [dma_buf_fd() fixes; no preferences regarding the tree it goes through - up to xen folks] As soon as we'd inserted a file reference into descriptor table, another thread could close it. That's fine for the case when all we are doing is returning that descriptor to userland (it's a race, but it's a us...
```diff diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c index 5453d86324f6..82855105ab85 100644 --- a/drivers/xen/gntdev-dmabuf.c +++ b/drivers/xen/gntdev-dmabuf.c @@ -357,8 +357,11 @@ struct gntdev_dmabuf_export_args { static int dmabuf_exp_from_pages(struct gntdev_dmabuf_export_args *args) { ...
b7efeb081ed3b80c6af38c285f5c3b5d15c560e9
Analyze and fix the following issue in the Linux kernel code: xen/xenbus: fix W=1 build warning in xenbus_va_dev_error function
Problem Details: This patch fixes a W=1 format-string warning reported by GCC 12.3.0 by annotating xenbus_switch_fatal() and xenbus_va_dev_error() with the __printf attribute. The attribute enables compile-time validation of printf-style format strings in these functions. The original warning trace: drivers/xen/xenbus...
```diff diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index 51b3124b0d56..e73ec225d4a6 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c @@ -202,6 +202,7 @@ int xenbus_watch_pathfmt(struct xenbus_device *dev, } EXPORT_SYMBOL_GPL(xenbus_watc...
148fbaf571697bb1ff2d50ca232a9ac190519fd1
Analyze and fix the following issue in the Linux kernel code: ata: pata_rdc: Use registered definition for the RDC vendor
Problem Details: Convert to PCI_VDEVICE() and use registered definition for RDC vendor from pci_ids.h. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://lore.kernel.org/r/20250711113650.1475307-1-andriy.shevchenko@linux.intel.com [cassel: ...
```diff diff --git a/drivers/ata/pata_rdc.c b/drivers/ata/pata_rdc.c index 09792aac7f9d..19cbb5c94b42 100644 --- a/drivers/ata/pata_rdc.c +++ b/drivers/ata/pata_rdc.c @@ -359,8 +359,8 @@ static void rdc_remove_one(struct pci_dev *pdev) } static const struct pci_device_id rdc_pci_tbl[] = { - { PCI_DEVICE(0x17F3, 0x1...
e8ab346f9907a1a3aa2f0e5decf849925c06ae2e
Analyze and fix the following issue in the Linux kernel code: clk: sunxi-ng: v3s: Fix de clock definition
Problem Details: The de clock is marked with CLK_SET_RATE_PARENT, which is really not necessary (as confirmed from experimentation) and significantly restricts flexibility for other clocks using the same parent. In addition the source selection (parent) field is marked as using 2 bits, when it the documentation report...
```diff diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c b/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c index 579a81bb46df..7744fc632ea6 100644 --- a/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c +++ b/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c @@ -347,8 +347,7 @@ static SUNXI_CCU_GATE(dram_ohci_clk, "dram-ohci", "dram", static const cha...
5137d6c8906b55b3c7b5d1aa5a549753ec8520f5
Analyze and fix the following issue in the Linux kernel code: ext4: fix insufficient credits calculation in ext4_meta_trans_blocks()
Problem Details: The calculation of journal credits in ext4_meta_trans_blocks() should include pextents, as each extent separately may be allocated from a different group and thus need to update different bitmap and group descriptor block. Fixes: 0e32d8617012 ("ext4: correct the journal credits calculations of allocat...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 13b25f41c134..4a0ba009c88e 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -6212,7 +6212,7 @@ int ext4_meta_trans_blocks(struct inode *inode, int lblocks, int pextents) int ret; /* - * How many index and lead blocks need to touch to map @lblocks ...
95ad8ee45cdbc321c135a2db895d48b374ef0f87
Analyze and fix the following issue in the Linux kernel code: ext4: correct the reserved credits for extent conversion
Problem Details: Now, we reserve journal credits for converting extents in only one page to written state when the I/O operation is complete. This is insufficient when large folio is enabled. Fix this by reserving credits for converting up to one extent per block in the largest 2MB folio, this calculation should only ...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 2b1d158b3f18..1d158e1de3a1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2847,12 +2847,12 @@ static int ext4_do_writepages(struct mpage_da_data *mpd) mpd->journalled_more_data = 0; if (ext4_should_dioread_nolock(inode)) { + int bpf = ext4_jour...
e2c4c49dee64ca2f42ad2958cbe1805de96b6732
Analyze and fix the following issue in the Linux kernel code: ext4: restart handle if credits are insufficient during allocating blocks
Problem Details: After large folios are supported on ext4, writing back a sufficiently large and discontinuous folio may consume a significant number of journal credits, placing considerable strain on the journal. For example, in a 20GB filesystem with 1K block size and 1MB journal size, writing back a 2MB folio could ...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index f8946430304c..74b7ba2afb67 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -875,6 +875,26 @@ static void ext4_update_bh_state(struct buffer_head *bh, unsigned long flags) } while (unlikely(!try_cmpxchg(&bh->b_state, &old_state, new_state))); } +/* ...
2bddafea3d0d85ee9ac3cf5ba9a4b2f2d2f50257
Analyze and fix the following issue in the Linux kernel code: ext4: refactor the block allocation process of ext4_page_mkwrite()
Problem Details: The block allocation process and error handling in ext4_page_mkwrite() is complex now. Refactor it by introducing a new helper function, ext4_block_page_mkwrite(). It will call ext4_block_write_begin() to allocate blocks instead of directly calling block_page_mkwrite(). Preparing to implement retry log...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index ceb68df19f1e..f8946430304c 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -6603,6 +6603,53 @@ static int ext4_bh_unmapped(handle_t *handle, struct inode *inode, return !buffer_mapped(bh); } +static int ext4_block_page_mkwrite(struct inode *inode, ...
ded2d726a3041fce8afd88005cbfe15cd4737702
Analyze and fix the following issue in the Linux kernel code: ext4: fix stale data if it bail out of the extents mapping loop
Problem Details: During the process of writing back folios, if mpage_map_and_submit_extent() exits the extent mapping loop due to an ENOSPC or ENOMEM error, it may result in stale data or filesystem inconsistency in environments where the block size is smaller than the folio size. When mapping a discontinuous folio in...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 399c765bc22d..ceb68df19f1e 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2359,6 +2359,47 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd) return 0; } +/* + * This is used to submit mapped buffers in a single folio ...
a141656ac81517207b1ed0dafdbada72d70d2900
Analyze and fix the following issue in the Linux kernel code: tools/bootconfig: Replace some echo with printf for more portability
Problem Details: Since echo is not portable, use printf instead. This fixes a wrong test result formatting in some environment. (showing "\t\t[OK]") Also this uses printf command for generating test data instead of echo. Link: https://lore.kernel.org/all/175211424942.2591046.5439447789303314213.stgit@mhiramat.tok.corp...
```diff diff --git a/tools/bootconfig/test-bootconfig.sh b/tools/bootconfig/test-bootconfig.sh index aea302bd7c2a..7594659af1e1 100755 --- a/tools/bootconfig/test-bootconfig.sh +++ b/tools/bootconfig/test-bootconfig.sh @@ -27,16 +27,16 @@ NO=1 xpass() { # pass test command echo "test case $NO ($*)... " - if ! ($...
fed48693bdfeca666f7536ba88a05e9a4e5523b6
Analyze and fix the following issue in the Linux kernel code: mm/damon/reclaim: use parameter context correctly
Problem Details: damon_reclaim_apply_parameters() allocates a new DAMON context, stages user-specified DAMON parameters on it, and commits to running DAMON context at once, using damon_commit_ctx(). The code is mistakenly over-writing the monitoring attributes and the reclaim scheme on the running context. It is not ...
```diff diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c index c91098d8aa51..0fe8996328b8 100644 --- a/mm/damon/reclaim.c +++ b/mm/damon/reclaim.c @@ -194,7 +194,7 @@ static int damon_reclaim_apply_parameters(void) if (err) return err; - err = damon_set_attrs(ctx, &damon_reclaim_mon_attrs); + err = damon_set...
b91b82e241822ef1f287c3a8214f7bdeef4e85b2
Analyze and fix the following issue in the Linux kernel code: mm/damon/lru_sort: reset enabled when DAMON start failed
Problem Details: When the startup fails, 'enabled' parameter is not reset. As a result, users show the parameter 'Y' while it is not really working. Fix it by resetting 'enabled' to 'false' when the work is failed. Link: https://lkml.kernel.org/r/20250706193207.39810-6-sj@kernel.org Fixes: 7a034fbba336 ("mm/damon/lr...
```diff diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c index 4af8fd4a390b..9bd8a1a115e0 100644 --- a/mm/damon/lru_sort.c +++ b/mm/damon/lru_sort.c @@ -325,7 +325,7 @@ static int __init damon_lru_sort_init(void) int err = damon_modules_new_paddr_ctx_target(&ctx, &target); if (err) - return err; + goto ou...
737e40d5eb2f6507113285cb52c50a4a6b01f44a
Analyze and fix the following issue in the Linux kernel code: mm/damon/reclaim: reset enabled when DAMON start failed
Problem Details: When the startup fails, 'enabled' parameter is not reset. As a result, users show the parameter 'Y' while it is not really working. Fix it by resetting 'enabled' to 'false' when the work is failed. Link: https://lkml.kernel.org/r/20250706193207.39810-5-sj@kernel.org Fixes: 04e98764befa ("mm/damon/re...
```diff diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c index a675150965e0..c91098d8aa51 100644 --- a/mm/damon/reclaim.c +++ b/mm/damon/reclaim.c @@ -329,7 +329,7 @@ static int __init damon_reclaim_init(void) int err = damon_modules_new_paddr_ctx_target(&ctx, &target); if (err) - return err; + goto out; ...
964314344eab7bc43e38a32be281c5ea0609773b
Analyze and fix the following issue in the Linux kernel code: samples/damon/mtier: support boot time enable setup
Problem Details: If 'enable' parameter of the 'mtier' DAMON sample module is set at boot time via the kernel command line, memory allocation is tried before the slab is initialized. As a result kernel NULL pointer dereference BUG can happen. Fix it by checking the initialization status. Link: https://lkml.kernel.org...
```diff diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c index 97892ade7f31..bc9d8195da87 100644 --- a/samples/damon/mtier.c +++ b/samples/damon/mtier.c @@ -157,6 +157,8 @@ static void damon_sample_mtier_stop(void) damon_destroy_ctx(ctxs[1]); } +static bool init_called; + static int damon_sample_mtier_e...
2780505ec2b42c07853b34640bc63279ac2bb53b
Analyze and fix the following issue in the Linux kernel code: samples/damon/prcl: fix boot time enable crash
Problem Details: If 'enable' parameter of the 'prcl' DAMON sample module is set at boot time via the kernel command line, memory allocation is tried before the slab is initialized. As a result kernel NULL pointer dereference BUG can happen. Fix it by checking the initialization status. Link: https://lkml.kernel.org/...
```diff diff --git a/samples/damon/prcl.c b/samples/damon/prcl.c index 5597e6a08ab2..a9d7629d70f0 100644 --- a/samples/damon/prcl.c +++ b/samples/damon/prcl.c @@ -109,6 +109,8 @@ static void damon_sample_prcl_stop(void) put_pid(target_pidp); } +static bool init_called; + static int damon_sample_prcl_enable_store...
0ed1165c37277822b519f519d0982d36efc30006
Analyze and fix the following issue in the Linux kernel code: samples/damon/wsse: fix boot time enable handling
Problem Details: Patch series "mm/damon: fix misc bugs in DAMON modules". From manual code review, I found below bugs in DAMON modules. DAMON sample modules crash if those are enabled at boot time, via kernel command line. A similar issue was found and fixed on DAMON non-sample modules in the past, but we didn't che...
```diff diff --git a/samples/damon/wsse.c b/samples/damon/wsse.c index e20238a249e7..e941958b1032 100644 --- a/samples/damon/wsse.c +++ b/samples/damon/wsse.c @@ -89,6 +89,8 @@ static void damon_sample_wsse_stop(void) put_pid(target_pidp); } +static bool init_called; + static int damon_sample_wsse_enable_store( ...
7f810385fde490a831fdba36978a52a927b23922
Analyze and fix the following issue in the Linux kernel code: khugepaged: reduce race probability between migration and khugepaged
Problem Details: Suppose a folio is under migration, and khugepaged is also trying to collapse it. collapse_pte_mapped_thp() will retrieve the folio from the page cache via filemap_lock_folio(), thus taking a reference on the folio and sleeping on the folio lock, since the lock is held by the migration path. Migratio...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 1aa7ca67c756..a55fb1dcd224 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -941,6 +941,14 @@ static inline int check_pmd_state(pmd_t *pmd) if (pmd_none(pmde)) return SCAN_PMD_NONE; + + /* + * The folio may be under migration when khugepaged is t...
b9ed00483d4cbacca04edb11984d8daf09e9ae22
Analyze and fix the following issue in the Linux kernel code: mm/migrate: factor out movable_ops page handling into migrate_movable_ops_page()
Problem Details: Let's factor it out, simplifying the calling code. Before this change, we would have called flush_dcache_folio() also on movable_ops pages. As documented in Documentation/core-api/cachetlb.rst: "This routine need only be called for page cache pages which can potentially ever be mapped into the ad...
```diff diff --git a/mm/migrate.c b/mm/migrate.c index c3cd66b05fe2..8c4d5837db53 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -159,6 +159,47 @@ static void putback_movable_ops_page(struct page *page) folio_put(folio); } +/** + * migrate_movable_ops_page - migrate an isolated movable_ops page + * @dst: The dest...
5bd3b163e374462c05c055ff091582d757929d3f
Analyze and fix the following issue in the Linux kernel code: mm: fix spelling issue in swap.h
Problem Details: recliam -> reclaim Link: https://lkml.kernel.org/r/20250702071235.212794-1-liuqiye2025@163.com Signed-off-by: Xuanye Liu <liuqiye2025@163.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
```diff diff --git a/include/linux/swap.h b/include/linux/swap.h index bc0e1c275fc0..a49be950c485 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -415,7 +415,7 @@ extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, #define MIN_SWAPPINESS 0 #define MAX_SWAPPINESS 200 -/* Just...
11f45931ccfd14f2f3ca3cf9cafd0e9317e9008a
Analyze and fix the following issue in the Linux kernel code: mm/cma: use str_plural() in cma_declare_contiguous_multi()
Problem Details: Use the string choice helper function str_plural() to simplify the code and to fix the following Coccinelle/coccicheck warning reported by string_choices.cocci: opportunity for str_plural(nr) Link: https://lkml.kernel.org/r/20250630132318.41339-2-thorsten.blum@linux.dev Signed-off-by: Thorsten Blum...
```diff diff --git a/mm/cma.c b/mm/cma.c index c0b2630a1b81..c40d53298801 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -22,6 +22,7 @@ #include <linux/mm.h> #include <linux/sizes.h> #include <linux/slab.h> +#include <linux/string_choices.h> #include <linux/log2.h> #include <linux/cma.h> #include <linux/highmem.h> @@ -5...
2ae1ab9934c785b855583e3eabd208d6f3ac91e1
Analyze and fix the following issue in the Linux kernel code: mm,hugetlb: change mechanism to detect a COW on private mapping
Problem Details: Patch series "Misc rework on hugetlb faulting path", v4. This patchset aims to give some love to the hugetlb faulting path, doing so by removing obsolete comments that are no longer true, sorting out the folio lock, and changing the mechanism we use to determine whether we are COWing a private mapping...
```diff diff --git a/mm/hugetlb.c b/mm/hugetlb.c index db53ead8ac43..cf5d5ad5bbe9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6131,8 +6131,7 @@ static void unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma, * cannot race with other handlers or page migration. * Keep the pte_same checks anyway ...
2a83529026c23fc7d8bbf544c6c8d52df7cb9d93
Analyze and fix the following issue in the Linux kernel code: mm/hugetlb: use str_plural() in report_hugepages()
Problem Details: Use the string choice helper function str_plural() to simplify the code and to fix the following Coccinelle/coccicheck warning reported by string_choices.cocci: opportunity for str_plural(nrinvalid) Link: https://lkml.kernel.org/r/20250630171826.114008-2-thorsten.blum@linux.dev Signed-off-by: Thors...
```diff diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 11d5668ff6e7..db53ead8ac43 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -25,6 +25,7 @@ #include <linux/mmdebug.h> #include <linux/sched/signal.h> #include <linux/rmap.h> +#include <linux/string_choices.h> #include <linux/string_helpers.h> #include <linux/sw...
b112a4e0a1af5745f987a1692553bf02c890babc
Analyze and fix the following issue in the Linux kernel code: mm/percpu: prevent concurrency problem for pcpu_nr_populated read with spin lock
Problem Details: pcpu_nr_pages() reads pcpu_nr_populated without any protection, which causes a data race between read/write. However, since this is an intended race, we should add a data_race annotation instead of add a spin lock. [akpm@linux-foundation.org: move pcpu_nr_units multiplication outside data_race(), per...
```diff diff --git a/mm/percpu.c b/mm/percpu.c index b35494c8ede2..d9cbaee92b60 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -3355,7 +3355,7 @@ void __init setup_per_cpu_areas(void) */ unsigned long pcpu_nr_pages(void) { - return pcpu_nr_populated * pcpu_nr_units; + return data_race(READ_ONCE(pcpu_nr_populated)) *...
eff41389d8249a1a5a67faa440255ed8e526803a
Analyze and fix the following issue in the Linux kernel code: mm/hugetlb: remove prepare_hugepage_range()
Problem Details: Only mips and loongarch implemented this API, however what it does was checking against stack overflow for either len or addr. That's already done in arch's arch_get_unmapped_area*() functions, even though it may not be 100% identical checks. For example, for both of the architectures, there will be ...
```diff diff --git a/arch/loongarch/include/asm/hugetlb.h b/arch/loongarch/include/asm/hugetlb.h index 4dc4b3e04225..ab68b594f889 100644 --- a/arch/loongarch/include/asm/hugetlb.h +++ b/arch/loongarch/include/asm/hugetlb.h @@ -10,20 +10,6 @@ uint64_t pmd_to_entrylo(unsigned long pmd_val); -#define __HAVE_ARCH_PREP...
980d05955835bfdc054243e5ad95de803d2c19a7
Analyze and fix the following issue in the Linux kernel code: mm, madvise: simplify anon_name handling
Problem Details: Patch series "madvise anon_name cleanups", v2. While reviewing Lorenzo's madvise cleanups I've noticed that we can handle anon_name in madvise code much better, so sending that as patch 1. Initially I wanted to do first move the existing logic from madvise_vma_behavior() to madvise_update_vma() as a ...
```diff diff --git a/mm/madvise.c b/mm/madvise.c index c467ee42596f..0ca405017b37 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -176,25 +176,29 @@ static int replace_anon_vma_name(struct vm_area_struct *vma, } #endif /* CONFIG_ANON_VMA_NAME */ /* - * Update the vm_flags on region of a vma, splitting it or merging ...
e24d552a17e92714d4f62e112d536babd6428acb
Analyze and fix the following issue in the Linux kernel code: mm/madvise: eliminate very confusing manipulation of prev VMA
Problem Details: The madvise code has for the longest time had very confusing code around the 'prev' VMA pointer passed around various functions which, in all cases except madvise_update_vma(), is unused and instead simply updated as soon as the function is invoked. To compound the confusion, the prev pointer is also ...
```diff diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 8f1b15213f61..4d5bb67dc4ec 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -433,9 +433,8 @@ change_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma, int hugepage_madvise(struct vm_area_struct *vma, vm_flags_...
946fc11af061c3cd08943a96f6ea8c7e6fec95e1
Analyze and fix the following issue in the Linux kernel code: mm/madvise: thread all madvise state through madv_behavior
Problem Details: Doing so means we can get rid of all the weird struct vm_area_struct **prev stuff, everything becomes consistent and in future if we want to make change to behaviour there's a single place where all relevant state is stored. This also allows us to update try_vma_read_lock() to be a little more succinc...
```diff diff --git a/mm/madvise.c b/mm/madvise.c index 764a532ff62a..f04b8165e2ab 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -74,6 +74,8 @@ struct madvise_behavior { * traversing multiple VMAs, this is updated for each. */ struct madvise_behavior_range range; + /* The VMA and VMA preceding it (if applicabl...
58fc12f77eb962360ecf80abd3e1c2790b50786d
Analyze and fix the following issue in the Linux kernel code: mm/madvise: remove the visitor pattern and thread anon_vma state
Problem Details: Patch series "madvise cleanup", v2. This is a series of patches that helps address a number of historic problems in the madvise() implementation: * Eliminate the visitor pattern and having the code which is implemented for both the anon_vma_name implementation and ordinary madvise() operations us...
```diff diff --git a/mm/madvise.c b/mm/madvise.c index 070132f9842b..93837b980cc2 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -37,6 +37,8 @@ #include "internal.h" #include "swap.h" +#define __MADV_SET_ANON_VMA_NAME (-1) + /* * Maximum number of attempts we make to install guard pages before we give up * an...
83898e4a858387c88cd7456f713cb8fd49440cf9
Analyze and fix the following issue in the Linux kernel code: smb: invalidate and close cached directory when creating child entries
Problem Details: When a parent lease key is passed to the server during a create operation while holding a directory lease, the server may not send a lease break to the client. In such cases, it becomes the client’s responsibility to ensure cache consistency. This led to a problem where directory listings (e.g., `ls` ...
```diff diff --git a/fs/smb/client/dir.c b/fs/smb/client/dir.c index 1c6e5389c51f..5223edf6d11a 100644 --- a/fs/smb/client/dir.c +++ b/fs/smb/client/dir.c @@ -190,6 +190,7 @@ static int cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int disposition; struct TCP_Server_Info *server = tcon->ses-...
b220bed63330c0e1733dc06ea8e75d5b9962b6b6
Analyze and fix the following issue in the Linux kernel code: smb: client: fix use-after-free in crypt_message when using async crypto
Problem Details: The CVE-2024-50047 fix removed asynchronous crypto handling from crypt_message(), assuming all crypto operations are synchronous. However, when hardware crypto accelerators are used, this can cause use-after-free crashes: crypt_message() // Allocate the creq buffer containing the req creq = ...
```diff diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 1468c16ea9b8..cb659256d219 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -4316,6 +4316,7 @@ crypt_message(struct TCP_Server_Info *server, int num_rqst, u8 key[SMB3_ENC_DEC_KEY_SIZE]; struct aead_request *req; u8 *...
705c79101ccf9edea5a00d761491a03ced314210
Analyze and fix the following issue in the Linux kernel code: smb: client: fix use-after-free in cifs_oplock_break
Problem Details: A race condition can occur in cifs_oplock_break() leading to a use-after-free of the cinode structure when unmounting: cifs_oplock_break() _cifsFileInfo_put(cfile) cifsFileInfo_put_final() cifs_sb_deactive() [last ref, start releasing sb] kill_sb() ...
```diff diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index e9212da32f01..1421bde045c2 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -3088,7 +3088,8 @@ void cifs_oplock_break(struct work_struct *work) struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo, oplock_bre...
b640daa2822a39ff76e70200cb2b7b892b896dce
Analyze and fix the following issue in the Linux kernel code: rpl: Fix use-after-free in rpl_do_srh_inline().
Problem Details: Running lwt_dst_cache_ref_loop.sh in selftest with KASAN triggers the splat below [0]. rpl_do_srh_inline() fetches ipv6_hdr(skb) and accesses it after skb_cow_head(), which is illegal as the header could be freed then. Let's fix it by making oldhdr to a local struct instead of a pointer. [0]: [root@...
```diff diff --git a/net/ipv6/rpl_iptunnel.c b/net/ipv6/rpl_iptunnel.c index 7c05ac846646..eccfa4203e96 100644 --- a/net/ipv6/rpl_iptunnel.c +++ b/net/ipv6/rpl_iptunnel.c @@ -129,13 +129,13 @@ static int rpl_do_srh_inline(struct sk_buff *skb, const struct rpl_lwt *rlwt, struct dst_entry *cache_dst) { struct...
e837b59f8b411b5baf5e3de7a5aea10b1c545a63
Analyze and fix the following issue in the Linux kernel code: ASoC: Intel: fix SND_SOC_SOF dependencies
Problem Details: It is currently possible to configure a kernel with all Intel SoC configs as loadable modules, but the board config as built-in. This causes a link failure in the reference to the snd_soc_sof.ko module: x86_64-linux-ld: sound/soc/intel/boards/sof_rt5682.o: in function `sof_rt5682_hw_params': sof_rt568...
```diff diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig index 128b6876af83..c23fdb6aad4c 100644 --- a/sound/soc/intel/boards/Kconfig +++ b/sound/soc/intel/boards/Kconfig @@ -11,7 +11,7 @@ menuconfig SND_SOC_INTEL_MACH kernel: saying N will just cause the configurator to skip all the q...
d235538723e6c95f354b49a8c4760be43c234579
Analyze and fix the following issue in the Linux kernel code: ASoC: rt5660: Fix the dmic data source from GPIO2
Problem Details: The patch fixes an issue with the dmic data pin connected to GPIO2. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Link: https://patch.msgid.link/20250711034813.3278989-1-oder_chiou@realtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
```diff diff --git a/sound/soc/codecs/rt5660.c b/sound/soc/codecs/rt5660.c index 82b92e83be4c..44c3a3b92f98 100644 --- a/sound/soc/codecs/rt5660.c +++ b/sound/soc/codecs/rt5660.c @@ -1315,14 +1315,17 @@ static int rt5660_i2c_probe(struct i2c_client *i2c) regmap_update_bits(rt5660->regmap, RT5660_GPIO_CTRL1, RT56...
d274c77ffa202b70ad01d579f33b73b4de123375
Analyze and fix the following issue in the Linux kernel code: clk: thead: th1520-ap: Correctly refer the parent of osc_12m
Problem Details: The "osc_12m" fixed factor clock refers the external oscillator by setting clk_parent_data.fw_name to osc_24m, which is obviously wrong since no clock-names property is allowed for compatible thead,th1520-clk-ap. Refer the oscillator as parent by index instead. Fixes: ae81b69fd2b1 ("clk: thead: Add s...
```diff diff --git a/drivers/clk/thead/clk-th1520-ap.c b/drivers/clk/thead/clk-th1520-ap.c index cf7f6bd428a0..5a102beb6ac1 100644 --- a/drivers/clk/thead/clk-th1520-ap.c +++ b/drivers/clk/thead/clk-th1520-ap.c @@ -582,7 +582,14 @@ static const struct clk_parent_data peri2sys_apb_pclk_pd[] = { { .hw = &peri2sys_apb_p...
cb1bdf0797acd79c53a899f72a06ab8c1ebc5bcb
Analyze and fix the following issue in the Linux kernel code: block: floppy: Fix uninitialized use of outparam
Problem Details: Fix Smatch-detected error: drivers/block/floppy.c:3569 fd_locked_ioctl() error: uninitialized symbol 'outparam'. Smatch may incorrectly warn about uninitialized use of 'outparam' in fd_locked_ioctl(), even though all _IOC_READ commands guarantee its initialization. Initialize outparam to NULL to make ...
```diff diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index e97432032f01..24be0c2c4075 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -3411,7 +3411,7 @@ static int fd_locked_ioctl(struct block_device *bdev, blk_mode_t mode, struct floppy_max_errors max_errors; struct floppy_dri...
2aa4ad626ee7f817a8f4715a47b318cfdc1714c9
Analyze and fix the following issue in the Linux kernel code: nvmem: imx-ocotp: fix MAC address byte length
Problem Details: The commit "13bcd440f2ff nvmem: core: verify cell's raw_len" caused an extension of the "mac-address" cell from 6 to 8 bytes due to word_size of 4 bytes. This led to a required byte swap of the full buffer length, which caused truncation of the mac-address when read. Previously, the mac-address was in...
```diff diff --git a/drivers/nvmem/imx-ocotp-ele.c b/drivers/nvmem/imx-ocotp-ele.c index ca6dd71d8a2e..7807ec0e2d18 100644 --- a/drivers/nvmem/imx-ocotp-ele.c +++ b/drivers/nvmem/imx-ocotp-ele.c @@ -12,6 +12,7 @@ #include <linux/of.h> #include <linux/platform_device.h> #include <linux/slab.h> +#include <linux/if_eth...
5724ff190b22bd04fcfd7287a39c6e5494e40f0b
Analyze and fix the following issue in the Linux kernel code: usb: dwc2: gadget: Fix enter to hibernation for UTMI+ PHY
Problem Details: For UTMI+ PHY, according to programming guide, first should be set PMUACTV bit then STOPPCLK bit. Otherwise, when the device issues Remote Wakeup, then host notices disconnect instead. For ULPI PHY, above mentioned bits must be set in reversed order: STOPPCLK then PMUACTV. Fixes: 4483ef3c1685 ("usb: d...
```diff diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index d5b622f78cf3..0637bfbc054e 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -5389,20 +5389,34 @@ int dwc2_gadget_enter_hibernation(struct dwc2_hsotg *hsotg) if (gusbcfg & GUSBCFG_ULPI_UTMI_SEL) { /* ULPI inter...
ef8abc0ba49ce717e6bc4124e88e59982671f3b5
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: qcom: Don't leave BCR asserted
Problem Details: Leaving the USB BCR asserted prevents the associated GDSC to turn on. This blocks any subsequent attempts of probing the device, e.g. after a probe deferral, with the following showing in the log: [ 1.332226] usb30_prim_gdsc status stuck at 'off' Leave the BCR deasserted when exiting the driver to...
```diff diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 7334de85ad10..ca7e1c02773a 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -680,12 +680,12 @@ static int dwc3_qcom_probe(struct platform_device *pdev) ret = reset_control_deassert(qcom->resets); if...
67189665e0630d1eaec539a50b37d1022db65dca
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad_sigma_delta: sort includes
Problem Details: Sort includes in alphabetical order and fix grouping before we add more. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20250701-iio-adc-ad7173-add-spi-offloa...
```diff diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c index 6b3ef7ef403e..5cdd73160c6d 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c @@ -7,24 +7,22 @@ */ #include <linux/align.h> -#include <linux/interrupt.h> #include <linux/device.h> +#inc...
5a2f15c5a8e017d0951e6dc62aa7b5b634f56881
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad_sigma_delta: don't overallocate scan buffer
Problem Details: Fix overallocating the size of the scan buffer by converting bits to bytes. The size is meant to be in bytes, so scanbits needs to be divided by 8. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Nuno Sá <nuno.sa@analog...
```diff diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c index 4c5f8d29a559..6b3ef7ef403e 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c @@ -489,7 +489,7 @@ static int ad_sd_buffer_postenable(struct iio_dev *indio_dev) return ret; } - samples...
a6cfa4c8833944f8912c1fa7f95795753f6376ea
Analyze and fix the following issue in the Linux kernel code: PM: hibernate: Add stub for pm_hibernate_is_recovering()
Problem Details: Randy reports that amdgpu fails to compile with the following error: ERROR: modpost: "pm_hibernate_is_recovering" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! This happens because pm_hibernate_is_recovering() is only compiled when CONFIG_PM_SLEEP is set. Add a stub for it so that drivers don't n...
```diff diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 293137210fdf..fcb150ee83b6 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -426,8 +426,6 @@ int is_hibernate_resume_dev(dev_t dev); static inline int is_hibernate_resume_dev(dev_t dev) { return 0; } #endif -bool pm_hi...
62de0e67328e9503459a24b9343c3358937cdeef
Analyze and fix the following issue in the Linux kernel code: RDMA/mana_ib: Fix DSCP value in modify QP
Problem Details: Convert the traffic_class in GRH to a DSCP value as required by the HW. Fixes: e095405b45bb ("RDMA/mana_ib: Modify QP state") Signed-off-by: Shiraz Saleem <shirazsaleem@microsoft.com> Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com> Link: https://patch.msgid.link/1752143085-4169-1-git-send-...
```diff diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c index 14fd7d6c54a2..a6bf4d539e67 100644 --- a/drivers/infiniband/hw/mana/qp.c +++ b/drivers/infiniband/hw/mana/qp.c @@ -772,7 +772,7 @@ static int mana_ib_gd_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, req.ah_attr.dest_...
3a1d22bd85381c4e358fc3340e776c3a3223a1d0
Analyze and fix the following issue in the Linux kernel code: selftests/hid: add a test case for the recent syzbot underflow
Problem Details: Syzbot found a buffer underflow in __hid_request(). Add a related test case for it. It's not perfect, but it allows to catch a corner case when a report descriptor is crafted so that it has a size of 0. Link: https://patch.msgid.link/20250710-report-size-null-v2-4-ccf922b7c4e5@kernel.org Signed-off-b...
```diff diff --git a/tools/testing/selftests/hid/tests/test_mouse.py b/tools/testing/selftests/hid/tests/test_mouse.py index 66daf7e5975c..eb4e15a0e53b 100644 --- a/tools/testing/selftests/hid/tests/test_mouse.py +++ b/tools/testing/selftests/hid/tests/test_mouse.py @@ -439,6 +439,68 @@ class BadResolutionMultiplierMou...
0d0777ccaa2d46609d05b66ba0096802a2746193
Analyze and fix the following issue in the Linux kernel code: HID: core: ensure __hid_request reserves the report ID as the first byte
Problem Details: The low level transport driver expects the first byte to be the report ID, even when the report ID is not use (in which case they just shift the buffer). However, __hid_request() whas not offsetting the buffer it used by one in this case, meaning that the raw_request() callback emitted by the transpor...
```diff diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 1a231dd9e4bc..320887c365f7 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1976,7 +1976,7 @@ static struct hid_report *hid_get_report(struct hid_report_enum *report_enum, int __hid_request(struct hid_device *hid, struct hid...
c4f96972c3c206ac8f6770b5ecd5320b561d0058
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix UMR modifying of mkey page size
Problem Details: When changing the page size on an mkey, the driver needs to set the appropriate bits in the mkey mask to indicate which fields are being modified. The 6th bit of a page size in mlx5 driver is considered an extension, and this bit has a dedicated capability and mask bits. Previously, the driver was not...
```diff diff --git a/drivers/infiniband/hw/mlx5/umr.c b/drivers/infiniband/hw/mlx5/umr.c index 5be4426a2884..25601dea9e30 100644 --- a/drivers/infiniband/hw/mlx5/umr.c +++ b/drivers/infiniband/hw/mlx5/umr.c @@ -32,13 +32,15 @@ static __be64 get_umr_disable_mr_mask(void) return cpu_to_be64(result); } -static __be64...
55f0bfc0370539213202f4ce1a07615327ac4713
Analyze and fix the following issue in the Linux kernel code: af_packet: fix soft lockup issue caused by tpacket_snd()
Problem Details: When MSG_DONTWAIT is not set, the tpacket_snd operation will wait for pending_refcnt to decrement to zero before returning. The pending_refcnt is decremented by 1 when the skb->destructor function is called, indicating that the skb has been successfully sent and needs to be destroyed. If an error occu...
```diff diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 7089b8c2a655..be608f07441f 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -2846,15 +2846,21 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) ph = packet_current_frame(po, &po->tx_ring, TP_STAT...
c1ba3c0cbdb5e53a8ec5d708e99cd4c497028a13
Analyze and fix the following issue in the Linux kernel code: af_packet: fix the SO_SNDTIMEO constraint not effective on tpacked_snd()
Problem Details: Due to the changes in commit 581073f626e3 ("af_packet: do not call packet_read_pending() from tpacket_destruct_skb()"), every time tpacket_destruct_skb() is executed, the skb_completion is marked as completed. When wait_for_completion_interruptible_timeout() returns completed, the pending_refcnt has no...
```diff diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 3d43f3eae759..7089b8c2a655 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -2785,7 +2785,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) int len_sum = 0; int status = TP_STATUS_AVAILABLE; int hle...
5e28d5a3f774f118896aec17a3a20a9c5c9dfc64
Analyze and fix the following issue in the Linux kernel code: net/sched: sch_qfq: Fix race condition on qfq_aggregate
Problem Details: A race condition can occur when 'agg' is modified in qfq_change_agg (called during qfq_enqueue) while other threads access it concurrently. For example, qfq_dump_class may trigger a NULL dereference, and qfq_delete_class may cause a use-after-free. This patch addresses the issue by: 1. Moved qfq_dest...
```diff diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c index bcce36608871..f0eb70353744 100644 --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c @@ -412,7 +412,7 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, bool existing = false; struct nlattr *tb[TCA_QFQ_MAX + 1]; struct...
7b41a2341fa62babda5d5c7a32c632e9eba2ee11
Analyze and fix the following issue in the Linux kernel code: power: supply: core: fix static checker warning
Problem Details: static checker complains, that the block already breaks if IS_ERR(np) and thus the extra !IS_ERR(np) check in the while condition is superfluous. Avoid the extra check by using while(true) instead. This should not change the runtime behavior at all and I expect the binary to be more or less the same fo...
```diff diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index aedb20c1d276..7c3913155dc0 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -212,7 +212,7 @@ static int __power_supply_populate_supplied_from(struct power...
e07caae73557d144a9237fb977dfee08befa015f
Analyze and fix the following issue in the Linux kernel code: selftests: cgroup: Fix missing newline in test_zswap_writeback_one
Problem Details: Fixes malformed test output due to missing newline Signed-off-by: Sebastian Chlad <sebastian.chlad@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
```diff diff --git a/tools/testing/selftests/cgroup/test_zswap.c b/tools/testing/selftests/cgroup/test_zswap.c index 40de679248b8..e1f578ca2841 100644 --- a/tools/testing/selftests/cgroup/test_zswap.c +++ b/tools/testing/selftests/cgroup/test_zswap.c @@ -338,7 +338,7 @@ static int test_zswap_writeback_one(const char *c...
c7d7713e36a6ab4c42e40c952d5ba7a51b1091b0
Analyze and fix the following issue in the Linux kernel code: selftests: cgroup: Allow longer timeout for kmem_dead_cgroups cleanup
Problem Details: The test_kmem_dead_cgroups test currently assumes that RCU and memory reclaim will complete within 5 seconds. In some environments this timeout may be insufficient, leading to spurious test failures. This patch introduces max_time set to 20 which is then used in the test. After 5th sec the debug messa...
```diff diff --git a/tools/testing/selftests/cgroup/test_kmem.c b/tools/testing/selftests/cgroup/test_kmem.c index 96693d8772be..63b3c9aad399 100644 --- a/tools/testing/selftests/cgroup/test_kmem.c +++ b/tools/testing/selftests/cgroup/test_kmem.c @@ -308,6 +308,7 @@ static int test_kmem_dead_cgroups(const char *root) ...
501b04d5a824015638d49d705d3a5ce05ca5ba5c
Analyze and fix the following issue in the Linux kernel code: arm64: dts: socfpga: swvp: remove altr,modrst-offset
Problem Details: 'altr,modrst-offset' property is not applicable for arm64 SoCFPGA platforms. This will fix this dtbs_check warning: socfpga_stratix10_swvp.dtb: rstmgr@ffd11000: altr,modrst-offset: False schema does not allow 32 Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10_swvp.dts b/arch/arm64/boot/dts/altera/socfpga_stratix10_swvp.dts index 34ccf8138f7b..33a765c9177d 100644 --- a/arch/arm64/boot/dts/altera/socfpga_stratix10_swvp.dts +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10_swvp.dts @@ -103,10 +103,6 @@ status...
1de7dfb3594033cff9882642ae404354e5f19627
Analyze and fix the following issue in the Linux kernel code: arm64: dts: socfpga: stratix10: fix dtbs_check for rstmgr
Problem Details: Add the default "altr,rst-mgr" to the rstmgr node on Stratix10. This fixes this warning: arch/arm64/boot/dts/altera:33:10 rstmgr@ffd11000 (altr,stratix10-rst-mgr): compatible: 'oneOf' conditional failed, one must be fixed: Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi index 0def0b0daaf7..f0f659139f22 100644 --- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi @@ -395,7 +395,7 @@ rst: rstmgr@ffd11000...
cd51991a21e7b4780cac3b17bf5d89d07df13266
Analyze and fix the following issue in the Linux kernel code: arm64: dts: socfpga: agilex: fix dtbs_check warning for f2s-free-clk
Problem Details: The f2s-free-clk requires a clock-frequency value. We put in an arbitrary value of 100 MHz for a constant. The true clock frequency would get generated in an FPGA design and the bootloader will populated in actual hardware designs. This fixes warning like this: arch/arm64/boot/dts/intel:34:8 4 ...
```diff diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi b/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi index a77a504effea..c1e66db0f4c5 100644 --- a/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +++ b/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi @@ -126,6 +126,7 @@ f2s_free_clk: f2s-free-clk { #cloc...
c0ffeb648000acdc932da7a9d33fd65e9263c54c
Analyze and fix the following issue in the Linux kernel code: md: allow removing faulty rdev during resync
Problem Details: During RAID resync, faulty rdev cannot be removed and will result in "Device or resource busy" error when attempting hot removal. Reproduction steps: mdadm -Cv /dev/md0 -l1 -n3 -e1.2 /dev/sd{b..d} mdadm /dev/md0 -f /dev/sdb mdadm /dev/md0 -r /dev/sdb -> mdadm: hot remove failed for /dev/sdb: D...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 7ae91155f2e4..046fe85c76fe 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -9459,17 +9459,11 @@ static bool md_spares_need_change(struct mddev *mddev) return false; } -static int remove_and_add_spares(struct mddev *mddev, - struct md_rdev *this...
9e59d609763f70a992a8f3808dabcce60f14eb5c
Analyze and fix the following issue in the Linux kernel code: md: call del_gendisk in control path
Problem Details: Now del_gendisk and put_disk are called asynchronously in workqueue work. The asynchronous way has a problem that the device node can still exist after mdadm --stop command returns in a short window. So udev rule can open this device node and create the struct mddev in kernel again. So put del_gendisk ...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 0f03b21e66e4..7445e44eabff 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -636,9 +636,6 @@ static void __mddev_put(struct mddev *mddev) mddev->ctime || mddev->hold_active) return; - /* Array is not configured at all, and not held active, so ...
f7546da1d6eb8928efb89b7faacbd6c2f8f0de5c
Analyze and fix the following issue in the Linux kernel code: media: v4l2: Add support for NV12M tiled variants to v4l2_format_info()
Problem Details: Commit 6f1466123d73 ("media: s5p-mfc: Add YV12 and I420 multiplanar format support") added support for the new formats to s5p-mfc driver, what in turn required some internal calls to the v4l2_format_info() function while setting up formats. This in turn broke support for the "old" tiled NV12MT* formats...
```diff diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index a9bd3ca0f281..6e585bc76367 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -323,6 +323,12 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) { .format...
33927f3d0ecdcff06326d6e4edb6166aed42811c
Analyze and fix the following issue in the Linux kernel code: habanalabs: fix UAF in export_dmabuf()
Problem Details: As soon as we'd inserted a file reference into descriptor table, another thread could close it. That's fine for the case when all we are doing is returning that descriptor to userland (it's a race, but it's a userland race and there's nothing the kernel can do about it). However, if we follow fd_inst...
```diff diff --git a/drivers/accel/habanalabs/common/memory.c b/drivers/accel/habanalabs/common/memory.c index 601fdbe70179..61472a381904 100644 --- a/drivers/accel/habanalabs/common/memory.c +++ b/drivers/accel/habanalabs/common/memory.c @@ -1829,9 +1829,6 @@ static void hl_release_dmabuf(struct dma_buf *dmabuf) str...
7e49538288e523427beedd26993d446afef1a6fb
Analyze and fix the following issue in the Linux kernel code: loop: Avoid updating block size under exclusive owner
Problem Details: Syzbot came up with a reproducer where a loop device block size is changed underneath a mounted filesystem. This causes a mismatch between the block device block size and the block size stored in the superblock causing confusion in various places such as fs/buffer.c. The particular issue triggered by s...
```diff diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 500840e4a74e..5cc72770e253 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1432,17 +1432,34 @@ static int loop_set_dio(struct loop_device *lo, unsigned long arg) return 0; } -static int loop_set_block_size(struct loop_device *l...
3051247e4faa32a3d90c762a243c2c62dde310db
Analyze and fix the following issue in the Linux kernel code: block: fix kobject leak in blk_unregister_queue
Problem Details: The kobject for the queue, `disk->queue_kobj`, is initialized with a reference count of 1 via `kobject_init()` in `blk_register_queue()`. While `kobject_del()` is called during the unregister path to remove the kobject from sysfs, the initial reference is never released. Add a call to `kobject_put()` ...
```diff diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index b2b9b89d6967..c611444480b3 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -960,4 +960,5 @@ void blk_unregister_queue(struct gendisk *disk) elevator_set_none(q); blk_debugfs_remove(disk); + kobject_put(&disk->queue_kobj); } ```
5f02b80c21e1511c32a37f642497751041069076
Analyze and fix the following issue in the Linux kernel code: Revert "eventpoll: Fix priority inversion problem"
Problem Details: This reverts commit 8c44dac8add7503c345c0f6c7962e4863b88ba42. I haven't figured out what the actual bug in this commit is, but I did spend a lot of time chasing it down and eventually succeeded in bisecting it down to this. For some reason, this eventpoll commit ends up causing delays and stuck user ...
```diff diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 895256cd2786..0fbf5dfedb24 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -137,7 +137,13 @@ struct epitem { }; /* List header used to link this structure to the eventpoll ready list */ - struct llist_node rdllink; + struct list_head rdllink; + + /* +...
a393644d7d161430207b9de167b798d05c7d684a
Analyze and fix the following issue in the Linux kernel code: net: ll_temac: Fix incorrect PHY node reference in debug message
Problem Details: In temac_probe(), the debug message intended to print the resolved PHY node was mistakenly using the controller node temac_np instead of the actual PHY node lp->phy_node. This patch corrects the log to reference the correct device tree node. Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com> Link: ...
```diff diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c index 6f82203a414c..711ed9c2631b 100644 --- a/drivers/net/ethernet/xilinx/ll_temac_main.c +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c @@ -1595,7 +1595,7 @@ static int temac_probe(struct platform_device *...
650fe2a9dd290078b782fb2e13dd4f5104a5de8b
Analyze and fix the following issue in the Linux kernel code: selftests: flip local/remote endpoints in iou-zcrx.py
Problem Details: The iou-zcrx selftest currently runs the server on the remote host and the client on the local host. This commit flips the endpoints such that server runs on localhost and client on remote. This change brings the iou-zcrx selftest in convention with other selftests. Drive-by fix for a missing import e...
```diff diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.py b/tools/testing/selftests/drivers/net/hw/iou-zcrx.py index 9c03fd777f3d..712c806508b5 100755 --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.py +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.py @@ -3,37 +3,37 @@ import re from os i...
7727ec1523d7973defa1dff8f9c0aad288d04008
Analyze and fix the following issue in the Linux kernel code: net: emaclite: Fix missing pointer increment in aligned_read()
Problem Details: Add missing post-increment operators for byte pointers in the loop that copies remaining bytes in xemaclite_aligned_read(). Without the increment, the same byte was written repeatedly to the destination. This update aligns with xemaclite_aligned_write() Fixes: bb81b2ddfa19 ("net: add Xilinx emac lite ...
```diff diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index ecf47107146d..4719d40a63ba 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -286,7 +286,7 @@ static void xemaclite_aligned_read(u32 *s...
d300335b4e18672913dd792ff9f49e6cccf41d26
Analyze and fix the following issue in the Linux kernel code: net_sched: act_ctinfo: use atomic64_t for three counters
Problem Details: Commit 21c167aa0ba9 ("net/sched: act_ctinfo: use percpu stats") missed that stats_dscp_set, stats_dscp_error and stats_cpmark_set might be written (and read) locklessly. Use atomic64_t for these three fields, I doubt act_ctinfo is used heavily on big SMP hosts anyway. Fixes: 24ec483cec98 ("net: sched...
```diff diff --git a/include/net/tc_act/tc_ctinfo.h b/include/net/tc_act/tc_ctinfo.h index f071c1d70a25..a04bcac7adf4 100644 --- a/include/net/tc_act/tc_ctinfo.h +++ b/include/net/tc_act/tc_ctinfo.h @@ -18,9 +18,9 @@ struct tcf_ctinfo_params { struct tcf_ctinfo { struct tc_action common; struct tcf_ctinfo_params _...
0346000aaab8cf8baf4ae40c48a5779a03971e80
Analyze and fix the following issue in the Linux kernel code: eth: fbnic: fix ubsan complaints about OOB accesses
Problem Details: UBSAN complains that we reach beyond the end of the log entry: UBSAN: array-index-out-of-bounds in drivers/net/ethernet/meta/fbnic/fbnic_fw_log.c:94:50 index 71 is out of range for type 'char [*]' Call Trace: <TASK> ubsan_epilogue+0x5/0x2b fbnic_fw_log_write+0x120/0x960 fbnic_...
```diff diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_fw_log.c b/drivers/net/ethernet/meta/fbnic/fbnic_fw_log.c index 38749d47cee6..c1663f042245 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_fw_log.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_fw_log.c @@ -91,16 +91,16 @@ int fbnic_fw_log_write(struct fbnic_d...
ec8e0e3d7adef940cdf9475e2352c0680189d14e
Analyze and fix the following issue in the Linux kernel code: net/sched: Restrict conditions for adding duplicating netems to qdisc tree
Problem Details: netem_enqueue's duplication prevention logic breaks when a netem resides in a qdisc tree with other netems - this can lead to a soft lockup and OOM loop in netem_dequeue, as seen in [1]. Ensure that a duplicating netem cannot exist in a tree with other netems. Previous approaches suggested in discussi...
```diff diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index fdd79d3ccd8c..eafc316ae319 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -973,6 +973,41 @@ static int parse_attr(struct nlattr *tb[], int maxtype, struct nlattr *nla, return 0; } +static const struct Qdisc_class_ops netem_...
3b07bb900af7f43f13f9ff398b4c6ca1dee217cd
Analyze and fix the following issue in the Linux kernel code: leds: lp8860: Check return value of devm_mutex_init()
Problem Details: devm_mutex_init() can fail. With CONFIG_DEBUG_MUTEXES=y the mutex will be marked as unusable and trigger errors on usage. Add the missed check. Fixes: 87a59548af95 ("leds: lp8860: Use new mutex guards to cleanup function exits") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Andrew ...
```diff diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c index 52b97c9f2a03..0962c00c215a 100644 --- a/drivers/leds/leds-lp8860.c +++ b/drivers/leds/leds-lp8860.c @@ -307,7 +307,9 @@ static int lp8860_probe(struct i2c_client *client) led->client = client; led->led_dev.brightness_set_blocking = l...
d24a54e032021cf381af3c3cf119cc5cf6b3c1be
Analyze and fix the following issue in the Linux kernel code: spi: spi-nxp-fspi: Check return value of devm_mutex_init()
Problem Details: devm_mutex_init() can fail. With CONFIG_DEBUG_MUTEXES=y the mutex will be marked as unusable and trigger errors on usage. Add the missed check. Fixes: 48900813abd2 ("spi: spi-nxp-fspi: remove the goto in probe") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Mark Brown <broonie@k...
```diff diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index e63c77e41823..f3d576505413 100644 --- a/drivers/spi/spi-nxp-fspi.c +++ b/drivers/spi/spi-nxp-fspi.c @@ -1273,7 +1273,9 @@ static int nxp_fspi_probe(struct platform_device *pdev) if (ret) return dev_err_probe(dev, ret, "Failed to req...
e908f58b6beb337cbe4481d52c3f5c78167b1aab
Analyze and fix the following issue in the Linux kernel code: vfio/pci: Separate SR-IOV VF dev_set
Problem Details: In the below noted Fixes commit we introduced a reflck mutex to allow better scaling between devices for open and close. The reflck was based on the hot reset granularity, device level for root bus devices which cannot support hot reset or bus/slot reset otherwise. Overlooked in this were SR-IOV VFs,...
```diff diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index 6328c3a05bcd..261a6dc5a5fc 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -2149,7 +2149,7 @@ int vfio_pci_core_register_device(struct vfio_pci_core_device *vdev) return -EBUSY; } ...
fe24d5bc635e103a517ec201c3cb571eeab8be2f
Analyze and fix the following issue in the Linux kernel code: vfio/pds: Fix missing detach_ioas op
Problem Details: When CONFIG_IOMMUFD is enabled and a device is bound to the pds_vfio_pci driver, the following WARN_ON() trace is seen and probe fails: WARNING: CPU: 0 PID: 5040 at drivers/vfio/vfio_main.c:317 __vfio_register_dev+0x130/0x140 [vfio] <...> pds_vfio_pci 0000:08:00.1: probe with driver pds_vfio_pci faile...
```diff diff --git a/drivers/vfio/pci/pds/vfio_dev.c b/drivers/vfio/pci/pds/vfio_dev.c index 76a80ae7087b..f6e0253a8a14 100644 --- a/drivers/vfio/pci/pds/vfio_dev.c +++ b/drivers/vfio/pci/pds/vfio_dev.c @@ -204,6 +204,7 @@ static const struct vfio_device_ops pds_vfio_ops = { .bind_iommufd = vfio_iommufd_physical_bind...
9f65592b7e1f24569bb6ced064df5b4319f725ce
Analyze and fix the following issue in the Linux kernel code: lib/crypto: x86/poly1305: Fix performance regression on short messages
Problem Details: Restore the len >= 288 condition on using the AVX implementation, which was incidentally removed by commit 318c53ae02f2 ("crypto: x86/poly1305 - Add block-only interface"). This check took into account the overhead in key power computation, kernel-mode "FPU", and tail handling associated with the AVX ...
```diff diff --git a/lib/crypto/x86/poly1305_glue.c b/lib/crypto/x86/poly1305_glue.c index 968d84677631..856d48fd422b 100644 --- a/lib/crypto/x86/poly1305_glue.c +++ b/lib/crypto/x86/poly1305_glue.c @@ -98,7 +98,15 @@ void poly1305_blocks_arch(struct poly1305_block_state *state, const u8 *inp, BUILD_BUG_ON(SZ_4K < PO...
16f2c30e290e04135b70ad374fb7e1d1ed9ff5e7
Analyze and fix the following issue in the Linux kernel code: lib/crypto: x86/poly1305: Fix register corruption in no-SIMD contexts
Problem Details: Restore the SIMD usability check and base conversion that were removed by commit 318c53ae02f2 ("crypto: x86/poly1305 - Add block-only interface"). This safety check is cheap and is well worth eliminating a footgun. While the Poly1305 functions should not be called when SIMD registers are unusable, if ...
```diff diff --git a/lib/crypto/x86/poly1305_glue.c b/lib/crypto/x86/poly1305_glue.c index b7e78a583e07..968d84677631 100644 --- a/lib/crypto/x86/poly1305_glue.c +++ b/lib/crypto/x86/poly1305_glue.c @@ -25,6 +25,42 @@ struct poly1305_arch_internal { struct { u32 r2, r1, r4, r3; } rn[9]; }; +/* + * The AVX code use...
eec76ea5a7213c48529a46eed1b343e5cee3aaab
Analyze and fix the following issue in the Linux kernel code: lib/crypto: arm64/poly1305: Fix register corruption in no-SIMD contexts
Problem Details: Restore the SIMD usability check that was removed by commit a59e5468a921 ("crypto: arm64/poly1305 - Add block-only interface"). This safety check is cheap and is well worth eliminating a footgun. While the Poly1305 functions should not be called when SIMD registers are unusable, if they are anyway, th...
```diff diff --git a/lib/crypto/arm64/poly1305-glue.c b/lib/crypto/arm64/poly1305-glue.c index c9a74766785b..31aea21ce42f 100644 --- a/lib/crypto/arm64/poly1305-glue.c +++ b/lib/crypto/arm64/poly1305-glue.c @@ -7,6 +7,7 @@ #include <asm/hwcap.h> #include <asm/neon.h> +#include <asm/simd.h> #include <crypto/interna...
52c3e242f4d0043186b70d65460ba1767f27494a
Analyze and fix the following issue in the Linux kernel code: lib/crypto: arm/poly1305: Fix register corruption in no-SIMD contexts
Problem Details: Restore the SIMD usability check that was removed by commit 773426f4771b ("crypto: arm/poly1305 - Add block-only interface"). This safety check is cheap and is well worth eliminating a footgun. While the Poly1305 functions should not be called when SIMD registers are unusable, if they are anyway, they...
```diff diff --git a/lib/crypto/arm/poly1305-glue.c b/lib/crypto/arm/poly1305-glue.c index 2603b0771f2c..ca6dc5533705 100644 --- a/lib/crypto/arm/poly1305-glue.c +++ b/lib/crypto/arm/poly1305-glue.c @@ -7,6 +7,7 @@ #include <asm/hwcap.h> #include <asm/neon.h> +#include <asm/simd.h> #include <crypto/internal/poly13...
982ddd59ed97dc7e63efd97ed50273ffb817bd41
Analyze and fix the following issue in the Linux kernel code: vfio: Prevent open_count decrement to negative
Problem Details: When vfio_df_close() is called with open_count=0, it triggers a warning in vfio_assert_device_open() but still decrements open_count to -1. This allows a subsequent open to incorrectly pass the open_count == 0 check, leading to unintended behavior, such as setting df->access_granted = true. For exampl...
```diff diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index 1fd261efc582..5046cae05222 100644 --- a/drivers/vfio/vfio_main.c +++ b/drivers/vfio/vfio_main.c @@ -583,7 +583,8 @@ void vfio_df_close(struct vfio_device_file *df) lockdep_assert_held(&device->dev_set->lock); - vfio_assert_device_open(...
b25e271b377999191b12f0afbe1861edcf57e3fe
Analyze and fix the following issue in the Linux kernel code: vfio: Fix unbalanced vfio_df_close call in no-iommu mode
Problem Details: For devices with no-iommu enabled in IOMMUFD VFIO compat mode, the group open path skips vfio_df_open(), leaving open_count at 0. This causes a warning in vfio_assert_device_open(device) when vfio_df_close() is called during group close. The correct behavior is to skip only the IOMMUFD bind in the dev...
```diff diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c index c321d442f0da..c376a6279de0 100644 --- a/drivers/vfio/group.c +++ b/drivers/vfio/group.c @@ -192,11 +192,10 @@ static int vfio_df_group_open(struct vfio_device_file *df) * implies they expected translation to exist */ if (!capable(CAP_SYS_...
b44686c8391b427fb1c85a31c35077e6947c6d90
Analyze and fix the following issue in the Linux kernel code: erofs: fix large fragment handling
Problem Details: Fragments aren't limited by Z_EROFS_PCLUSTER_MAX_DSIZE. However, if a fragment's logical length is larger than Z_EROFS_PCLUSTER_MAX_DSIZE but the fragment is not the whole inode, it currently returns -EOPNOTSUPP because m_flags has the wrong EROFS_MAP_ENCODED flag set. It is not intended by design but ...
```diff diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 0d19bde8c094..06b867d2fc3b 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -315,10 +315,12 @@ static inline struct folio *erofs_grab_folio_nowait(struct address_space *as, /* The length of extent is full */ #define EROFS_MAP_FULL_MAPPE...