id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
454bbe5913b2c56a3b4c5bf85138b5382ba8b8e6
Analyze and fix the following issue in the Linux kernel code: net: stmmac: fix PTP error cleanup in __stmmac_open()
Problem Details: The cleanup function for stmmac_setup_ptp() is stmmac_release_ptp() which entirely undoes the effects of stmmac_setup_ptp() by unregistering the PTP device and then stopping the PTP clock, whereas stmmac_hw_teardown() will only stop the PTP clock while leaving the PTP device registered. This can lead ...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 5d76cf7957ab..167405aac5b8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -4032,7 +4032,7 @@ irq_error: for (chan ...
66048f8b3cc7e462953c04285183cdee43a1cb89
Analyze and fix the following issue in the Linux kernel code: net/cls_cgroup: Fix task_get_classid() during qdisc run
Problem Details: During recent testing with the netem qdisc to inject delays into TCP traffic, we observed that our CLS BPF program failed to function correctly due to incorrect classid retrieval from task_get_classid(). The issue manifests in the following call stack: bpf_get_cgroup_classid+5 cls_bpf_...
```diff diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h index 7e78e7d6f015..668aeee9b3f6 100644 --- a/include/net/cls_cgroup.h +++ b/include/net/cls_cgroup.h @@ -63,7 +63,7 @@ static inline u32 task_get_classid(const struct sk_buff *skb) * calls by looking at the number of nested bh disable calls be...
bd1ce7ef6aef4ee7349eb3124166e712693650ce
Analyze and fix the following issue in the Linux kernel code: arm64: dts: allwinner: t527: orangepi-4a: hook up external 32k crystal
Problem Details: When the board was added, its external 32.768 KHz crystal was described but not hooked up correctly. This meant the device had to fall back to the SoC's internal oscillator or divide a 32 KHz clock from the main oscillator, neither of which are accurate for the RTC. As a result the RTC clock will drift...
```diff diff --git a/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts b/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts index d07bb9193b43..b5483bd7b8d5 100644 --- a/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts +++ b/arch/arm64/boot/dts/allwinner/sun55i-t527-orangepi-4a.dts @@ -346,6 +34...
3d5e1ba00af8dd34ae1e573c2c07e00b5ec65267
Analyze and fix the following issue in the Linux kernel code: arm64: dts: allwinner: t527: avaota-a1: hook up external 32k crystal
Problem Details: When the board was added, its external 32.768 KHz crystal was described but not hooked up correctly. This meant the device had to fall back to the SoC's internal oscillator or divide a 32 KHz clock from the main oscillator, neither of which are accurate for the RTC. As a result the RTC clock will drift...
```diff diff --git a/arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts b/arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts index e7713678208d..4e71055fbd15 100644 --- a/arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts +++ b/arch/arm64/boot/dts/allwinner/sun55i-t527-avaota-a1.dts @@ -309,6 +309,14 @@ ...
9f01e1e14e71defefcb4d6823b8476a15f3cf04a
Analyze and fix the following issue in the Linux kernel code: arm64: dts: allwinner: a527: cubie-a5e: Drop external 32.768 KHz crystal
Problem Details: The Radxa Cubie A5E has empty pads for a 32.768 KHz crystal, but it is left unpopulated, as per the schematics and seen on board images. A dead give away is the RTC's LOSC auto switch register showing the external OSC to be abnormal. Drop the external crystal from the device tree. It was not reference...
```diff diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts b/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts index d4cee2222104..514c221a7a86 100644 --- a/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +++ b/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts @@ -21,13 +21,6 @@ ...
be5ae730ffa6fd774a00a4705c1e11e078b08ca1
Analyze and fix the following issue in the Linux kernel code: usb: typec: tipd: Clear interrupts first
Problem Details: Right now the interrupt handler first reads all updated status registers and only then clears the interrupts. It's possible that a duplicate interrupt for a changed register or plug state comes in after the interrupts have been processed but before they have been cleared: * plug is inserted, TPS_REG_I...
```diff diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index dcf141ada078..1c80296c3b27 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -545,24 +545,23 @@ static irqreturn_t cd321x_interrupt(int irq, void *data) if (!event) goto err_unlock; + tps6598x...
ec8f26092e525ee3cb1a56d455109fd40bfff3ef
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/realtek: Add ALC295 Dell TAS2781 I2C fixup
Problem Details: This patch adds a new fixup for the ALC295 codec on some Dell laptops that use the TAS2781 I2C amplifier. The fixup correctly initializes the amplifier and pins, allowing sound to work on all speakers of these devices. The fixup chain is added to the relevant quirk entries for Dell Polaris models. [...
```diff diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c index 85bb8c4d3b17..59cc01079fee 100644 --- a/sound/hda/codecs/realtek/alc269.c +++ b/sound/hda/codecs/realtek/alc269.c @@ -3702,6 +3702,7 @@ enum { ALC236_FIXUP_DELL_DUAL_CODECS, ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI, A...
48633acccf38d706d7b368400647bb9db9caf1ae
Analyze and fix the following issue in the Linux kernel code: Input: cros_ec_keyb - Defer probe until parent EC device is registered
Problem Details: The `cros_ec_keyb` driver can be probed before the cros_ec_device has completed the registration. This creates a race condition where `cros_ec_keyb` might access uninitialized data. Fix this by calling `cros_ec_device_registered()` to check the parent's status. If the device is not yet ready, return...
```diff diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index c1e53d87c8a7..f7209c8ebbcc 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -705,6 +705,12 @@ static int cros_ec_keyb_probe(struct platform_device *pdev) ec = dev_g...
56cb557279d70397cefb497e0f06bdd6fd685f8e
Analyze and fix the following issue in the Linux kernel code: platform/chrome: cros_ec: Add a flag to track registration state
Problem Details: Introduce a `registered` flag to the `struct cros_ec_device` to allow callers to determine if the device has been fully registered and is ready for use. This is a preparatory step to prevent race conditions where other drivers might try to access the device before it is fully registered or after it ha...
```diff diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c index 61bcef8741db..1da79e3d215b 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -9,6 +9,7 @@ * battery charging and regulator control, firmware update. */ +#include <linux/cleanup....
d6d5116391857fc78fad9aa42317b36e4ce17b58
Analyze and fix the following issue in the Linux kernel code: kexec: introduce is_kho_boot()
Problem Details: Patch series "efi: Fix EFI boot with kexec handover (KHO)", v3. This patch series fixes a kernel panic that occurs when booting with both EFI and KHO (Kexec HandOver) enabled. The issue arises because EFI's `reserve_regions()` clears all memory regions with `memblock_remove(0, PHYS_ADDR_MAX)` before ...
```diff diff --git a/include/linux/kexec_handover.h b/include/linux/kexec_handover.h index 348844cffb13..559d13a3bc44 100644 --- a/include/linux/kexec_handover.h +++ b/include/linux/kexec_handover.h @@ -40,6 +40,7 @@ struct kho_serialization; #ifdef CONFIG_KEXEC_HANDOVER bool kho_is_enabled(void); +bool is_kho_boot...
913e65a2fe1a16fa253c4a016e2306b2cf9ffef8
Analyze and fix the following issue in the Linux kernel code: crash: add KUnit tests for crash_exclude_mem_range
Problem Details: crash_exclude_mem_range seems to be a simple function but there have been multiple attempts to fix it, - commit a2e9a95d2190 ("kexec: Improve & fix crash_exclude_mem_range() to handle overlapping ranges") - commit 6dff31597264 ("crash_core: fix and simplify the logic of crash_exclude_mem_range(...
```diff diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec index 1224dd937df0..422270d64820 100644 --- a/kernel/Kconfig.kexec +++ b/kernel/Kconfig.kexec @@ -148,6 +148,17 @@ config CRASH_DM_CRYPT_CONFIGS CRASH_DM_CRYPT cannot directly select CONFIGFS_FS, because that is required to be built-in. +config ...
d337f4524861f4e74c31ee575d60f2eaa1e82388
Analyze and fix the following issue in the Linux kernel code: x86/kexec: fix potential cmem->ranges out of memory
Problem Details: In memmap_exclude_ranges(), elfheader will be excluded from crashk_res. In the current x86 architecture code, the elfheader is always allocated at crashk_res.start. It seems that there won't be a new split range. But it depends on the allocation position of elfheader in crashk_res. To avoid potenti...
```diff diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index 60bb24ddd36f..335fd2ee9766 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -165,8 +165,18 @@ static struct crash_mem *fill_up_crash_elf_data(void) /* * Exclusion of crash region, crashk_low_res and/or crashk_cma_rang...
13f23538ef49a96a1b8ba9d61bd778de65f00613
Analyze and fix the following issue in the Linux kernel code: fs/proc/base.c: fix the wrong format specifier
Problem Details: Use '%d' instead of '%u' for int. Link: https://lkml.kernel.org/r/20250903083948.2536-1-zhangjiao2@cmss.chinamobile.com Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Christian Brauner <brauner@kernel.org> Cc: Frederic Weisbecker <frederic@kernel....
```diff diff --git a/fs/proc/base.c b/fs/proc/base.c index 62d35631ba8c..569c93c9f927 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -3945,7 +3945,7 @@ static int proc_task_readdir(struct file *file, struct dir_context *ctx) tid = task_pid_nr_ns(task, ns); if (!tid) continue; /* The task has just exited....
fe7a283b39160153b6d1bd7f61b0a9d5d44987a8
Analyze and fix the following issue in the Linux kernel code: ocfs2: add suballoc slot check in ocfs2_validate_inode_block()
Problem Details: In 'ocfs2_validate_inode_block()', add suballoc slot check similar to one in 'ocfs2_get_suballoc_slot_bit()', thus preventing an out-of-bounds accesses for 'local_system_inodes' in 'get_local_system_inode()'. Most likely this fixes https://syzkaller.appspot.com/bug?extid=a77d690840e60bc2ddd8 as well. ...
```diff diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 6c4f78f473fb..fcc89856ab95 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -1495,6 +1495,14 @@ int ocfs2_validate_inode_block(struct super_block *sb, goto bail; } + if (le16_to_cpu(di->i_suballoc_slot) != (u16)OCFS2_INVALID_SLOT && + (u32...
17bdc64c0d419b78bb400c221d36eaa391d16b3a
Analyze and fix the following issue in the Linux kernel code: selftests: proc: mark vsyscall strings maybe-unused
Problem Details: The str_vsyscall_* constants in proc-pid-vm.c triggers -Wunused-const-variable warnings with gcc-13.32 and clang 18.1. Define and apply __maybe_unused locally to suppress the warnings. No functional change Fixes compiler warning: warning: `str_vsyscall_*' defined but not used[-Wunused-const-variable...
```diff diff --git a/tools/testing/selftests/proc/proc-pid-vm.c b/tools/testing/selftests/proc/proc-pid-vm.c index d04685771952..978cbcb3eb11 100644 --- a/tools/testing/selftests/proc/proc-pid-vm.c +++ b/tools/testing/selftests/proc/proc-pid-vm.c @@ -47,6 +47,10 @@ #include <sys/resource.h> #include <linux/fs.h> +#...
3d5f4f15b778d6da9760d54455cc256ecf924c0a
Analyze and fix the following issue in the Linux kernel code: watchdog: skip checks when panic is in progress
Problem Details: This issue was found when an EFI pstore was configured for kdump logging with the NMI hard lockup detector enabled. The efi-pstore write operation was slow, and with a large number of logs, the pstore dump callback within kmsg_dump() took a long time. This delay triggered the NMI watchdog, leading to...
```diff diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 5413aa85e8a4..5b62d1002783 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -752,6 +752,12 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) if (!watchdog_enabled) return HRTIMER_NORESTART; + /* + * pass the buddy ...
d0d9c7235548f1d772f1e48c9d5742c65d81c705
Analyze and fix the following issue in the Linux kernel code: panic: introduce helper functions for panic state
Problem Details: Patch series "panic: introduce panic status function family", v2. This series introduces a family of helper functions to manage panic state and updates existing code to use them. Before this series, panic state helpers were scattered and inconsistent. For example, panic_in_progress() was defined in ...
```diff diff --git a/include/linux/panic.h b/include/linux/panic.h index 7be742628c25..6f972a66c13e 100644 --- a/include/linux/panic.h +++ b/include/linux/panic.h @@ -43,6 +43,12 @@ void abort(void); extern atomic_t panic_cpu; #define PANIC_CPU_INVALID -1 +bool panic_try_start(void); +void panic_reset(void); +bool ...
493977de1469b9898e178c9aab5fd498c4083da7
Analyze and fix the following issue in the Linux kernel code: ocfs2: fix super block reserved field offset comment
Problem Details: The offset annotation for s_reserved2 in struct ocfs2_super_block was incorrect. After the preceding fields: - s_xattr_inline_size (2 bytes at 0xB8) - s_reserved0 (2 bytes at 0xBA) - s_dx_seed[3] (12 bytes at 0xBC) The actual offset of s_reserved2 is at 0xC8, when calculating from the start of the str...
```diff diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h index e8e94599e907..ae0e44e5f2ad 100644 --- a/fs/ocfs2/ocfs2_fs.h +++ b/fs/ocfs2/ocfs2_fs.h @@ -614,7 +614,7 @@ struct ocfs2_super_block { __le16 s_reserved0; __le32 s_dx_seed[3]; /* seed[0-2] for dx dir hash. * s_uuid_hash serves as seed[3]. */...
95f091274f3db39493e8b5c44671b9f1e02c0c25
Analyze and fix the following issue in the Linux kernel code: watchdog/softlockup: fix incorrect CPU utilization output during softlockup
Problem Details: Since we use 16-bit precision, the raw data will undergo integer division, which may sometimes result in data loss. This can lead to slightly inaccurate CPU utilization calculations. Under normal circumstances, this isn't an issue. However, when CPU utilization reaches 100%, the calculated result mi...
```diff diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 9c7134f7d2c4..5413aa85e8a4 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -425,7 +425,11 @@ static DEFINE_PER_CPU(u8, cpustat_tail); */ static u16 get_16bit_precision(u64 data_ns) { - return data_ns >> 24LL; /* 2^24ns ~= 16.8ms */ + /* + *...
41f88ddfd453fe894678e1f6909b9fb9e08e8c3d
Analyze and fix the following issue in the Linux kernel code: watchdog/softlockup: fix wrong output when watchdog_thresh < 3
Problem Details: When watchdog_thresh is below 3, sample_period will be less than 1 second. So the following output will print when softlockup: CPU#3 Utilization every 0s during lockup Fix this by changing time unit from seconds to milliseconds. Link: https://lkml.kernel.org/r/20250812074132.27810-1-yaozhenguo@jd.co...
```diff diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 80b56c002c7f..9c7134f7d2c4 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -455,17 +455,17 @@ static void print_cpustat(void) { int i, group; u8 tail = __this_cpu_read(cpustat_tail); - u64 sample_period_second = sample_period; + u64 sample_...
bc107a619f029415e0a87e6df16f995553da4568
Analyze and fix the following issue in the Linux kernel code: squashfs: verify inode mode when loading from disk
Problem Details: The inode mode loaded from corrupted disk might by error contain the file type bits. Since the file type bits are set by squashfs_read_inode() using bitwise OR, the file type bits must not be set by squashfs_new_inode() from squashfs_read_inode(); otherwise, an invalid file type bits later confuses ma...
```diff diff --git a/fs/squashfs/inode.c b/fs/squashfs/inode.c index d5918eba27e3..dee8fa016930 100644 --- a/fs/squashfs/inode.c +++ b/fs/squashfs/inode.c @@ -68,6 +68,10 @@ static int squashfs_new_inode(struct super_block *sb, struct inode *inode, inode->i_mode = le16_to_cpu(sqsh_ino->mode); inode->i_size = 0; +...
a6cf527e66b8ea7b3119a354a873ebfa57ea225e
Analyze and fix the following issue in the Linux kernel code: checkpatch: allow http links of any length in commit logs
Problem Details: Dave Gilbert noticed that checkpatch warns about URL links over 75 chars in length in commit logs. Fix that. Link: https://lkml.kernel.org/r/3529faaf84a5a9a96c5c0ec4183ae0ba6e97673c.camel@perches.com Signed-off-by: Joe Perches <joe@perches.com> Cc: Dave Gilbert <linux@treblig.org> Signed-off-by: Andr...
```diff diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e722dd6fa8ef..319cc5f85885 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3294,7 +3294,7 @@ sub process { # file delta changes $line =~ /^\s*(?:[\w\.\-\+]*\/)++[\w\.\-\+]+:/ || # filename then : - $l...
103e90626d3a4032d22e8b09ff14600e71cda59c
Analyze and fix the following issue in the Linux kernel code: maple_tree: testing fix for spanning store on 32b
Problem Details: 32 bit nodes have a larger branching factor. This affects the required value to cause a height change. Update the spanning store height test to work for both 64 and 32 bit nodes. Link: https://lkml.kernel.org/r/20250828003023.418966-3-Liam.Howlett@oracle.com Fixes: f9d3a963fef4 ("maple_tree: use hei...
```diff diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 90a0db45a33c..05714c22994e 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -36327,13 +36327,18 @@ extern void test_kmem_cache_bulk(void); static inline void check_spanning_store_height...
82b5fe3059a52e1419521ac32703208d03bb15e9
Analyze and fix the following issue in the Linux kernel code: maple_tree: fix testing for 32 bit builds
Problem Details: Patch series "maple_tree: Fix testing for 32bit compiles". The maple tree test suite supports 32bit builds which causes 32bit nodes and index/last values. Some tests have too large values and must be skipped while others depend on certain actions causing the tree to be altered in another measurable w...
```diff diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 172700fb7784..90a0db45a33c 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -36428,6 +36428,7 @@ static void check_nomem_writer_race(struct maple_tree *mt) */ static inline int check...
b55102826d7d3d41a5777931689c746207308c95
Analyze and fix the following issue in the Linux kernel code: btrfs: set AS_KERNEL_FILE on the btree_inode
Problem Details: extent_buffers are global and shared so their pages should not belong to any particular cgroup (currently whichever cgroups happens to allocate the extent_buffer). Btrfs tree operations should not arbitrarily block on cgroup reclaim or have the shared extent_buffer pages on a cgroup's reclaim lists. ...
```diff diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 70fc4e7cc5a0..7fab5057cf8e 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1930,6 +1930,7 @@ static int btrfs_init_btree_inode(struct super_block *sb) BTRFS_I(inode)->root = btrfs_grab_root(fs_info->tree_root); set_bit(BTRFS_INODE_DUMMY...
e3a9ac4e866ea746475b4026819a8c08ec1142e6
Analyze and fix the following issue in the Linux kernel code: mm: add vmstat for kernel_file pages
Problem Details: Kernel file pages are tricky to track because they are indistinguishable from files whose usage is accounted to the root cgroup. To maintain good accounting, introduce a vmstat counter tracking kernel file pages. Confirmed that these work as expected at a high level by mounting a btrfs using AS_KERNE...
```diff diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index fe13ad175fed..f3272ef5131b 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -259,6 +259,7 @@ enum node_stat_item { NR_HUGETLB, #endif NR_BALLOON_PAGES, + NR_KERNEL_FILE_PAGES, NR_VM_NODE_STAT_ITEMS }; diff --git a/mm...
cf1dec76ba8a00b20e51d205f3c9f5c45bc96df2
Analyze and fix the following issue in the Linux kernel code: mm/filemap: add AS_KERNEL_FILE
Problem Details: Patch series "introduce kernel file mapped folios", v4. Btrfs currently tracks its metadata pages in the page cache, using a fake inode (fs_info->btree_inode) with offsets corresponding to where the metadata is stored in the filesystem's full logical address space. A consequence of this is that when ...
```diff diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 9fa3afc90dd5..e693978b2022 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1059,6 +1059,8 @@ extern int mem_cgroup_init(void); #define MEM_CGROUP_ID_SHIFT 0 +#define root_mem_cgroup (NULL) + static inl...
1580cd50b6d40af81fe48611ef7a60545eb8d40b
Analyze and fix the following issue in the Linux kernel code: selftests/mm/uffd-stress: stricten constraint on free hugepages needed before the test
Problem Details: The test requires at least 2 * (bytes/page_size) hugetlb memory, since we require identical number of hugepages for src and dst location. Fix this. Along with the above, as explained in patch "selftests/mm/uffd-stress: Make test operate on less hugetlb memory", the racy nature of the test requires th...
```diff diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c index c0f64df5085c..ecd016329935 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -448,12 +448,6 @@ int main(int argc, char **argv) parse_test_type_arg(argv[1...
060b6c72ce94ebd1190842e81eb9675d7400c5f6
Analyze and fix the following issue in the Linux kernel code: selftests/mm/uffd-stress: make test operate on less hugetlb memory
Problem Details: Patch series "selftests/mm: uffd-stress fixes", v2. This patchset ensures that the number of hugepages is correctly set in the system so that the uffd-stress test does not fail due to the racy nature of the test. Patch 1 changes the hugepage constraint in the run_vmtests.sh script, whereas patch 2 ch...
```diff diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 514fab5a20ef..2c06557ee95d 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6932,6 +6932,11 @@ int hugetlb_mfill_atomic_pte(pte_t *dst_pte, folio = alloc_hugetlb_folio(dst_vma, dst_addr, false); if (IS_ERR(folio)) { + pte_t *actual_pte = hugetlb_walk(dst_...
ef49b7b39d50b9e4f9d63e64f5d8acafe3c71158
Analyze and fix the following issue in the Linux kernel code: maple_tree: fix MAPLE_PARENT_RANGE32 and parent pointer docs
Problem Details: MAPLE_PARENT_RANGE32 should be 0x02 as a 32 bit node is indicated by the bit pattern 0b010 which is the hex value 0x02. There are no users currently, so there is no associated bug with this wrong value. Fix typo Note -> Node and replace x with b to indicate binary values. Link: https://lkml.kernel.o...
```diff diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index bafe143b1f78..41e633264e51 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -57,17 +57,17 @@ * MT_FLAGS_ALLOC_RANGE flag. * * Node types: - * 0x??1 = Root - * 0x?00 = 16 bit nodes - * 0x010 = 32 bi...
79dfed097680084f3d4716fa2c5bc945233bd2c0
Analyze and fix the following issue in the Linux kernel code: selftests/mm: use calloc instead of malloc in pagemap_ioctl.c
Problem Details: As per Documentation/process/deprecated.rst, dynamic size calculations should not be performed in memory allocator arguments due to possible overflows. Replace malloc with calloc to avoid open-ended arithmetic and prevent possible overflows. Link: https://lkml.kernel.org/r/20250825170643.63174-1-visw...
```diff diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index e6face7c0166..4fc8e578ec7c 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -209,7 +209,7 @@ int userfaultfd_tests(void) wp_addr_range(mem, mem_...
786eb990cfb78aab94eb74fb32a030e14723a620
Analyze and fix the following issue in the Linux kernel code: drivers/base/node: handle error properly in register_one_node()
Problem Details: If register_node() returns an error, it is not handled correctly. The function will proceed further and try to register CPUs under the node, which is not correct. So, in this patch, if register_node() returns an error, we return immediately from the function. Link: https://lkml.kernel.org/r/202508220...
```diff diff --git a/drivers/base/node.c b/drivers/base/node.c index 3399594136b2..45d512939c40 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -885,6 +885,11 @@ int register_one_node(int nid) node_devices[nid] = node; error = register_node(node_devices[nid], nid); + if (error) { + node_devices[nid...
a7498388b099f08219bad5f19d00e436da27fbf9
Analyze and fix the following issue in the Linux kernel code: selftests: centralise maybe-unused definition in kselftest.h
Problem Details: Several selftests subdirectories duplicated the define __maybe_unused, leading to redundant code. Move to kselftest.h header and remove other definitions. This addresses the duplication noted in the proc-pid-vm warning fix Link: https://lkml.kernel.org/r/20250821101159.2238-1-reddybalavignesh9979@gm...
```diff diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h index c3b6d2604b1e..661d31c4b558 100644 --- a/tools/testing/selftests/kselftest.h +++ b/tools/testing/selftests/kselftest.h @@ -92,6 +92,10 @@ #endif #define __printf(a, b) __attribute__((format(printf, a, b))) +#ifndef...
940b1be22578dc67a0aa78338177b97b9a13eb8b
Analyze and fix the following issue in the Linux kernel code: kselftest: mm: fix typos in test_vmalloc.sh
Problem Details: Fix simple typos in function name and console message. Link: https://lkml.kernel.org/r/20250823170208.184149-1-allyheev@gmail.com Signed-off-by: ally heev <allyheev@gmail.com> Cc: David Hildenbrand <david@redhat.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation...
```diff diff --git a/tools/testing/selftests/mm/test_vmalloc.sh b/tools/testing/selftests/mm/test_vmalloc.sh index d73b846736f1..d39096723fca 100755 --- a/tools/testing/selftests/mm/test_vmalloc.sh +++ b/tools/testing/selftests/mm/test_vmalloc.sh @@ -47,14 +47,14 @@ check_test_requirements() fi } -run_perfformance...
658fa653b4d17715c6b4c3686dabbfee6eb15e51
Analyze and fix the following issue in the Linux kernel code: mm, x86/mm: move creating the tlb_flush event back to x86 code
Problem Details: Commit e73ad5ff2f76 ("mm, x86/mm: Make the batched unmap TLB flush API more generic") moved the trace_tlb_flush out of mm/rmap.c and back into x86 specific architecture, but it kept the include to the events/tlb.h file, even though it didn't use that event. Then another commit came in and added more e...
```diff diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index bb57e93b4caf..8bf6ad4b9400 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -34,6 +34,7 @@ * We need to define the tracepoints somewhere, and tlb.c * is only compiled when SMP=y. */ +#define CREATE_TRACE_POINTS #include <trace/events/t...
63ec0c26b682ca235953490dfa82b8fa4d4ab4a0
Analyze and fix the following issue in the Linux kernel code: tmpfs: preserve SB_I_VERSION on remount
Problem Details: Now tmpfs enables i_version by default and tmpfs does not modify it. But SB_I_VERSION can also be modified via sb_flags, and reconfigure_super() always overwrites the existing flags with the latest ones. This means that if tmpfs is remounted without specifying iversion, the default i_version will be ...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index d945de3a7f0e..13cc51df3893 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -5081,7 +5081,7 @@ static int shmem_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_flags |= SB_NOUSER; } sb->s_export_op = &shmem_export_ops; - sb->s_flags |= SB_NOSEC | SB_I...
9eff16bd3a4b97b3e13337eddaa12abe6e0b2a78
Analyze and fix the following issue in the Linux kernel code: mm/huge_memory: add new_order and offset to split_huge_pages*() pr_debug
Problem Details: Patch series "Better split_huge_page_test result check", v5. This patchset uses kpageflags to get after-split folio orders for a better split_huge_page_test result check[1]. The added gather_after_split_folio_orders() scans through a VPN range and collects the numbers of folios at different orders. ...
```diff diff --git a/mm/huge_memory.c b/mm/huge_memory.c index aac5f0a2cb54..2a47cd3bb649 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -4320,8 +4320,8 @@ static int split_huge_pages_pid(int pid, unsigned long vaddr_start, goto out; } - pr_debug("Split huge pages in pid: %d, vaddr: [0x%lx - 0x%lx]\n", ...
4bd22a7ae5742df90abfdc0931a0f1bded65c1de
Analyze and fix the following issue in the Linux kernel code: mm: fix duplicate accounting of free pages in should_reclaim_retry()
Problem Details: In the zone_reclaimable_pages() function, if the page counts for NR_ZONE_INACTIVE_FILE, NR_ZONE_ACTIVE_FILE, NR_ZONE_INACTIVE_ANON, and NR_ZONE_ACTIVE_ANON are all zero, the function returns the number of free pages as the result. In this case, when should_reclaim_retry() calculates reclaimable pages,...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index e336577c4454..c88eb223ade2 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -398,14 +398,7 @@ unsigned long zone_reclaimable_pages(struct zone *zone) if (can_reclaim_anon_pages(NULL, zone_to_nid(zone), NULL)) nr += zone_page_state_snapshot(zone, NR_ZONE_INACTIVE_AN...
4e915656a38afe8aeebb283493f49c22d675a9fc
Analyze and fix the following issue in the Linux kernel code: mm/damon/Kconfig: make DAMON_STAT_ENABLED_DEFAULT depend on DAMON_STAT
Problem Details: The DAMON_STAT_ENABLED_DEFAULT option is strongly tied to DAMON_STAT option -- enabling it alone is meaningless. This patch makes DAMON_STAT_ENABLED_DEFAULT depend on DAMON_STAT, ensuring functional consistency. Link: https://lkml.kernel.org/r/20250815092110.811757-1-lienze@kylinos.cn Fixes: 369c415e...
```diff diff --git a/mm/damon/Kconfig b/mm/damon/Kconfig index b3171f9406c1..8c868f7035fc 100644 --- a/mm/damon/Kconfig +++ b/mm/damon/Kconfig @@ -104,7 +104,7 @@ config DAMON_STAT config DAMON_STAT_ENABLED_DEFAULT bool "Enable DAMON_STAT by default" - depends on DAMON_PADDR + depends on DAMON_STAT default DAMON...
e338d83531540c6cda4bdc8de52aaae186d8a97c
Analyze and fix the following issue in the Linux kernel code: mm: readahead: improve mmap_miss heuristic for concurrent faults
Problem Details: If two or more threads of an application faulting on the same folio, the mmap_miss counter can be decreased multiple times. It breaks the mmap_miss heuristic and keeps the readahead enabled even under extreme levels of memory pressure. It happens often if file folios backing a multi-threaded applicat...
```diff diff --git a/mm/filemap.c b/mm/filemap.c index d1fb0b12bff2..1a388b11cfa9 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3323,9 +3323,17 @@ static struct file *do_async_mmap_readahead(struct vm_fault *vmf, if (vmf->vma->vm_flags & VM_RAND_READ || !ra->ra_pages) return fpin; - mmap_miss = READ_ONCE(ra->...
2d941088f4570f50df8a079b3ca25c392226fb38
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix child process exit codes in ksm_functional_tests
Problem Details: In ksm_functional_tests, test_child_ksm() returned negative values to indicate errors. However, when passed to exit(), these were interpreted as large unsigned values (e.g, -2 became 254), leading to incorrect handling in the parent process. As a result, some tests appeared to be skipped or silently ...
```diff diff --git a/tools/testing/selftests/mm/ksm_functional_tests.c b/tools/testing/selftests/mm/ksm_functional_tests.c index 996dc6645570..534aa405cac7 100644 --- a/tools/testing/selftests/mm/ksm_functional_tests.c +++ b/tools/testing/selftests/mm/ksm_functional_tests.c @@ -512,14 +512,14 @@ static int test_child_k...
7bc857ddeeaa35a059f6e645365526e10e1f3511
Analyze and fix the following issue in the Linux kernel code: mm/selftests: fix split_huge_page_test failure on systems with 64KB page size
Problem Details: The split_huge_page_test fails on systems with a 64KB base page size. This is because the order of a 2MB huge page is different: On 64KB systems, the order is 5. On 4KB systems, it's 9. The test currently assumes a maximum huge page order of 9, which is only valid for 4KB base page systems. On sys...
```diff diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c index c744c603d688..b51fbeb93751 100644 --- a/tools/testing/selftests/mm/cow.c +++ b/tools/testing/selftests/mm/cow.c @@ -41,11 +41,6 @@ static size_t hugetlbsizes[10]; static int gup_fd; static bool has_huge_zeropage; -static ...
08c907c5bc0ae8c9f0741c9622366ed30a1f6232
Analyze and fix the following issue in the Linux kernel code: selftest/mm: fix ksm_funtional_test failures
Problem Details: This patch fixes 2 issues. 1) After fork() in test_prctl_fork, the child process uses the file descriptors from the parent process to read ksm_stat and ksm_merging_pages. This results in incorrect values being read (parent process ksm_stat and ksm_merging_pages will be read in child), causin...
```diff diff --git a/tools/testing/selftests/mm/ksm_functional_tests.c b/tools/testing/selftests/mm/ksm_functional_tests.c index d8bd1911dfc0..996dc6645570 100644 --- a/tools/testing/selftests/mm/ksm_functional_tests.c +++ b/tools/testing/selftests/mm/ksm_functional_tests.c @@ -46,6 +46,8 @@ static int ksm_use_zero_pag...
eda0bf339b41a948af745e0b17db56037813c04f
Analyze and fix the following issue in the Linux kernel code: mm/selftests: fix incorrect pointer being passed to mark_range()
Problem Details: Patch series "selftests/mm: Fix false positives and skip unsupported tests", v4. This patch series addresses false positives in the generic mm selftests and skips tests that cannot run correctly due to missing features or system limitations. This patch (of 7): In main(), the high address is stored ...
```diff diff --git a/tools/testing/selftests/mm/virtual_address_range.c b/tools/testing/selftests/mm/virtual_address_range.c index 169dbd692bf5..e24c36a39f22 100644 --- a/tools/testing/selftests/mm/virtual_address_range.c +++ b/tools/testing/selftests/mm/virtual_address_range.c @@ -227,7 +227,7 @@ int main(int argc, ch...
e4fe1388dfbdd9641331071cd9b4a9efa16da34d
Analyze and fix the following issue in the Linux kernel code: mm: fix typos in VMA comments
Problem Details: Fix the following typos in VMA-related files: 1. "operationr" -> "operation" in mm/vma.h 2. "initialisaing" -> "initializing" in mm/vma_init.c Link: https://lkml.kernel.org/r/20250814073800.13617-1-ye.liu@linux.dev Signed-off-by: Ye Liu <liuye@kylinos.cn> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...
```diff diff --git a/mm/vma.h b/mm/vma.h index b123a9cdedb0..bcdc261c5b15 100644 --- a/mm/vma.h +++ b/mm/vma.h @@ -145,7 +145,7 @@ struct vma_merge_struct { */ bool __remove_middle :1; /* - * Internal flag used during the merge operationr to indicate we will + * Internal flag used during the merge operation to...
0c04015d45e6f102e14bde69b05a0a0591923248
Analyze and fix the following issue in the Linux kernel code: mm/page_alloc: simplify lowmem_reserve max calculation
Problem Details: Use max() to find the maximum lowmem_reserve value and min_t() to cap it to managed_pages in calculate_totalreserve_pages(), instead of open-coding the comparisons. No functional change. [liuye@kylinos.cn: fix layout, use min_t] Link: https://lkml.kernel.org/r/20250815024509.37900-1-ye.liu@linux.de...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 09241bb7663e..fd55ca824c47 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6236,16 +6236,13 @@ static void calculate_totalreserve_pages(void) unsigned long managed_pages = zone_managed_pages(zone); /* Find valid and maximum lowmem_reserve in ...
6a204d4b14c99232e05d35305c27ebce1c009840
Analyze and fix the following issue in the Linux kernel code: mm/page_alloc: only set ALLOC_HIGHATOMIC for __GPF_HIGH allocations
Problem Details: Commit 524c48072e56 ("mm/page_alloc: rename ALLOC_HIGH to ALLOC_MIN_RESERVE") is the start of a series that explains how __GFP_HIGH, which implies ALLOC_MIN_RESERVE, is going to be used instead of __GFP_ATOMIC for high atomic reserves. Commit eb2e2b425c69 ("mm/page_alloc: explicitly record high-order ...
```diff diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d1d037f97c5f..09241bb7663e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -4408,7 +4408,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask, unsigned int order) if (!(gfp_mask & __GFP_NOMEMALLOC)) { alloc_flags |= ALLOC_NON_BLOCK; - if (order > 0) + if...
668208b161a0b679427e7d0f34c0a65fd7d23979
Analyze and fix the following issue in the Linux kernel code: riscv: use an atomic xchg in pudp_huge_get_and_clear()
Problem Details: Make sure we return the right pud value and not a value that could have been overwritten in between by a different core. Link: https://lkml.kernel.org/r/20250814-dev-alex-thp_pud_xchg-v1-1-b4704dfae206@rivosinc.com Fixes: c3cc2a4a3a23 ("riscv: Add support for PUD THP") Signed-off-by: Alexandre Ghiti <...
```diff diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 91697fbf1f90..e69346307e78 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -942,6 +942,17 @@ static inline int pudp_test_and_clear_young(struct vm_area_struct *vma, return ptep_test_a...
9d246d7410c9c4187e37cc3bfd1284d06b697566
Analyze and fix the following issue in the Linux kernel code: selftests/damon: fix damon selftests by installing _common.sh
Problem Details: _common.sh was recently introduced but is not installed and then triggers an error when trying to run the damon selftests: selftests: damon: sysfs.sh ./sysfs.sh: line 4: _common.sh: No such file or directory Install this file to avoid this error. Link: https://lkml.kernel.org/r/20250812-alex-fixes_m...
```diff diff --git a/tools/testing/selftests/damon/Makefile b/tools/testing/selftests/damon/Makefile index 029de547f31c..2180c328a825 100644 --- a/tools/testing/selftests/damon/Makefile +++ b/tools/testing/selftests/damon/Makefile @@ -5,6 +5,7 @@ TEST_GEN_FILES += access_memory access_memory_even TEST_FILES = _damon...
0f9ab62a6e44ef51ea3e7f1c552b447cf4eb20ae
Analyze and fix the following issue in the Linux kernel code: mempool: rename struct mempool_s to struct mempool
Problem Details: Drop the pointless _s prefix and align to the usual struct naming to prepare for actually using the struct instead of the typedef so that random headers don't need to include mempool.h for just having a pointer to the mempool. Link: https://lkml.kernel.org/r/20250812083105.371295-1-hch@lst.de Signed-o...
```diff diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index fe1797bbec42..28ceaeffc0c9 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -199,7 +199,7 @@ struct gendisk { unsigned int zone_wplugs_hash_bits; atomic_t nr_zone_wplugs; spinlock_t zone_wplugs_lock; - struct mempool_...
53c225ffa72a63bbca8537a3357c8baec122b9a6
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix spelling mistake "mrmeap" -> "mremap"
Problem Details: There are spelling mistakes in perror messages. Fix these. Link: https://lkml.kernel.org/r/20250813081333.1978096-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundati...
```diff diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm/mremap_test.c index 5bd52a951cbd..bf2863b102e3 100644 --- a/tools/testing/selftests/mm/mremap_test.c +++ b/tools/testing/selftests/mm/mremap_test.c @@ -846,7 +846,7 @@ static void mremap_move_multi_invalid_vmas(FILE *maps_fp, }...
01f86753a05a3b971d69147d6d074c1a8d29b57d
Analyze and fix the following issue in the Linux kernel code: mm: correct sign-extension issue in MMF_* flag masks
Problem Details: There is an issue with the mask declarations in linux/mm_types.h, which naively do (1 << bit) operations. Unfortunately this results in the 1 being defaulted as a signed (32-bit) integer. When the compiler expands the MMF_INIT_MASK bitmask it comes up with: (((1 << 2) - 1) | (((1 << 9) - 1) << 2) | ...
```diff diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 9d224075d895..de09ae2a0de6 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -1767,7 +1767,7 @@ enum { * the modes are SUID_DUMP_* defined in linux/sched/coredump.h */ #define MMF_DUMPABLE_BITS 2 -#define MMF_DUMPA...
4141c2dc88f21881e34e0a3678fa48f0303adc5e
Analyze and fix the following issue in the Linux kernel code: mm: convert arch-specific code to mm_flags_*() accessors
Problem Details: As part of the effort to move to mm->flags becoming a bitmap field, convert existing users to making use of the mm_flags_*() accessors which will, when the conversion is complete, be the only means of accessing mm_struct flags. No functional change intended. [lorenzo.stoakes@oracle.com: fix typo] L...
```diff diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c index 40a526d28184..547104ccc22a 100644 --- a/arch/s390/mm/mmap.c +++ b/arch/s390/mm/mmap.c @@ -182,10 +182,10 @@ void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack) */ if (mmap_is_legacy(rlim_stack)) { mm->mmap_base = mmap_b...
12e423ba4eaed7b1561b677d32e6599f932d03db
Analyze and fix the following issue in the Linux kernel code: mm: convert core mm to mm_flags_*() accessors
Problem Details: As part of the effort to move to mm->flags becoming a bitmap field, convert existing users to making use of the mm_flags_*() accessors which will, when the conversion is complete, be the only means of accessing mm_struct flags. This will result in the debug output being that of a bitmap output, which ...
```diff diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 14d424830fa8..84b7eebe0d68 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -327,7 +327,7 @@ static inline bool vma_thp_disabled(struct vm_area_struct *vma, * example, s390 kvm. */ return (vm_flags & VM_NOHUGEPAGE)...
bb6525f2f8c41e89ba3fc506bc1705c68cf845ae
Analyze and fix the following issue in the Linux kernel code: mm: add bitmap mm->flags field
Problem Details: Patch series "mm: make mm->flags a bitmap and 64-bit on all arches". We are currently in the bizarre situation where we are constrained on the number of flags we can set in an mm_struct based on whether this is a 32-bit or 64-bit kernel. This is because mm->flags is an unsigned long field, which is 3...
```diff diff --git a/include/linux/mm.h b/include/linux/mm.h index 3868ca1a25f9..4ed4a0b9dad6 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -34,6 +34,8 @@ #include <linux/slab.h> #include <linux/cacheinfo.h> #include <linux/rcuwait.h> +#include <linux/bitmap.h> +#include <linux/bitops.h> struct memp...
801295be015fc53557a6ef221ab74df6950d1b80
Analyze and fix the following issue in the Linux kernel code: selftest/kho: update generation of initrd
Problem Details: Use nolibc include directory rather than include a cumulative nolibc.h on the compiler command line and replace use of 'sudo cpio' with usr/gen_init_cpio. While on it fix spelling of KHO_FINALIZE Link: https://lkml.kernel.org/r/20250811082510.4154080-4-rppt@kernel.org Signed-off-by: Mike Rapoport (Mi...
```diff diff --git a/tools/testing/selftests/kho/init.c b/tools/testing/selftests/kho/init.c index 8034e24c6bf6..6d9e91d55d68 100644 --- a/tools/testing/selftests/kho/init.c +++ b/tools/testing/selftests/kho/init.c @@ -1,22 +1,17 @@ // SPDX-License-Identifier: GPL-2.0 -#ifndef NOLIBC -#include <errno.h> #include <s...
950c31e8f1280c45697e9353e2d4973ff79312bf
Analyze and fix the following issue in the Linux kernel code: lib/test_kho: fixes for error handling
Problem Details: * Update kho_test_save() so that folios array won't be freed when returning from the function and the fdt will be freed on error * Reset state->nr_folios to 0 in kho_test_generate_data() on error * Simplify allocation of folios info in fdt. Link: https://lkml.kernel.org/r/20250811082510.4154080-3-r...
```diff diff --git a/lib/test_kho.c b/lib/test_kho.c index c2eb899c3b45..fe8504e3407b 100644 --- a/lib/test_kho.c +++ b/lib/test_kho.c @@ -67,13 +67,20 @@ static struct notifier_block kho_test_nb = { static int kho_test_save_data(struct kho_test_state *state, void *fdt) { - phys_addr_t *folios_info __free(kvfree) =...
be564840bbc2bdd803794a7c1a3b5195a901b0d4
Analyze and fix the following issue in the Linux kernel code: kho: allow scratch areas with zero size
Problem Details: Patch series "kho: fixes and cleanups", v3. These are small KHO and KHO test fixes and cleanups. This patch (of 3): Parsing of kho_scratch parameter treats zero size as an invalid value, although it should be fine for user to request zero sized scratch area for some types if scratch memory, when fo...
```diff diff --git a/kernel/kexec_handover.c b/kernel/kexec_handover.c index ecd1ac210dbd..1a65419e3756 100644 --- a/kernel/kexec_handover.c +++ b/kernel/kexec_handover.c @@ -405,6 +405,7 @@ static int __init kho_parse_scratch_size(char *p) { size_t len; unsigned long sizes[3]; + size_t total_size = 0; int i; ...
ec63a44011dccebca24e7ef7e8a9521306de1bc9
Analyze and fix the following issue in the Linux kernel code: mm/memory: convert print_bad_pte() to print_bad_page_map()
Problem Details: print_bad_pte() looks like something that should actually be a WARN or similar, but historically it apparently has proven to be useful to detect corruption of page tables even on production systems -- report the issue and keep the system running to make it easier to actually detect what is going wrong ...
```diff diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 4f88e460eb9c..94249e671a7e 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1983,6 +1983,24 @@ enum pgtable_level { PGTABLE_LEVEL_PGD, }; +static inline const char *pgtable_level_to_str(enum pgtable_level level) +{ +...
b22cc9a9c7ff0ad8998d58fdd7122de6038c46a7
Analyze and fix the following issue in the Linux kernel code: mm/rmap: convert "enum rmap_level" to "enum pgtable_level"
Problem Details: Let's factor it out, and convert all checks for unsupported levels to BUILD_BUG(). The code is written in a way such that force-inlining will optimize out the levels. [nathan@kernel.org: always inline __folio_rmap_sanity_checks()] Link: https://lkml.kernel.org/r/20250814-rmap-fix-build_bug-conversi...
```diff diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 2b80fd456c8b..4f88e460eb9c 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1975,6 +1975,14 @@ static inline bool arch_has_pfn_modify_check(void) /* Page-Table Modification Mask */ typedef unsigned int pgtbl_mod_mask; ...
b0f86aaebed1fc2bdc7475b14675ebc9d542e5d3
Analyze and fix the following issue in the Linux kernel code: fs/dax: use vmf_insert_folio_pmd() to insert the huge zero folio
Problem Details: Let's convert to vmf_insert_folio_pmd(). There is a theoretical change in behavior: in the unlikely case there is already something mapped, we'll now still call trace_dax_pmd_load_hole() and return VM_FAULT_NOPAGE. Previously, we would have returned VM_FAULT_FALLBACK, and the caller would have zapped...
```diff diff --git a/fs/dax.c b/fs/dax.c index 20ecf652c129..89f071ba7b10 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -1375,51 +1375,24 @@ static vm_fault_t dax_pmd_load_hole(struct xa_state *xas, struct vm_fault *vmf, const struct iomap_iter *iter, void **entry) { struct address_space *mapping = vmf->vma->vm_file->f...
1f2052755c152940c336918bd73d13d5468f548b
Analyze and fix the following issue in the Linux kernel code: mm/mincore: use a helper for checking the swap cache
Problem Details: Introduce a mincore_swap helper for checking swap entries. Move all swap related logic and sanity debug check into it, and separate them from page cache checking. The performance is better after this commit. mincore_page is never called on a swap cache space now, so the logic can be simpler. The sa...
```diff diff --git a/mm/mincore.c b/mm/mincore.c index 20fd0967d3cb..2f3e1816a30d 100644 --- a/mm/mincore.c +++ b/mm/mincore.c @@ -47,6 +47,48 @@ static int mincore_hugetlb(pte_t *pte, unsigned long hmask, unsigned long addr, return 0; } +static unsigned char mincore_swap(swp_entry_t entry, bool shmem) +{ + struct...
7bca1760cd86b9ef62d4c2baf168b68a708011bd
Analyze and fix the following issue in the Linux kernel code: docs/mm/damon/design: fix typo: s/sz_trtied/sz_tried/
Problem Details: There are some typo in statistics section of DAMON design docs - sz_trtied -> sz_tried Link: https://lkml.kernel.org/r/20250729144414.31958-1-ekffu200098@gmail.com Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com> Signed-off-by: SeongJae Park <sj@kernel.org> Reviewed-by: SeongJae Park <sj@kernel.o...
```diff diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 03f8137256f5..2f6ba5c7f4c7 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -689,7 +689,7 @@ DAMOS accounts below statistics for each scheme, from the beginning of the scheme's exec...
e6d7d3502e00ed6f86e03dcdb282cb7785e55448
Analyze and fix the following issue in the Linux kernel code: mm/damon: update expired description of damos_action
Problem Details: Nowadays, damos operation actions support a greater operation set. But comments (also, generated documentation) weren't updated. So fix the comments with current support status. Link: https://lkml.kernel.org/r/20250805123940.13691-1-ekffu200098@gmail.com Signed-off-by: Sang-Heon Jeon <ekffu200098@gm...
```diff diff --git a/include/linux/damon.h b/include/linux/damon.h index f13664c62ddd..d01bfee80bd6 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -110,7 +110,7 @@ struct damon_target { * * @DAMOS_WILLNEED: Call ``madvise()`` for the region with MADV_WILLNEED. * @DAMOS_COLD: Call ``madvise()``...
d9d1c2d81797250270babcf108d990e3a4799a9d
Analyze and fix the following issue in the Linux kernel code: fs/proc/task_mmu: execute PROCMAP_QUERY ioctl under per-vma locks
Problem Details: Utilize per-vma locks to stabilize vma after lookup without taking mmap_lock during PROCMAP_QUERY ioctl execution. If vma lock is contended, we fall back to mmap_lock but take it only momentarily to lock the vma and release the mmap_lock. In a very unlikely case of vm_refcnt overflow, this fall back pa...
```diff diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index c0968d293b61..e64cf40ce9c4 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -132,6 +132,12 @@ static void release_task_mempolicy(struct proc_maps_private *priv) #ifdef CONFIG_PER_VMA_LOCK +static void reset_lock_ctx(struct proc_maps_lock...
7760b6421b6c1b49550885ecdfa9cf720ead6eed
Analyze and fix the following issue in the Linux kernel code: rust: add support for NUMA ids in allocations
Problem Details: Add a new type to support specifying NUMA identifiers in Rust allocators and extend the allocators to have NUMA id as a parameter. Thus, modify ReallocFunc to use the new extended realloc primitives from the C side of the kernel (i.e. k[v]realloc_node_align/vrealloc_node_align) and add the new functi...
```diff diff --git a/rust/helpers/slab.c b/rust/helpers/slab.c index a842bfbddcba..8472370a4338 100644 --- a/rust/helpers/slab.c +++ b/rust/helpers/slab.c @@ -3,13 +3,13 @@ #include <linux/slab.h> void * __must_check __realloc_size(2) -rust_helper_krealloc(const void *objp, size_t new_size, gfp_t flags) +rust_helpe...
7cbce1eaeb783af9e88fc5cebe9b18d46d9030bd
Analyze and fix the following issue in the Linux kernel code: zram: protect recomp_algorithm_show() with ->init_lock
Problem Details: sysfs handlers should be called under ->init_lock and are not supposed to unlock it until return, otherwise e.g. a concurrent reset() can occur. There is one handler that breaks that rule: recomp_algorithm_show(). Move ->init_lock handling outside of __comp_algorithm_show() (also drop it and call zc...
```diff diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 8acad3cc6e6e..9ac271b82780 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1225,18 +1225,6 @@ static void comp_algorithm_set(struct zram *zram, u32 prio, const char *alg) zram->comp_algs[prio] =...
337135e6124b6d37d7ef1cd5a6c0b9681938c5ee
Analyze and fix the following issue in the Linux kernel code: mm: memory-tiering: fix PGPROMOTE_CANDIDATE counting
Problem Details: Goto-san reported confusing pgpromote statistics where the pgpromote_success count significantly exceeded pgpromote_candidate. On a system with three nodes (nodes 0-1: DRAM 4GB, node 2: NVDIMM 4GB): # Enable demotion only echo 1 > /sys/kernel/mm/numa/demotion_enabled numactl -m 0-1 memhog -r200 350...
```diff diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 0c5da9141983..9d3ea9085556 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -234,7 +234,21 @@ enum node_stat_item { #endif #ifdef CONFIG_NUMA_BALANCING PGPROMOTE_SUCCESS, /* promote successfully */ - PGPROMOTE_CANDIDATE, /...
915a4022b591d5476f72a4d2ca688212a0f983a4
Analyze and fix the following issue in the Linux kernel code: mm/mglru: update MG-LRU proactive reclaim statistics only to memcg
Problem Details: Users can use /sys/kernel/debug/lru_gen to trigger proactive memory reclaim of a specified memcg. Currently, statistics such as pgrefill, pgscan and pgsteal will be updated to the /proc/vmstat system memory statistics. This will confuse some system memory pressure monitoring tools, making it difficul...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index a48aec8bfd92..b9a1cfeb2ddf 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -5561,6 +5561,7 @@ static int run_cmd(char cmd, int memcg_id, int nid, unsigned long seq, if (memcg_id != mem_cgroup_id(memcg)) goto done; + sc->target_mem_cgroup = memcg; lruvec = get_...
e5eb32468859145806bd72d4d3ce3cb617528f37
Analyze and fix the following issue in the Linux kernel code: kasan: add test for SLAB_TYPESAFE_BY_RCU quarantine skipping
Problem Details: Verify that KASAN does not quarantine objects in SLAB_TYPESAFE_BY_RCU slabs if CONFIG_SLUB_RCU_DEBUG is off. [jannh@google.com: v2] Link: https://lkml.kernel.org/r/20250729-kasan-tsbrcu-noquarantine-test-v2-1-d16bd99309c9@google.com [jannh@google.com: make comment more verbose] Link: https://lkml...
```diff diff --git a/mm/kasan/kasan_test_c.c b/mm/kasan/kasan_test_c.c index f4b17984b627..4cf2b5f8d6c1 100644 --- a/mm/kasan/kasan_test_c.c +++ b/mm/kasan/kasan_test_c.c @@ -1073,6 +1073,45 @@ static void kmem_cache_rcu_uaf(struct kunit *test) kmem_cache_destroy(cache); } +/* + * Check that SLAB_TYPESAFE_BY_RCU o...
025e87f8ea2ae3a28bf1fe2b052bfa412c27ed4a
Analyze and fix the following issue in the Linux kernel code: nilfs2: fix CFI failure when accessing /sys/fs/nilfs2/features/*
Problem Details: When accessing one of the files under /sys/fs/nilfs2/features when CONFIG_CFI_CLANG is enabled, there is a CFI violation: CFI failure at kobj_attr_show+0x59/0x80 (target: nilfs_feature_revision_show+0x0/0x30; expected type: 0xfc392c4d) ... Call Trace: <TASK> sysfs_kf_seq_show+0x2a6/0x390 ...
```diff diff --git a/fs/nilfs2/sysfs.c b/fs/nilfs2/sysfs.c index 14868a3dd592..bc52afbfc5c7 100644 --- a/fs/nilfs2/sysfs.c +++ b/fs/nilfs2/sysfs.c @@ -1075,7 +1075,7 @@ void nilfs_sysfs_delete_device_group(struct the_nilfs *nilfs) ************************************************************************/ static ssi...
c62cff40481c037307a13becbda795f7afdcfebd
Analyze and fix the following issue in the Linux kernel code: samples/damon/mtier: avoid starting DAMON before initialization
Problem Details: Commit 964314344eab ("samples/damon/mtier: support boot time enable setup") is somehow incompletely applying the origin patch [1]. It is missing the part that avoids starting DAMON before module initialization. Probably a mistake during a merge has happened. Fix it by applying the missed part again....
```diff diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c index 7ebd352138e4..beaf36657dea 100644 --- a/samples/damon/mtier.c +++ b/samples/damon/mtier.c @@ -208,6 +208,9 @@ static int damon_sample_mtier_enable_store( if (enabled == is_enabled) return 0; + if (!init_called) + return 0; + if (enabled)...
e6b733ca2f99e968d696c2e812c8eb8e090bf37b
Analyze and fix the following issue in the Linux kernel code: samples/damon/prcl: avoid starting DAMON before initialization
Problem Details: Commit 2780505ec2b4 ("samples/damon/prcl: fix boot time enable crash") is somehow incompletely applying the origin patch [1]. It is missing the part that avoids starting DAMON before module initialization. Probably a mistake during a merge has happened. Fix it by applying the missed part again. Lin...
```diff diff --git a/samples/damon/prcl.c b/samples/damon/prcl.c index 1b839c06a612..0226652f94d5 100644 --- a/samples/damon/prcl.c +++ b/samples/damon/prcl.c @@ -137,6 +137,9 @@ static int damon_sample_prcl_enable_store( if (enabled == is_enabled) return 0; + if (!init_called) + return 0; + if (enabled) { ...
f826edeb888c5a8bd1b6e95ae6a50b0db2b21902
Analyze and fix the following issue in the Linux kernel code: samples/damon/wsse: avoid starting DAMON before initialization
Problem Details: Patch series "samples/damon: fix boot time enable handling fixup merge mistakes". First three patches of the patch series "mm/damon: fix misc bugs in DAMON modules" [1] were trying to fix boot time DAMON sample modules enabling issues. The issues are the modules can crash if those are enabled before ...
```diff diff --git a/samples/damon/wsse.c b/samples/damon/wsse.c index da052023b099..21eaf15f987d 100644 --- a/samples/damon/wsse.c +++ b/samples/damon/wsse.c @@ -118,6 +118,9 @@ static int damon_sample_wsse_enable_store( return 0; if (enabled) { + if (!init_called) + return 0; + err = damon_sample_wsse_st...
04a06b139ec08aa63d7377f6d3e5218f8ddb1c5d
Analyze and fix the following issue in the Linux kernel code: mm/damon/sysfs: use dynamically allocated repeat mode damon_call_control
Problem Details: DAMON sysfs interface is using a single global repeat mode damon_call_control variable for refresh_ms handling, for all DAMON contexts. As a result, when there are more than one context, the single global damon_call_control is unexpectedly over-written (corrupted). Particularly the ->link field is ov...
```diff diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 7b9254cadd5f..c96c2154128f 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -1534,14 +1534,10 @@ static int damon_sysfs_repeat_call_fn(void *data) return 0; } -static struct damon_call_control damon_sysfs_repeat_call_control = { - .fn = damon_sy...
e6a0deb6fa5b0fc134ee2aa127d1cfc9456d8445
Analyze and fix the following issue in the Linux kernel code: mm/damon/core: introduce damon_call_control->dealloc_on_cancel
Problem Details: Patch series "mm/damon/sysfs: fix refresh_ms control overwriting on multi-kdamonds usages". Automatic esssential DAMON/DAMOS status update feature of DAMON sysfs interface (refresh_ms) is broken [1] for multiple DAMON contexts (kdamonds) use case, since it uses a global single damon_call_control objec...
```diff diff --git a/include/linux/damon.h b/include/linux/damon.h index f13664c62ddd..9e62b2a85538 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -636,6 +636,7 @@ struct damon_operations { * @data: Data that will be passed to @fn. * @repeat: Repeat invocations. * @return_code: Return code fr...
2da6de30e60dd9bb14600eff1cc99df2fa2ddae3
Analyze and fix the following issue in the Linux kernel code: mm: folio_may_be_lru_cached() unless folio_test_large()
Problem Details: mm/swap.c and mm/mlock.c agree to drain any per-CPU batch as soon as a large folio is added: so collect_longterm_unpinnable_folios() just wastes effort when calling lru_add_drain[_all]() on a large folio. But although there is good reason not to batch up PMD-sized folios, we might well benefit from ba...
```diff diff --git a/include/linux/swap.h b/include/linux/swap.h index 2fe6ed2cc3fd..7012a0f758d8 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -385,6 +385,16 @@ void folio_add_lru_vma(struct folio *, struct vm_area_struct *); void mark_page_accessed(struct page *); void folio_mark_accessed(struct f...
8d79ed36bfc83d0583ab72216b7980340478cdfb
Analyze and fix the following issue in the Linux kernel code: mm: revert "mm: vmscan.c: fix OOM on swap stress test"
Problem Details: This reverts commit 0885ef470560: that was a fix to the reverted 33dfe9204f29b415bbc0abb1a50642d1ba94f5e9. Link: https://lkml.kernel.org/r/aa0e9d67-fbcd-9d79-88a1-641dfbe1d9d1@google.com Signed-off-by: Hugh Dickins <hughd@google.com> Acked-by: David Hildenbrand <david@redhat.com> Cc: "Aneesh Kumar K.V...
```diff diff --git a/mm/vmscan.c b/mm/vmscan.c index a48aec8bfd92..674999999cd0 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4507,7 +4507,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c } /* ineligible */ - if (!folio_test_lru(folio) || zone > sc->reclaim_idx) { + if (zone ...
98c6d259319ecf6e8d027abd3f14b81324b8c0ad
Analyze and fix the following issue in the Linux kernel code: mm/gup: check ref_count instead of lru before migration
Problem Details: Patch series "mm: better GUP pin lru_add_drain_all()", v2. Series of lru_add_drain_all()-related patches, arising from recent mm/gup migration report from Will Deacon. This patch (of 5): Will Deacon reports:- When taking a longterm GUP pin via pin_user_pages(), __gup_longterm_locked() tries to mig...
```diff diff --git a/mm/gup.c b/mm/gup.c index adffe663594d..82aec6443c0a 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2307,7 +2307,8 @@ static unsigned long collect_longterm_unpinnable_folios( continue; } - if (!folio_test_lru(folio) && drain_allow) { + if (drain_allow && folio_ref_count(folio) != + folio...
a001cd248ab244633c5fabe4f7c707e13fc1d1cc
Analyze and fix the following issue in the Linux kernel code: rseq/selftests: Use weak symbol reference, not definition, to link with glibc
Problem Details: Add "extern" to the glibc-defined weak rseq symbols to convert the rseq selftest's usage from weak symbol definitions to weak symbol _references_. Effectively re-defining the glibc symbols wreaks havoc when building with -fno-common, e.g. generates segfaults when running multi-threaded programs, as dyn...
```diff diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c index 663a9cef1952..dcac5cbe7933 100644 --- a/tools/testing/selftests/rseq/rseq.c +++ b/tools/testing/selftests/rseq/rseq.c @@ -40,9 +40,9 @@ * Define weak versions to play nice with binaries that are statically linked * ...
6eb350a2233100a283f882c023e5ad426d0ed63b
Analyze and fix the following issue in the Linux kernel code: rseq: Protect event mask against membarrier IPI
Problem Details: rseq_need_restart() reads and clears task::rseq_event_mask with preemption disabled to guard against the scheduler. But membarrier() uses an IPI and sets the PREEMPT bit in the event mask from the IPI, which leaves that RMW operation unprotected. Use guard(irq) if CONFIG_MEMBARRIER is enabled to fix ...
```diff diff --git a/include/linux/rseq.h b/include/linux/rseq.h index bc8af3eb5598..1fbeb61babeb 100644 --- a/include/linux/rseq.h +++ b/include/linux/rseq.h @@ -7,6 +7,12 @@ #include <linux/preempt.h> #include <linux/sched.h> +#ifdef CONFIG_MEMBARRIER +# define RSEQ_EVENT_GUARD irq +#else +# define RSEQ_EVENT_GUA...
f1880f9cc1476171bec3dae8fd56fff5665e22a4
Analyze and fix the following issue in the Linux kernel code: can: peak: Modification of references to email accounts being deleted
Problem Details: With the upcoming deletion of @peak-system.com accounts and following the acquisition of PEAK-System and its brand by HMS-Networks, this fix aims to migrate all address references to @hms-networks.com, as well as to map my personal committer addresses to author addresses, while taking the opportunity t...
```diff diff --git a/.mailmap b/.mailmap index 4a5f2c8deeff..c393045d9361 100644 --- a/.mailmap +++ b/.mailmap @@ -740,6 +740,8 @@ Sriram Yagnaraman <sriram.yagnaraman@ericsson.com> <sriram.yagnaraman@est.tech> Stanislav Fomichev <sdf@fomichev.me> <sdf@google.com> Stanislav Fomichev <sdf@fomichev.me> <stfomichev@gmai...
0e2ee70291e64a30fe36960c85294726d34a103e
Analyze and fix the following issue in the Linux kernel code: media: uvcvideo: Mark invalid entities with id UVC_INVALID_ENTITY_ID
Problem Details: Per UVC 1.1+ specification 3.7.2, units and terminals must have a non-zero unique ID. ``` Each Unit and Terminal within the video function is assigned a unique identification number, the Unit ID (UID) or Terminal ID (TID), contained in the bUnitID or bTerminalID field of the descriptor. The value 0x00...
```diff diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 10df845fb17e..fa61f1d0ea2c 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -137,6 +137,9 @@ struct uvc_entity *uvc_entity_by_id(struct uvc_device *dev, int id) { struct uvc_e...
97b6ff8603f2bdd8863a4d9b8b5432e8f3272b64
Analyze and fix the following issue in the Linux kernel code: media: uvcvideo: Drop stream->mutex
Problem Details: Since commit c93d73c9c2cf ("media: uvcvideo: Use vb2 ioctl and fop helpers"), the IOCTLs are serialized. Due to this there is no more need to protect ctrl, cur_format or cur_frame from concurrent access. Drop stream->mutex after thanking it for years of good service. Use this opportunity to do fix so...
```diff diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 775bede0d93d..3039e6a533b8 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -183,8 +183,6 @@ static void uvc_stream_delete(struct uvc_streaming *stream) if (stream->async_wq) ...
1ab40529ad52f339975886a6a9e815dfdcb8d011
Analyze and fix the following issue in the Linux kernel code: media: uvcvideo: Move MSXU_CONTROL_METADATA definition to header
Problem Details: Move the MSXU_CONTROL_METADATA control definitino to the include/linux/usb/uvc.h header, alongside the corresponding XU GUID. Add a UVC_ prefix to avoid namespace clashes. While at it, add the definition for the other controls for that extension unit, as defined in https://learn.microsoft.com/en-us/wi...
```diff diff --git a/drivers/media/usb/uvc/uvc_metadata.c b/drivers/media/usb/uvc/uvc_metadata.c index 7368400734a3..b35111d08759 100644 --- a/drivers/media/usb/uvc/uvc_metadata.c +++ b/drivers/media/usb/uvc/uvc_metadata.c @@ -171,7 +171,6 @@ static struct uvc_entity *uvc_meta_find_msxu(struct uvc_device *dev) return...
e8e65d9237e590a953e17beb15bfd13dcfbe3ebf
Analyze and fix the following issue in the Linux kernel code: media: uvcvideo: Fix comments in uvc_meta_detect_msxu
Problem Details: The comments can be more precise. Let's fix them. Fixes: 6cb786f040ad ("media: uvcvideo: Auto-set UVC_QUIRK_MSXU_META") Cc: stable+noautosel@kernel.org # Coment change only, no need to backport Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Ricardo Ribalda <ribalda@ch...
```diff diff --git a/drivers/media/usb/uvc/uvc_metadata.c b/drivers/media/usb/uvc/uvc_metadata.c index 3b0b39289511..b0960f0553cf 100644 --- a/drivers/media/usb/uvc/uvc_metadata.c +++ b/drivers/media/usb/uvc/uvc_metadata.c @@ -196,7 +196,10 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev) if (!data) retu...
f4da0de6b4b470a60c5c0cc4c09b0c987f9df35f
Analyze and fix the following issue in the Linux kernel code: media: uvcvideo: Avoid variable shadowing in uvc_ctrl_cleanup_fh
Problem Details: This avoids a variable loop shadowing occurring between the local loop iterating through the uvc_entity's controls and the global one going through the pending async controls of the file handle. Fixes: 10acb9101355 ("media: uvcvideo: Increase/decrease the PM counter per IOCTL") Cc: stable@vger.kernel....
```diff diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index efe609d70877..55bbbef399d4 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -3307,7 +3307,6 @@ int uvc_ctrl_init_device(struct uvc_device *dev) void uvc_ctrl_cleanup_fh(struct uvc_fh *h...
e67b5f8313229d058bddc88e29a73b9b6cdab7a9
Analyze and fix the following issue in the Linux kernel code: media: uvcvideo: Fix assignment in if condition
Problem Details: The function uvc_input_init() uses an assignment of the return value of input_register_device() within the condition of an if statement. This coding style is discouraged by the Linux kernel coding style guide as it can be confused with a comparison and hide potential bugs. The checkpatch.pl script fla...
```diff diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c index ee01dce4b783..3c29c0bb3f7c 100644 --- a/drivers/media/usb/uvc/uvc_status.c +++ b/drivers/media/usb/uvc/uvc_status.c @@ -62,7 +62,8 @@ static int uvc_input_init(struct uvc_device *dev) __set_bit(EV_KEY, input->evbit); ...
08a9e5f8bb1e2233d19fb0c12f454e2d625532f5
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad7124: fix sample rate for multi-channel use
Problem Details: Change how the FS[10:0] field of the FILTER register is calculated to get consistent sample rates when only one channel is enabled vs when multiple channels are enabled in a buffered read. By default, the AD7124 allows larger sampling frequencies when only one channel is enabled. It assumes that you w...
```diff diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c index d5bb0faf9111..6f4629c4a2f0 100644 --- a/drivers/iio/adc/ad7124.c +++ b/drivers/iio/adc/ad7124.c @@ -93,10 +93,11 @@ #define AD7124_CONFIG_PGA GENMASK(2, 0) /* AD7124_FILTER_X */ -#define AD7124_FILTER_FS GENMASK(10, 0) #define AD7124_...
44a375e8aaff360944606b3bb2df89f1376cbaf3
Analyze and fix the following issue in the Linux kernel code: ARM: 9458/1: module: Ensure the override of module_arch_freeing_init()
Problem Details: The function module_arch_freeing_init() defined in arch/arm/kernel/module.c is supposed to override a weak function of the same name defined in kernel/module/main.c. However, the ARM override is also marked as weak, which means that selecting the correct function unnecessarily depends on the order in w...
```diff diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c index da488d92e7a0..55ca3fcd37e8 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c @@ -484,7 +484,7 @@ module_arch_cleanup(struct module *mod) #endif } -void __weak module_arch_freeing_init(struct module *mod) +void module_a...
caffed0800ef4dd29cc29ee17a89d015e867e03a
Analyze and fix the following issue in the Linux kernel code: ARM: dts: sunxi: add support for NetCube Systems Nagami Keypad Carrier
Problem Details: The NetCube Systems Nagami Keypad Carrier uses the Nagami SoM and contains a TCA8418 connected to a 4x4 matrix keypad. The I2C2 interface is connected to said TCA8418 and also a header for an PN532 NFC-Module. It also provides a pin-header for a bi-color status led. Ethernet with PoE support is availab...
```diff diff --git a/arch/arm/boot/dts/allwinner/Makefile b/arch/arm/boot/dts/allwinner/Makefile index 865fd8c9d137..f71392a55df8 100644 --- a/arch/arm/boot/dts/allwinner/Makefile +++ b/arch/arm/boot/dts/allwinner/Makefile @@ -262,6 +262,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ sun8i-s3-pinecube.dtb \ sun8i-t113s-mangopi...
e36d4d54eefb60144666b27754007e1c0dd0a581
Analyze and fix the following issue in the Linux kernel code: ARM: dts: sunxi: add support for NetCube Systems Nagami Basic Carrier
Problem Details: The NetCube Systems Nagami Basic Carrier is a Carrier for the Nagami SoM It provides an ethernet port for the phy on the SoM and some USB-Ports. All other interfaces and gpios are available on pinheader, except for the SD-Interface which is available on a micro-sd slot. Signed-off-by: Lukas Schmid <lu...
```diff diff --git a/arch/arm/boot/dts/allwinner/Makefile b/arch/arm/boot/dts/allwinner/Makefile index 97d0a205493f..865fd8c9d137 100644 --- a/arch/arm/boot/dts/allwinner/Makefile +++ b/arch/arm/boot/dts/allwinner/Makefile @@ -200,6 +200,7 @@ DTC_FLAGS_sun8i-h3-nanopi-r1 := -@ DTC_FLAGS_sun8i-h3-orangepi-pc := -@ DTC...
cba2febbd6465aabdff157fb95b1c07d090af1f0
Analyze and fix the following issue in the Linux kernel code: ARM: dts: sunxi: add support for NetCube Systems Nagami SoM
Problem Details: NetCube Systems Nagami SoM is a module based around the Allwinner T113s SoC. It includes the following features and interfaces: - 128MB DDR3 included in SoC - 10/100 Mbps Ethernet using LAN8720A phy - One USB-OTG interface - One USB-Host interface - One I2S interface with in and output support - Two C...
```diff diff --git a/arch/arm/boot/dts/allwinner/sun8i-t113s-netcube-nagami.dtsi b/arch/arm/boot/dts/allwinner/sun8i-t113s-netcube-nagami.dtsi new file mode 100644 index 000000000000..544d60cfc32e --- /dev/null +++ b/arch/arm/boot/dts/allwinner/sun8i-t113s-netcube-nagami.dtsi @@ -0,0 +1,250 @@ +// SPDX-License-Identifi...
cbce6d5326b116f55dc29f7fc0a7d56a9a03d9e5
Analyze and fix the following issue in the Linux kernel code: riscv: dts: allwinner: d1s-t113: Add pinctrl's required by NetCube Systems Nagami SoM
Problem Details: Added the following pinctrl's used by the NetCube Systems Nagami SoM * i2c2_pins * i2c3_pins * i2s1_pins, i2s1_din_pins, i2s1_dout_pins * spi1_pins, spi1_hold_pin, spi1_wp_pin Signed-off-by: Lukas Schmid <lukas.schmid@netcube.li> Link: https://patch.msgid.link/20250831162536.2380589-3-lukas.sc...
```diff diff --git a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi index e4175adb028d..63e252b44973 100644 --- a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +++ b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi @@ -78,6 +78,36 @@ function = "dsi"; ...
07c24945cafc810bcce3ea6c336a6495e813b47f
Analyze and fix the following issue in the Linux kernel code: Revert "drm: Add directive to format code in comment"
Problem Details: Commit 6cc44e9618f03f ("drm: Add directive to format code in comment") fixes original Sphinx indentation warning as introduced in 471920ce25d50b ("drm/gpuvm: Add locking helpers"), by means of using code-block:: directive. It semantically conflicts with earlier bb324f85f72284 ("drm/gpuvm: Wrap drm_gpuv...
```diff diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index 60b672d3fd83..8b8a3ca8d7fc 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -2432,8 +2432,6 @@ static const struct drm_gpuvm_ops lock_ops = { * * The expected usage is: * - * .. code-block:: c - * *...
a0c17ed907ac3326cf3c9d6007ea222a746f5cc2
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Fix alias device DTE setting
Problem Details: Commit 7bea695ada0 restructured DTE flag handling but inadvertently changed the alias device configuration logic. This may cause incorrect DTE settings for certain devices. Add alias flag check before calling set_dev_entry_from_acpi(). Also move the device iteration loop inside the alias check to rest...
```diff diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index 6795326a6524..ba9e582a8bbe 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -1455,12 +1455,12 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu, PCI_FUNC(e->devid)); devid = e->devid; - ...
a2d2e6ea1865d316e4f0c0bbd8275ffdc4ec62f5
Analyze and fix the following issue in the Linux kernel code: iommu/io-pgtable-dart: Fix off by one error in table index check
Problem Details: The check for the dart table index allowed values of (1 << data->tbl_bits) while only as many entries are initialized in apple_dart_alloc_pgtable. This results in an array out of bounds access when data->tbl_bits is at its maximal value of 2. When data->tbl_bits is 0 or 1 an unset (initialized to zero)...
```diff diff --git a/drivers/iommu/io-pgtable-dart.c b/drivers/iommu/io-pgtable-dart.c index 9a63c80a2786..54d287cc0dd1 100644 --- a/drivers/iommu/io-pgtable-dart.c +++ b/drivers/iommu/io-pgtable-dart.c @@ -177,7 +177,7 @@ static dart_iopte *dart_get_last(struct dart_io_pgtable *data, unsigned long iov int level = da...
2b0dc40ac6ca16ee0c489927f4856cf9cd3874c7
Analyze and fix the following issue in the Linux kernel code: crypto: ccp - Fix incorrect payload size calculation in psp_poulate_hsti()
Problem Details: payload_size field of the request header is incorrectly calculated using sizeof(req). Since 'req' is a pointer (struct hsti_request *), sizeof(req) returns the size of the pointer itself (e.g., 8 bytes on a 64-bit system), rather than the size of the structure it points to. This leads to an incorrect p...
```diff diff --git a/drivers/crypto/ccp/hsti.c b/drivers/crypto/ccp/hsti.c index 36f6534fbe08..c29c6a9c0f3f 100644 --- a/drivers/crypto/ccp/hsti.c +++ b/drivers/crypto/ccp/hsti.c @@ -88,7 +88,7 @@ static int psp_populate_hsti(struct psp_device *psp) if (!req) return -ENOMEM; - req->header.payload_size = sizeof(r...
f5d643156ef62216955c119216d2f3815bd51cb1
Analyze and fix the following issue in the Linux kernel code: crypto: atmel - Fix dma_unmap_sg() direction
Problem Details: It seems like everywhere in this file, dd->in_sg is mapped with DMA_TO_DEVICE and dd->out_sg is mapped with DMA_FROM_DEVICE. Fixes: 13802005d8f2 ("crypto: atmel - add Atmel DES/TDES driver") Cc: <stable@vger.kernel.org> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com> Signed-off-by: Herbert Xu...
```diff diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 098f5532f389..3b2a92029b16 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -512,7 +512,7 @@ static int atmel_tdes_crypt_start(struct atmel_tdes_dev *dd) if (err && (dd->flags & TDES_FLAGS_FAST)) { d...
21140e5caf019e4a24e1ceabcaaa16bd693b393f
Analyze and fix the following issue in the Linux kernel code: crypto: rockchip - Fix dma_unmap_sg() nents value
Problem Details: The dma_unmap_sg() functions should be called with the same nents as the dma_map_sg(), not the value the map function returned. Fixes: 57d67c6e8219 ("crypto: rockchip - rework by using crypto_engine") Cc: <stable@vger.kernel.org> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com> Signed-off-by: ...
```diff diff --git a/drivers/crypto/rockchip/rk3288_crypto_ahash.c b/drivers/crypto/rockchip/rk3288_crypto_ahash.c index d6928ebe9526..b9f5a8b42e66 100644 --- a/drivers/crypto/rockchip/rk3288_crypto_ahash.c +++ b/drivers/crypto/rockchip/rk3288_crypto_ahash.c @@ -254,7 +254,7 @@ static void rk_hash_unprepare(struct cryp...