id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
51b78ffb803657fe38788d5715eee591cd7c0740
Analyze and fix the following issue in the Linux kernel code: smb: client: add ParentLeaseKey support
Problem Details: According to MS-SMB2 3.2.4.3.8, when opening a file the client must lookup its parent directory, copy that entry’s LeaseKey into ParentLeaseKey, and set SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET. Extend lease context functions to carry a parent_lease_key and lease_flags and to add them to the lease context...
```diff diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h index 4d097b074b5f..2ad9835d91ab 100644 --- a/fs/smb/client/cifsglob.h +++ b/fs/smb/client/cifsglob.h @@ -556,7 +556,7 @@ struct smb_version_operations { void (*set_oplock_level)(struct cifsInodeInfo *cinode, __u32 oplock, __u16 epoch, boo...
a3e771afbb3bce91c8296828304903e7348003fe
Analyze and fix the following issue in the Linux kernel code: cifs: Fix cifs_query_path_info() for Windows NT servers
Problem Details: For TRANS2 QUERY_PATH_INFO request when the path does not exist, the Windows NT SMB server returns error response STATUS_OBJECT_NAME_NOT_FOUND or ERRDOS/ERRbadfile without the SMBFLG_RESPONSE flag set. Similarly it returns STATUS_DELETE_PENDING when the file is being deleted. And looks like that any er...
```diff diff --git a/fs/smb/client/misc.c b/fs/smb/client/misc.c index 7b6ed9b23e71..e77017f47084 100644 --- a/fs/smb/client/misc.c +++ b/fs/smb/client/misc.c @@ -326,6 +326,14 @@ check_smb_hdr(struct smb_hdr *smb) if (smb->Command == SMB_COM_LOCKING_ANDX) return 0; + /* + * Windows NT server returns error resp...
56e84c64fc257a95728ee73165456b025c48d408
Analyze and fix the following issue in the Linux kernel code: cifs: Fix validation of SMB1 query reparse point response
Problem Details: Validate the SMB1 query reparse point response per [MS-CIFS] section 2.2.7.2 NT_TRANSACT_IOCTL. NT_TRANSACT_IOCTL response contains one word long setup data after which is ByteCount member. So check that SetupCount is 1 before trying to read and use ByteCount member. Output setup data contains Return...
```diff diff --git a/fs/smb/client/cifssmb.c b/fs/smb/client/cifssmb.c index f6ec0045c513..b5e98aa462a7 100644 --- a/fs/smb/client/cifssmb.c +++ b/fs/smb/client/cifssmb.c @@ -2754,10 +2754,10 @@ int cifs_query_reparse_point(const unsigned int xid, io_req->TotalParameterCount = 0; io_req->TotalDataCount = 0; - io_...
6510ef4230b68c960309e0c1d6eb3e32eb785142
Analyze and fix the following issue in the Linux kernel code: cifs: Fix encoding of SMB1 Session Setup NTLMSSP Request in non-UNICODE mode
Problem Details: SMB1 Session Setup NTLMSSP Request in non-UNICODE mode is similar to UNICODE mode, just strings are encoded in ASCII and not in UTF-16. With this change it is possible to setup SMB1 session with NTLM authentication in non-UNICODE mode with Windows SMB server. This change fixes mounting SMB1 servers w...
```diff diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c index b3fa9ee26912..0f51d136cf23 100644 --- a/fs/smb/client/sess.c +++ b/fs/smb/client/sess.c @@ -1684,22 +1684,22 @@ _sess_auth_rawntlmssp_assemble_req(struct sess_data *sess_data) pSMB = (SESSION_SETUP_ANDX *)sess_data->iov[0].iov_base; capabiliti...
fe9f5f96cfe8b82d0f24cbfa93718925560f4f8d
Analyze and fix the following issue in the Linux kernel code: rtc: Fix offset calculation for .start_secs < 0
Problem Details: The comparison rtc->start_secs > rtc->range_max has a signed left-hand side and an unsigned right-hand side. So the comparison might become true for negative start_secs which is interpreted as a (possibly very large) positive value. As a negative value can never be bigger than an unsigned va...
```diff diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index b88cd4fb295b..b1a2be1f9e3b 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -326,7 +326,7 @@ static void rtc_device_get_offset(struct rtc_device *rtc) * * Otherwise the offset seconds should be 0. */ - if (rtc->start_secs > rtc->...
1e15a6803df01471e0065dabd8b9563692c47219
Analyze and fix the following issue in the Linux kernel code: rtc: pcf8563: fix wrong alarm register
Problem Details: When the regmap framework was introduced to this driver, the PCF8563_REG_AMN register within the set_alarm function was incorrectly changed to PCF8563_REG_SC. The PCF8563_REG_SC register is the seconds register. This caused alarm values to be written to the seconds register when an alarm was set. Whic...
```diff diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index 5a084d426e58..b2611697fa5e 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c @@ -285,7 +285,7 @@ static int pcf8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *tm) buf[2] = bin2bcd(tm->time.tm_mday); buf[3...
f1e7a277a1736e12cc4bd6d93b8a5c439b8ca20c
Analyze and fix the following issue in the Linux kernel code: smb: client: add NULL check in automount_fullpath
Problem Details: page is checked for null in __build_path_from_dentry_optional_prefix when tcon->origin_fullpath is not set. However, the check is missing when it is set. Add a check to prevent a potential NULL pointer dereference. Signed-off-by: Ruben Devos <devosruben6@gmail.com> Cc: stable@vger.kernel.org Signed-of...
```diff diff --git a/fs/smb/client/namespace.c b/fs/smb/client/namespace.c index e3f9213131c4..a6655807c086 100644 --- a/fs/smb/client/namespace.c +++ b/fs/smb/client/namespace.c @@ -146,6 +146,9 @@ static char *automount_fullpath(struct dentry *dentry, void *page) } spin_unlock(&tcon->tc_lock); + if (unlikely(!p...
baa39c169dd526cb0186187fc44ec462266efcc6
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix selftest btf_tag/btf_type_tag_percpu_vmlinux_helper failure
Problem Details: Ihor Solodrai reported selftest 'btf_tag/btf_type_tag_percpu_vmlinux_helper' failure ([1]) during 6.16 merge window. The failure log: ... 7: (15) if r0 == 0x0 goto pc+1 ; R0=ptr_css_rstat_cpu() ; *(volatile int *)rstat; @ btf_type_tag_percpu.c:68 8: (61) r1 = *(u32 *)(r0 +0) cannot ac...
```diff diff --git a/tools/testing/selftests/bpf/progs/btf_type_tag_percpu.c b/tools/testing/selftests/bpf/progs/btf_type_tag_percpu.c index 69f81cb555ca..d93f68024cc6 100644 --- a/tools/testing/selftests/bpf/progs/btf_type_tag_percpu.c +++ b/tools/testing/selftests/bpf/progs/btf_type_tag_percpu.c @@ -57,15 +57,15 @@ i...
4b65d5ae971430287855a89635a184c489bd02a5
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix bpf selftest build error
Problem Details: On linux-next, build for bpf selftest displays an error due to mismatch in the expected function signature of bpf_testmod_test_read and bpf_testmod_test_write. Commit 97d06802d10a ("sysfs: constify bin_attribute argument of bin_attribute::read/write()") changed the required type for struct bin_attribu...
```diff diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c index e6c248e3ae54..e9e918cdf31f 100644 --- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c @@ -385,7 +385,7 @@ int bpf_testm...
0abd87942e0c93964e93224836944712feba1d91
Analyze and fix the following issue in the Linux kernel code: ceph: fix possible integer overflow in ceph_zero_objects()
Problem Details: In 'ceph_zero_objects', promote 'object_size' to 'u64' to avoid possible integer overflow. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Kandybka <d.kandybka@gmail.com> Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> Signed-off-b...
```diff diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 851d70200c6b..a7254cab44cc 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -2616,7 +2616,7 @@ static int ceph_zero_objects(struct inode *inode, loff_t offset, loff_t length) s32 stripe_unit = ci->i_layout.stripe_unit; s32 stripe_count = ci->i_layout.str...
060909278cc0a91373a20726bd3d8ce085f480a9
Analyze and fix the following issue in the Linux kernel code: ceph: avoid kernel BUG for encrypted inode with unaligned file size
Problem Details: The generic/397 test hits a BUG_ON for the case of encrypted inode with unaligned file size (for example, 33K or 1K): [ 877.737811] run fstests generic/397 at 2025-01-03 12:34:40 [ 877.875761] libceph: mon0 (2)127.0.0.1:40674 session established [ 877.876130] libceph: client4614 fsid 19b90bca-f1ae-47a...
```diff diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 29be367905a1..5a5751156f8b 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -407,6 +407,15 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq) struct page **pages; size_t page_off; + /* + * FIXME: io_iter.count needs to be cor...
f39f18f3c3531aa802b58a20d39d96e82eb96c14
Analyze and fix the following issue in the Linux kernel code: randstruct: gcc-plugin: Fix attribute addition
Problem Details: Based on changes in the 2021 public version of the randstruct out-of-tree GCC plugin[1], more carefully update the attributes on resulting decls, to avoid tripping checks in GCC 15's comptypes_check_enum_int() when it has been configured with "--enable-checking=misc": arch/arm64/kernel/kexec_image.c:1...
```diff diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h index 3222c1070444..ef12c8f929ed 100644 --- a/scripts/gcc-plugins/gcc-common.h +++ b/scripts/gcc-plugins/gcc-common.h @@ -123,6 +123,38 @@ static inline tree build_const_char_string(int len, const char *str) return cstr; } +st...
5c78e793f78732b60276401f75cc1a101f9ad121
Analyze and fix the following issue in the Linux kernel code: overflow: Introduce __DEFINE_FLEX for having no initializer
Problem Details: While not yet in the tree, there is a proposed patch[1] that was depending on the prior behavior of _DEFINE_FLEX, which did not have an explicit initializer. Provide this via __DEFINE_FLEX now, which can also have attributes applied (e.g. __uninitialized). Examples of the resulting initializer behavio...
```diff diff --git a/include/linux/overflow.h b/include/linux/overflow.h index 7b7be27ca113..154ed0dbb43f 100644 --- a/include/linux/overflow.h +++ b/include/linux/overflow.h @@ -389,24 +389,37 @@ static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend) struct_size((type *)NULL, member, count) ...
a4e2401438a26131ecff9be6a3a1d4cbfea66f9a
Analyze and fix the following issue in the Linux kernel code: watchdog: lenovo_se30_wdt: Fix possible devm_ioremap() NULL pointer dereference in lenovo_se30_wdt_probe()
Problem Details: devm_ioremap() returns NULL on error. Currently, lenovo_se30_wdt_probe() does not check for this case, which results in a NULL pointer dereference. Add NULL check after devm_ioremap() to prevent this issue. Fixes: c284153a2c55 ("watchdog: lenovo_se30_wdt: Watchdog driver for Lenovo SE30 platform") Si...
```diff diff --git a/drivers/watchdog/lenovo_se30_wdt.c b/drivers/watchdog/lenovo_se30_wdt.c index 024b842499b3..1c73bb7eeeee 100644 --- a/drivers/watchdog/lenovo_se30_wdt.c +++ b/drivers/watchdog/lenovo_se30_wdt.c @@ -271,6 +271,8 @@ static int lenovo_se30_wdt_probe(struct platform_device *pdev) return -EBUSY; ...
66bce7afbaca6ca9022210b0cd9fa3405da36667
Analyze and fix the following issue in the Linux kernel code: selftests/mm: fix test result reporting in gup_longterm
Problem Details: The kselftest framework uses the string logged when a test result is reported as the unique identifier for a test, using it to track test results between runs. The gup_longterm test fails to follow this pattern, it runs a single test function repeatedly with various parameters but each result report i...
```diff diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c index e60e62809186..f84ea97c2543 100644 --- a/tools/testing/selftests/mm/gup_longterm.c +++ b/tools/testing/selftests/mm/gup_longterm.c @@ -93,33 +93,48 @@ static void do_test(int fd, size_t size, enum test_type t...
9709eb0f845b713ba163f2c461537d8add3e4e04
Analyze and fix the following issue in the Linux kernel code: sched/numa: fix task swap by skipping kernel threads
Problem Details: Patch series "sched/numa: add statistics of numa balance task migration", v6. Introduce task migration and swap statistics in the following places: /sys/fs/cgroup/{GROUP}/memory.stat /proc/{PID}/sched /proc/vmstat These statistics facilitate a rapid evaluation of the performance and resource utilizat...
```diff diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index cef163c174bd..1f9b7df8dfc5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2273,7 +2273,8 @@ static bool task_numa_compare(struct task_numa_env *env, rcu_read_lock(); cur = rcu_dereference(dst_rq->curr); - if (cur && ((cur->flags ...
83da212b7fca407f6f30c7d6f02a8f910db8724d
Analyze and fix the following issue in the Linux kernel code: tools/testing: check correct variable in open_procmap()
Problem Details: Check if "procmap_out->fd" is negative instead of "procmap_out" (which is a pointer). Link: https://lkml.kernel.org/r/aDbFuUTlJTBqziVd@stanley.mountain Fixes: bd23f293a0d5 ("tools/testing: add PROCMAP_QUERY helper functions in mm self tests") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Rev...
```diff diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c index 1357e2d6a7b6..61d7bf1f8c62 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -439,7 +439,7 @@ int open_procmap(pid_t pid, struct procmap_fd *procmap_out) sprintf(path, "...
918850c13608c7b138512c2ecbfd3436b7a51797
Analyze and fix the following issue in the Linux kernel code: tools/testing/vma: add missing function stub
Problem Details: The hugetlb fix introduced in commit ee40c9920ac2 ("mm: fix copy_vma() error handling for hugetlb mappings") mistakenly did not provide a stub for the VMA userland testing, which results in a compile error when trying to build this. Provide this stub to resolve the issue. Link: https://lkml.kernel.or...
```diff diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_internal.h index f6e45e62da3a..441feb21aa5a 100644 --- a/tools/testing/vma/vma_internal.h +++ b/tools/testing/vma/vma_internal.h @@ -1461,4 +1461,9 @@ static inline int __call_mmap_prepare(struct file *file, return file->f_op->mmap_prepare(...
52084f258e46f09a71063447df31cbd48c0cacd0
Analyze and fix the following issue in the Linux kernel code: mm/gup: update comment explaining why gup_fast() disables IRQs
Problem Details: The current comment in gup_fast() talks about "IPIs that come from THPs splitting", which is outdated and refers to the old THP splitting implementation that was removed in commit ad0bed24e98b ("thp: drop all split_huge_page()-related code"), which landed in v4.5. Before then, THP splitting involved a...
```diff diff --git a/mm/gup.c b/mm/gup.c index 329c5f7acc7a..e065a49842a8 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -3299,7 +3299,7 @@ static unsigned long gup_fast(unsigned long start, unsigned long end, * include/asm-generic/tlb.h for more details. * * We do not adopt an rcu_read_lock() here as we also want to...
bb084994d38fd36518ac50a33c8ddcea2239067e
Analyze and fix the following issue in the Linux kernel code: selftests/mm: two fixes for the pfnmap test
Problem Details: When unregistering the signal handler, we have to pass SIG_DFL, and blindly reading from PFN 0 and PFN 1 seems to be problematic on !x86 systems. In particularly, on arm64 tx2 machines where noting resides at these physical memory locations, we can generate RAS errors. Let's fix it by scanning /proc/...
```diff diff --git a/tools/testing/selftests/mm/pfnmap.c b/tools/testing/selftests/mm/pfnmap.c index 8a9d19b6020c..866ac023baf5 100644 --- a/tools/testing/selftests/mm/pfnmap.c +++ b/tools/testing/selftests/mm/pfnmap.c @@ -12,6 +12,8 @@ #include <stdint.h> #include <unistd.h> #include <errno.h> +#include <stdio.h> +...
595cf683519ab5a277d258a2251ee8cc7b838d6d
Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: fix race with folio split/free using temporary reference
Problem Details: hpage_collapse_scan_file() calls is_refcount_suitable(), which in turn calls folio_mapcount(). folio_mapcount() checks folio_test_large() before proceeding to folio_large_mapcount(), but there is a race window where the folio may get split/freed between these checks, triggering: VM_WARN_ON_FOLIO(!f...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index cdf5a581368b..7731a162a1a7 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -2293,6 +2293,17 @@ static int hpage_collapse_scan_file(struct mm_struct *mm, unsigned long addr, continue; } + if (!folio_try_get(folio)) { + xas_reset(&xas); + co...
cfc695109a6cd9b7228ad19ef7e74a851856ce3d
Analyze and fix the following issue in the Linux kernel code: selftests/mm: deduplicate test names in madv_populate
Problem Details: The madv_populate selftest has some repetitive code for several different cases that it covers, included repeated test names used in ksft_test_result() reports. This causes problems for automation, the test name is used to both track the test between runs and distinguish between multiple tests within ...
```diff diff --git a/tools/testing/selftests/mm/madv_populate.c b/tools/testing/selftests/mm/madv_populate.c index ef7d911da13e..b6fabd5c27ed 100644 --- a/tools/testing/selftests/mm/madv_populate.c +++ b/tools/testing/selftests/mm/madv_populate.c @@ -172,12 +172,12 @@ static void test_populate_read(void) if (addr == ...
5a78977262f47dd52a4880689a2ca3d21dbf149a
Analyze and fix the following issue in the Linux kernel code: mm: rust: make CONFIG_MMU ifdefs more narrow
Problem Details: Currently the entire kernel::mm module is ifdef'd out when CONFIG_MMU=n. However, there are some downstream users of the module in rust/kernel/task.rs and rust/kernel/miscdevice.rs. Thus, update the cfgs so that only MmWithUserAsync is removed with CONFIG_MMU=n. The code is moved into a new file, sinc...
```diff diff --git a/rust/kernel/mm.rs b/rust/kernel/mm.rs index 615907a0f3b4..43f525c0d16c 100644 --- a/rust/kernel/mm.rs +++ b/rust/kernel/mm.rs @@ -10,7 +10,6 @@ //! control what happens when userspace reads or writes to that region of memory. //! //! C header: [`include/linux/mm.h`](srctree/include/linux/mm.h) -...
bfe125f1b1870c7b5f05b489a525042d6715fcc1
Analyze and fix the following issue in the Linux kernel code: mmu_gather: move tlb flush for VM_PFNMAP/VM_MIXEDMAP vmas into free_pgtables()
Problem Details: Commit b67fbebd4cf9 ("mmu_gather: Force tlb-flush VM_PFNMAP vmas") added a forced tlbflush to tlb_vma_end(), which is required to avoid a race between munmap() and unmap_mapping_range(). However it added some overhead to other paths where tlb_vma_end() is used, but vmas are not removed, e.g. madvise(...
```diff diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index 88a42973fa47..1fff717cae51 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h @@ -58,6 +58,11 @@ * Defaults to flushing at tlb_end_vma() to reset the range; helps when * there's large holes between the VMAs. ...
a5cdbe9f376f920af102fd0f0ecfd9952bb6bc40
Analyze and fix the following issue in the Linux kernel code: mm: shmem: only remove inode from swaplist when it's swapped page count is 0
Problem Details: Even if we fail to allocate a swap entry, the inode might have previously allocated entry and we might take inode containing swap entry off swaplist. As a result, try_to_unuse() may enter a potential dead loop to repeatedly look for inode and clean it's swap entry. Only take inode off swaplist when i...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index aeeddf612baa..07b8e1400c67 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1651,8 +1651,8 @@ try_split: BUG_ON(folio_mapped(folio)); return swap_writepage(&folio->page, wbc); } - - list_del_init(&info->swaplist); + if (!info->swapped) + list_del_init(&info->swapl...
3f778ab1b52450d467109321e2abfc4b36ec2d3e
Analyze and fix the following issue in the Linux kernel code: mm/shmem: fix potential dead loop in shmem_unuse()
Problem Details: If multi shmem_unuse() for different swap type is called concurrently, a dead loop could occur as following: shmem_unuse(typeA) shmem_unuse(typeB) mutex_lock(&shmem_swaplist_mutex) list_for_each_entry_safe(info, next, ...) ... mutex_unlock(&shmem_swaplist_mutex) /* info->swapped ...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index 495e661eb8bb..aeeddf612baa 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1505,6 +1505,7 @@ int shmem_unuse(unsigned int type) return 0; mutex_lock(&shmem_swaplist_mutex); +start_over: list_for_each_entry_safe(info, next, &shmem_swaplist, swaplist) { if (!inf...
594ec2ab389ab9cdada13ad85f503bbfc5658e84
Analyze and fix the following issue in the Linux kernel code: mm: shmem: add missing shmem_unacct_size() in __shmem_file_setup()
Problem Details: We will miss shmem_unacct_size() when is_idmapped_mnt() returns a failure. Move is_idmapped_mnt() before shmem_acct_size() to fix the issue. Link: https://lkml.kernel.org/r/20250516170939.965736-3-shikemeng@huaweicloud.com Fixes: 7a80e5b8c6fa ("shmem: support idmapped mounts for tmpfs") Signed-off-by:...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index 980fa15f393e..495e661eb8bb 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -5812,12 +5812,12 @@ static struct file *__shmem_file_setup(struct vfsmount *mnt, const char *name, if (size < 0 || size > MAX_LFS_FILESIZE) return ERR_PTR(-EINVAL); - if (shmem_acct_size(fla...
e08d5f515613a9860bfee7312461a19f422adb5e
Analyze and fix the following issue in the Linux kernel code: mm: shmem: avoid unpaired folio_unlock() in shmem_swapin_folio()
Problem Details: Patch series "Some random fixes and cleanup to shmem", v3. This series contains some simple fixes and cleanup which are made during learning shmem. More details can be found in respective patches. This patch (of 5): If we get a folio from swap_cache_get_folio() successfully but encounter a failure...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index 99327c30507c..980fa15f393e 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2335,6 +2335,8 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index, */ split_order = shmem_split_large_entry(inode, index, swap, gfp); if (split_order < 0) { + folio_put...
8e1c4961f44be6172553c062d8f425a4a4357afa
Analyze and fix the following issue in the Linux kernel code: mm/damon/core: avoid destroyed target reference from DAMOS quota
Problem Details: When the number of the monitoring targets in running contexts is reduced, there may be DAMOS quotas referencing the targets that will be destroyed. Applying the scheme action for such DAMOS scheme will be skipped forever looking for the starting part of the region for the destroyed monitoring target. ...
```diff diff --git a/mm/damon/core.c b/mm/damon/core.c index 0bb71e2ab713..b217e0120e09 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1093,9 +1093,17 @@ static int damon_commit_targets( if (err) return err; } else { + struct damos *s; + if (damon_target_has_pid(dst)) put_pid(dst_target->...
62973e38670a660480ab19c9241f8d77e89b0199
Analyze and fix the following issue in the Linux kernel code: selftests/mm: deduplicate test logging in test_mlock_lock()
Problem Details: The mlock2-tests test_mlock_lock() test reports two test results with an identical string, one reporitng if it successfully locked a block of memory and another reporting if the lock is still present after doing an unlock (following a similar pattern to other tests in the same program). This confuses ...
```diff diff --git a/tools/testing/selftests/mm/mlock2-tests.c b/tools/testing/selftests/mm/mlock2-tests.c index 7f0d50fa361d..3e90ff37e336 100644 --- a/tools/testing/selftests/mm/mlock2-tests.c +++ b/tools/testing/selftests/mm/mlock2-tests.c @@ -196,7 +196,7 @@ static void test_mlock_lock(void) ksft_exit_fail_msg("...
a5ade2e9fa6af5ba545c0f94a65dd001c90c1cf7
Analyze and fix the following issue in the Linux kernel code: zram: rename ZCOMP_PARAM_NO_LEVEL
Problem Details: Patch series "zram: support algorithm-specific parameters". This patchset adds support for algorithm-specific parameters. For now, only deflate-specific winbits can be configured, which fixes deflate support on some s390 setups. This patch (of 2): Use more generic name because this will be default...
```diff diff --git a/drivers/block/zram/backend_deflate.c b/drivers/block/zram/backend_deflate.c index 0f7f252c12f4..4c00b5b6739f 100644 --- a/drivers/block/zram/backend_deflate.c +++ b/drivers/block/zram/backend_deflate.c @@ -22,7 +22,7 @@ static void deflate_release_params(struct zcomp_params *params) static int d...
6447544c3d1473c9d8945e2cc0f3c71eba4c354b
Analyze and fix the following issue in the Linux kernel code: bcachefs: Improve error printing in btree_node_check_topology()
Problem Details: We had a bug report where the errors from btree_node_check_topology() don't seem to be getting printed; log_fsck_err() does some fancy ratelimiting-type stuff that we don't want here. Instead, just use bch2_count_fsck_err(); this is simpler, and modelled after how we're currently handling bucket ref u...
```diff diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index 74e65714fecd..647b40efd27f 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -57,8 +57,6 @@ int bch2_btree_node_check_topology(struct btree_trans *trans, struct btree *b) st...
642c1aabb001ee8410e6bfb6654b23bcead64e4e
Analyze and fix the following issue in the Linux kernel code: bcachefs: Use bch2_err_matches() for BCH_ERR_fsck_(fix|ignore)
Problem Details: We'll be adding subtypes of these errors, and new error code tracing. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 271d4a2eb15f..f284b4a2b535 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -709,8 +709,8 @@ static int __need_discard_or_freespace_err(struct btree_trans *trans, set ? "" : "un", ...
236918d3e9ac45d593c2f74e1df598483a508d2f
Analyze and fix the following issue in the Linux kernel code: selftests: ublk: add functional test for per io daemons
Problem Details: Add a new test test_generic_12 which: - sets up a ublk server with per_io_tasks and a different number of ublk server threads and ublk_queues. This is possible now that these objects are decoupled - runs some I/O load from a single CPU - verifies that all the ublk server threads handle some I/O B...
```diff diff --git a/tools/testing/selftests/ublk/Makefile b/tools/testing/selftests/ublk/Makefile index 4dde8838261d..5d7f4ecfb816 100644 --- a/tools/testing/selftests/ublk/Makefile +++ b/tools/testing/selftests/ublk/Makefile @@ -19,6 +19,7 @@ TEST_PROGS += test_generic_08.sh TEST_PROGS += test_generic_09.sh TEST_PR...
4cb6c8af8591135ec000fbe4bb474139ceec595d
Analyze and fix the following issue in the Linux kernel code: selftests/filesystems: Fix build of anon_inode_test
Problem Details: The newly added anon_inode_test test fails to build due to attempting to include a nonexisting overlayfs/wrapper.h: anon_inode_test.c:10:10: fatal error: overlayfs/wrappers.h: No such file or directory 10 | #include "overlayfs/wrappers.h" | ^~~~~~~~~~~~~~~~~~~~~~ This is due t...
```diff diff --git a/tools/testing/selftests/filesystems/anon_inode_test.c b/tools/testing/selftests/filesystems/anon_inode_test.c index e8e0ef1460d2..73e0a4d4fb2f 100644 --- a/tools/testing/selftests/filesystems/anon_inode_test.c +++ b/tools/testing/selftests/filesystems/anon_inode_test.c @@ -7,7 +7,7 @@ #include <sy...
213205889d5ffc19cb8df06aa6778b2d4724c887
Analyze and fix the following issue in the Linux kernel code: parisc/unaligned: Fix hex output to show 8 hex chars
Problem Details: Change back printk format to 0x%08lx instead of %#08lx, since the latter does not seem to reliably format the value to 8 hex chars. Signed-off-by: Helge Deller <deller@gmx.de> Cc: stable@vger.kernel.org # v5.18+ Fixes: e5e9e7f222e5b ("parisc/unaligned: Enhance user-space visible output")
```diff diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index f4626943633a..00e97204783e 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c @@ -25,7 +25,7 @@ #define DPRINTF(fmt, args...) #endif -#define RFMT "%#08lx" +#define RFMT "0x%08lx" /* 1111 1100...
a913ef6fd883c05bd6538ed21ee1e773f0d750b7
Analyze and fix the following issue in the Linux kernel code: perf callchain: Always populate the addr_location map when adding IP
Problem Details: Dropping symbols also meant the callchain maps wasn't populated, but the callchain map is needed to find the DSO. Plumb the symbols option better, falling back to thread__find_map() rather than thread__find_symbol() when symbols are disabled. Fixes: 02b2705017d2e5ad ("perf callchain: Allow symbols to...
```diff diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index c5e28d15323f..7ec12c207970 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -2011,7 +2011,7 @@ static void ip__resolve_ams(struct thread *thread, * Thus, we have to try consecutively until we find a match * o...
05f6e183879d9785a3cdf2f08a498bc31b7a20aa
Analyze and fix the following issue in the Linux kernel code: fbdev: Fix fb_set_var to prevent null-ptr-deref in fb_videomode_to_var
Problem Details: If fb_add_videomode() in fb_set_var() fails to allocate memory for fb_videomode, later it may lead to a null-ptr dereference in fb_videomode_to_var(), as the fb_info is registered while not having the mode in modelist that is expected to be there, i.e. the one that is described in fb_info->var. ======...
```diff diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index e1557d80768f..eca2498f2436 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -328,8 +328,10 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) !list_empty(&info->mod...
17186f1f90d34fa701e4f14e6818305151637b9e
Analyze and fix the following issue in the Linux kernel code: fbdev: Fix do_register_framebuffer to prevent null-ptr-deref in fb_videomode_to_var
Problem Details: If fb_add_videomode() in do_register_framebuffer() fails to allocate memory for fb_videomode, it will later lead to a null-ptr dereference in fb_videomode_to_var(), as the fb_info is registered while not having the mode in modelist that is expected to be there, i.e. the one that is described in fb_info...
```diff diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 3c568cff2913..e1557d80768f 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -388,7 +388,7 @@ static int fb_check_foreignness(struct fb_info *fi) static int do_register_framebuffer(str...
9c221db509695243f37fd68e5313a4c62eac9887
Analyze and fix the following issue in the Linux kernel code: fbdev: sstfb.rst: Fix spelling mistake
Problem Details: Fix spelling: "tweeks" to "tweaks" Signed-off-by: Rujra Bhatt <braker.noob.kernel@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
```diff diff --git a/Documentation/fb/sstfb.rst b/Documentation/fb/sstfb.rst index 88d5a52b13d8..7386eb63bac8 100644 --- a/Documentation/fb/sstfb.rst +++ b/Documentation/fb/sstfb.rst @@ -192,7 +192,7 @@ Todo - Get rid of the previous paragraph. - Buy more coffee. - test/port to other arch. -- try to add panning usin...
3f6dae09fc8c306eb70fdfef70726e1f154e173a
Analyze and fix the following issue in the Linux kernel code: fbdev: core: fbcvt: avoid division by 0 in fb_cvt_hperiod()
Problem Details: In fb_find_mode_cvt(), iff mode->refresh somehow happens to be 0x80000000, cvt.f_refresh will become 0 when multiplying it by 2 due to overflow. It's then passed to fb_cvt_hperiod(), where it's used as a divider -- division by 0 will result in kernel oops. Add a sanity check for cvt.f_refresh to avoid ...
```diff diff --git a/drivers/video/fbdev/core/fbcvt.c b/drivers/video/fbdev/core/fbcvt.c index 64843464c661..cd3821bd82e5 100644 --- a/drivers/video/fbdev/core/fbcvt.c +++ b/drivers/video/fbdev/core/fbcvt.c @@ -312,7 +312,7 @@ int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb) cvt.f_refresh = cvt.re...
cedc1b63394a866bf8663a3e40f4546f1d28c8d8
Analyze and fix the following issue in the Linux kernel code: fbcon: Make sure modelist not set on unregistered console
Problem Details: It looks like attempting to write to the "store_modes" sysfs node will run afoul of unregistered consoles: UBSAN: array-index-out-of-bounds in drivers/video/fbdev/core/fbcon.c:122:28 index -1 is out of range for type 'fb_info *[32]' ... fbcon_info_from_console+0x192/0x1a0 drivers/video/fbdev/core/fbc...
```diff diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c index ac3c99ed92d1..2df48037688d 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -117,9 +117,14 @@ static signed char con2fb_map_boot[MAX_NR_CONSOLES]; static struct fb_info *fbcon_info_fr...
864f9963ec6b4b76d104d595ba28110b87158003
Analyze and fix the following issue in the Linux kernel code: vgacon: Add check for vc_origin address range in vgacon_scroll()
Problem Details: Our in-house Syzkaller reported the following BUG (twice), which we believed was the same issue with [1]: ================================================================== BUG: KASAN: slab-out-of-bounds in vcs_scr_readw+0xc2/0xd0 drivers/tty/vt/vt.c:4740 Read of size 2 at addr ffff88800f5bef60 by tas...
```diff diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 37bd18730fe0..f9cdbf8c53e3 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -1168,7 +1168,7 @@ static bool vgacon_scroll(struct vc_data *c, unsigned int t, unsigned int b, c->vc_screen...
34fe05cd2d0f4cc625afb656469a9838f02ca59e
Analyze and fix the following issue in the Linux kernel code: fbdev: nvidiafb: Correct const string length in nvidiafb_setup()
Problem Details: The actual length of const string "noaccel" is 7, but the strncmp() branch in nvidiafb_setup() wrongly hard codes it as 6. Fix by using actual length 7 as argument of the strncmp(). Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Signed-off-by: Helge Deller <deller@gmx.de>
```diff diff --git a/drivers/video/fbdev/nvidia/nvidia.c b/drivers/video/fbdev/nvidia/nvidia.c index 8900f181f195..cfaf9454014d 100644 --- a/drivers/video/fbdev/nvidia/nvidia.c +++ b/drivers/video/fbdev/nvidia/nvidia.c @@ -1484,7 +1484,7 @@ static int nvidiafb_setup(char *options) flatpanel = 1; } else if (!strn...
67ebb5890a15e82f369df46e9411250252b5a98c
Analyze and fix the following issue in the Linux kernel code: fbdev: carminefb: Fix spelling mistake of CARMINE_TOTAL_DIPLAY_MEM
Problem Details: There is a spelling mistake in macro CARMINE_TOTAL_DIPLAY_MEM. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
```diff diff --git a/drivers/video/fbdev/carminefb.c b/drivers/video/fbdev/carminefb.c index e56065cdba97..2bdd67595891 100644 --- a/drivers/video/fbdev/carminefb.c +++ b/drivers/video/fbdev/carminefb.c @@ -649,13 +649,13 @@ static int carminefb_probe(struct pci_dev *dev, const struct pci_device_id *ent) * is requir...
86aa94cd50b138be0dd872b0779fa3036e641881
Analyze and fix the following issue in the Linux kernel code: perf/x86/intel: Fix incorrect MSR index calculations in intel_pmu_config_acr()
Problem Details: The MSR offset calculations in intel_pmu_config_acr() are buggy. To calculate fixed counter MSR addresses in intel_pmu_config_acr(), the HW counter index "idx" is subtracted by INTEL_PMC_IDX_FIXED. This leads to the ACR mask value of fixed counters to be incorrectly saved to the positions of GP count...
```diff diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 466283326630..741b229f0718 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -2900,6 +2900,7 @@ static void intel_pmu_config_acr(int idx, u64 mask, u32 reload) { struct cpu_hw_events *cpuc = this_cpu_...
ead7f9b8de65632ef8060b84b0c55049a33cfea1
Analyze and fix the following issue in the Linux kernel code: bpf: Fix L4 csum update on IPv6 in CHECKSUM_COMPLETE
Problem Details: In Cilium, we use bpf_csum_diff + bpf_l4_csum_replace to, among other things, update the L4 checksum after reverse SNATing IPv6 packets. That use case is however not currently supported and leads to invalid skb->csum values in some cases. This patch adds support for IPv6 address changes in bpf_l4_csum_...
```diff diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 85180e4aaa5a..0b4a2f124d11 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -2056,6 +2056,7 @@ union bpf_attr { * for updates resulting in a null checksum the value is set to * **CSUM_MANGLED_0** instead. Flag ...
6043b794c7668c19dabc4a93c75b924a19474d59
Analyze and fix the following issue in the Linux kernel code: net: Fix checksum update for ILA adj-transport
Problem Details: During ILA address translations, the L4 checksums can be handled in different ways. One of them, adj-transport, consist in parsing the transport layer and updating any found checksum. This logic relies on inet_proto_csum_replace_by_diff and produces an incorrect skb->csum when in state CHECKSUM_COMPLET...
```diff diff --git a/include/net/checksum.h b/include/net/checksum.h index e57986b173f8..3cbab35de5ab 100644 --- a/include/net/checksum.h +++ b/include/net/checksum.h @@ -152,7 +152,7 @@ void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, const __be32 *from, const __be32 *to, bool ps...
cbefe2ffa7784525ec5d008ba87c7add19ec631a
Analyze and fix the following issue in the Linux kernel code: net: stmmac: make sure that ptp_rate is not 0 before configuring EST
Problem Details: If the ptp_rate recorded earlier in the driver happens to be 0, this bogus value will propagate up to EST configuration, where it will trigger a division by 0. Prevent this division by 0 by adding the corresponding check and error code. Suggested-by: Maxime Chevallier <maxime.chevallier@bootlin.com> ...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c index c9693f77e1f6..ac6f2e3a3fcd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_est.c @@ -32,6 +32,11 @@ static int est_configure(struc...
030ce919e114a111e83b7976ecb3597cefd33f26
Analyze and fix the following issue in the Linux kernel code: net: stmmac: make sure that ptp_rate is not 0 before configuring timestamping
Problem Details: The stmmac platform drivers that do not open-code the clk_ptp_rate value after having retrieved the default one from the device-tree can end up with 0 in clk_ptp_rate (as clk_get_rate can return 0). It will eventually propagate up to PTP initialization when bringing up the interface, leading to a divid...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 085c09039af4..1369fa70bc58 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -805,6 +805,11 @@ int stmmac_init_tstamp_c...
3ec523304976648b45a3eef045e97d17122ff1b2
Analyze and fix the following issue in the Linux kernel code: hv_netvsc: fix potential deadlock in netvsc_vf_setxdp()
Problem Details: The MANA driver's probe registers netdevice via the following call chain: mana_probe() register_netdev() register_netdevice() register_netdevice() calls notifier callback for netvsc driver, holding the netdev mutex via netdev_lock_ops(). Further this netvsc notifier callback end up attempting ...
```diff diff --git a/drivers/net/hyperv/netvsc_bpf.c b/drivers/net/hyperv/netvsc_bpf.c index e01c5997a551..1dd3755d9e6d 100644 --- a/drivers/net/hyperv/netvsc_bpf.c +++ b/drivers/net/hyperv/netvsc_bpf.c @@ -183,7 +183,7 @@ int netvsc_vf_setxdp(struct net_device *vf_netdev, struct bpf_prog *prog) xdp.command = XDP_SET...
c1f4cb8a8d48db5c8396e1976c5b2e7922d944b9
Analyze and fix the following issue in the Linux kernel code: net: Fix net_devmem_bind_dmabuf for non-devmem configs
Problem Details: Fix the signature of the net_devmem_bind_dmabuf API for CONFIG_NET_DEVMEM=n. Fixes: bd61848900bf ("net: devmem: Implement TX path") Signed-off-by: Pranjal Shrivastava <praan@google.com> Link: https://patch.msgid.link/20250528211058.1826608-1-praan@google.com Signed-off-by: Jakub Kicinski <kuba@kernel....
```diff diff --git a/net/core/devmem.h b/net/core/devmem.h index e7ba77050b8f..0a3b28ba5c13 100644 --- a/net/core/devmem.h +++ b/net/core/devmem.h @@ -170,8 +170,9 @@ static inline void __net_devmem_dmabuf_binding_free(struct work_struct *wq) } static inline struct net_devmem_dmabuf_binding * -net_devmem_bind_dmabu...
efdddc4484859082da6c7877ed144c8121c8ea55
Analyze and fix the following issue in the Linux kernel code: net: dsa: tag_brcm: legacy: fix pskb_may_pull length
Problem Details: BRCM_LEG_PORT_ID was incorrectly used for pskb_may_pull length. The correct check is BRCM_LEG_TAG_LEN + VLAN_HLEN, or 10 bytes. Fixes: 964dbf186eaa ("net: dsa: tag_brcm: add support for legacy tags") Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Florian Fainelli <florian.faine...
```diff diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c index 8c3c068728e5..fe75821623a4 100644 --- a/net/dsa/tag_brcm.c +++ b/net/dsa/tag_brcm.c @@ -257,7 +257,7 @@ static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb, int source_port; u8 *brcm_tag; - if (unlikely(!pskb_may_pull(skb, BRCM_LEG_PORT_ID...
ee9a4e92799d72b1a2237d76065562b1f1cf334f
Analyze and fix the following issue in the Linux kernel code: sched_ext: idle: Properly handle invalid prev_cpu during idle selection
Problem Details: The default idle selection policy doesn't properly handle the case where @prev_cpu is not part of the task's allowed CPUs. In this situation, it may return an idle CPU that is not usable by the task, breaking the assumption that the returned CPU must always be within the allowed cpumask, causing ineff...
```diff diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c index 66da03cc0b33..9477fbb8d625 100644 --- a/kernel/sched/ext_idle.c +++ b/kernel/sched/ext_idle.c @@ -447,10 +447,17 @@ s32 scx_select_cpu_dfl(struct task_struct *p, s32 prev_cpu, u64 wake_flags, const struct cpumask *llc_cpus = NULL, *numa_cpus...
c853d18706de8c9525126b362f747d2e480e93df
Analyze and fix the following issue in the Linux kernel code: cgroup: adjust criteria for rstat subsystem cpu lock access
Problem Details: Previously it was found that on uniprocessor machines the size of raw_spinlock_t could be zero so a pre-processor conditional was used to avoid the allocation of ss->rstat_ss_cpu_lock. The conditional did not take into account cases where lock debugging features were enabled. Cover these cases along wi...
```diff diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c index ce4752ab9e09..cbeaa499a96a 100644 --- a/kernel/cgroup/rstat.c +++ b/kernel/cgroup/rstat.c @@ -47,8 +47,20 @@ static spinlock_t *ss_rstat_lock(struct cgroup_subsys *ss) static raw_spinlock_t *ss_rstat_cpu_lock(struct cgroup_subsys *ss, int cpu) ...
a95ef0199e80f3384eb992889322957d26c00102
Analyze and fix the following issue in the Linux kernel code: Input: ims-pcu - check record size in ims_pcu_flash_firmware()
Problem Details: The "len" variable comes from the firmware and we generally do trust firmware, but it's always better to double check. If the "len" is too large it could result in memory corruption when we do "memcpy(fragment->data, rec->data, len);" Fixes: 628329d52474 ("Input: add IMS Passenger Control Unit driver...
```diff diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c index d9ee14b1f451..4581f1c53644 100644 --- a/drivers/input/misc/ims-pcu.c +++ b/drivers/input/misc/ims-pcu.c @@ -844,6 +844,12 @@ static int ims_pcu_flash_firmware(struct ims_pcu *pcu, addr = be32_to_cpu(rec->addr) / 2; len = be16_t...
8f38219fa139623c29db2cb0f17d0a197a86e344
Analyze and fix the following issue in the Linux kernel code: Input: gpio-keys - fix possible concurrent access in gpio_keys_irq_timer()
Problem Details: gpio_keys_irq_isr() and gpio_keys_irq_timer() access the same resources. There could be a concurrent access if a GPIO interrupt occurs in parallel of a HR timer interrupt. Guard back those resources with a spinlock. Fixes: 019002f20cb5 ("Input: gpio-keys - use hrtimer for release timer") Signed-off-b...
```diff diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index d884538107c9..f9db86da0818 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -449,6 +449,8 @@ static enum hrtimer_restart gpio_keys_irq_timer(struct hrtimer *t) relea...
f4a8f561d08e39f7833d4a278ebfb12a41eef15f
Analyze and fix the following issue in the Linux kernel code: Input: gpio-keys - fix a sleep while atomic with PREEMPT_RT
Problem Details: When enabling PREEMPT_RT, the gpio_keys_irq_timer() callback runs in hard irq context, but the input_event() takes a spin_lock, which isn't allowed there as it is converted to a rt_spin_lock(). [ 4054.289999] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 [ 4054....
```diff diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 5c39a217b94c..d884538107c9 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -486,7 +486,7 @@ static irqreturn_t gpio_keys_irq_isr(int irq, void *dev_id) if (bdata->release_dela...
11172ec55b4c827052985407abf6d909b5266fd3
Analyze and fix the following issue in the Linux kernel code: Input: amijoy - fix grammar in documentation
Problem Details: Make small grammar fixes to Amiga joystick documentation. Signed-off-by: George Anthony Vernon <contact@gvernon.com> Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com> Link: https://lore.kernel.org/r/20250526135957.180254-4-contact@gvernon.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
```diff diff --git a/Documentation/input/devices/amijoy.rst b/Documentation/input/devices/amijoy.rst index ea4de1ac0360..cbc5240f8af3 100644 --- a/Documentation/input/devices/amijoy.rst +++ b/Documentation/input/devices/amijoy.rst @@ -1,14 +1,13 @@ -~~~~~~~~~~~~~~~~~~~~~~~~~ -Amiga joystick extensions -~~~~~~~~~~~~~~~~...
ed1d9c2b0dbc3c2d4b86f006e39d2c0ca8ac15c8
Analyze and fix the following issue in the Linux kernel code: Input: amijoy - fix Amiga 4-joystick adapter pinout in documentation
Problem Details: Pinout incorrectly duplicated pin 18, correct this. Signed-off-by: George Anthony Vernon <contact@gvernon.com> Link: https://lore.kernel.org/r/20250526135957.180254-3-contact@gvernon.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
```diff diff --git a/Documentation/input/devices/amijoy.rst b/Documentation/input/devices/amijoy.rst index f854ee975247..ea4de1ac0360 100644 --- a/Documentation/input/devices/amijoy.rst +++ b/Documentation/input/devices/amijoy.rst @@ -17,7 +17,7 @@ Pin Meaning Pin Meaning 4 Left1 8 Left2 5 Right...
fb81e4738ec9d727830be2787556932446271369
Analyze and fix the following issue in the Linux kernel code: Input: amijoy - fix broken table formatting in documentation
Problem Details: Missing '+' led to unintended spanning cell. Correct this. Signed-off-by: George Anthony Vernon <contact@gvernon.com> Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com> Link: https://lore.kernel.org/r/20250526135957.180254-2-contact@gvernon.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
```diff diff --git a/Documentation/input/devices/amijoy.rst b/Documentation/input/devices/amijoy.rst index 8df7b11cd98d..f854ee975247 100644 --- a/Documentation/input/devices/amijoy.rst +++ b/Documentation/input/devices/amijoy.rst @@ -123,7 +123,7 @@ JOY1DAT Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 X7 X6 X5 X4 X3 X2 ...
e4931f8be347ec5f19df4d6d33aea37145378c42
Analyze and fix the following issue in the Linux kernel code: drm/xe/vsec: fix CONFIG_INTEL_VSEC dependency
Problem Details: The XE driver can be built with or without VSEC support, but fails to link as built-in if vsec is in a loadable module: x86_64-linux-ld: vmlinux.o: in function `xe_vsec_init': (.text+0x1e83e16): undefined reference to `intel_vsec_register' The normal fix for this is to add a 'depends on INTEL_VSEC ||...
```diff diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig index 9bce047901b2..98b46c534278 100644 --- a/drivers/gpu/drm/xe/Kconfig +++ b/drivers/gpu/drm/xe/Kconfig @@ -2,6 +2,8 @@ config DRM_XE tristate "Intel Xe Graphics" depends on DRM && PCI && MMU && (m || (y && KUNIT=y)) + depends on INTEL_...
9dc63d8ff182150d7d7b318ab9389702a2c0a292
Analyze and fix the following issue in the Linux kernel code: idpf: avoid mailbox timeout delays during reset
Problem Details: Mailbox operations are not possible while the driver is in reset. Operations that require MBX exchange with the control plane will result in long delays if executed while a reset is in progress: ethtool -L <inf> combined 8& echo 1 > /sys/class/net/<inf>/device/reset idpf 0000:83:00.0: HW reset detecte...
```diff diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c index bab12ecb2df5..4eb20ec2accb 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_lib.c +++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c @@ -1801,11 +1801,19 @@ void idpf_vc_event_task(struct work_struct *work)...
7292af042bcf22e2c18b96ed250f78498a5b28ab
Analyze and fix the following issue in the Linux kernel code: idpf: fix a race in txq wakeup
Problem Details: Add a helper function to correctly handle the lockless synchronization when the sender needs to block. The paradigm is if (no_resources()) { stop_queue(); barrier(); if (!no_resources()) restart_queue(); } netif_s...
```diff diff --git a/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c index 2e356dd10812..993c354aa27a 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c +++ b/drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c @@ -362,17 +362,18 @@ netdev_tx_t idp...
73145e6d81070d34a21431c9e0d7aaf2f29ca048
Analyze and fix the following issue in the Linux kernel code: ice: fix rebuilding the Tx scheduler tree for large queue counts
Problem Details: The current implementation of the Tx scheduler allows the tree to be rebuilt as the user adds more Tx queues to the VSI. In such a case, additional child nodes are added to the tree to support the new number of queues. Unfortunately, this algorithm does not take into account that the limit of the VSI s...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c index 6524875b34d3..d9d09296d1d4 100644 --- a/drivers/net/ethernet/intel/ice/ice_sched.c +++ b/drivers/net/ethernet/intel/ice/ice_sched.c @@ -84,6 +84,27 @@ ice_sched_find_node_by_teid(struct ice_sched_node *sta...
6fa2942578472c9cab13a8fc1dae0d830193e0a1
Analyze and fix the following issue in the Linux kernel code: ice: create new Tx scheduler nodes for new queues only
Problem Details: The current implementation of the Tx scheduler tree attempts to create nodes for all Tx queues, ignoring the fact that some queues may already exist in the tree. For example, if the VSI already has 128 Tx queues and the user requests for 16 new queues, the Tx scheduler will compute the tree for 272 que...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_sched.c b/drivers/net/ethernet/intel/ice/ice_sched.c index 6ca13c5dcb14..6524875b34d3 100644 --- a/drivers/net/ethernet/intel/ice/ice_sched.c +++ b/drivers/net/ethernet/intel/ice/ice_sched.c @@ -1604,16 +1604,16 @@ ice_sched_get_agg_node(struct ice_port_info *pi, ...
0153f36041b8e52019ebfa8629c13bf8f9b0a951
Analyze and fix the following issue in the Linux kernel code: ice: fix Tx scheduler error handling in XDP callback
Problem Details: When the XDP program is loaded, the XDP callback adds new Tx queues. This means that the callback must update the Tx scheduler with the new queue number. In the event of a Tx scheduler failure, the XDP callback should also fail and roll back any changes previously made for XDP preparation. The previou...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 20d3baf955e3..d97d4b25b30d 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -2740,6 +2740,27 @@ void ice_map_xdp_rings(struct ice_vsi *vsi) } } +...
03dba9cea72f977e873e4e60e220fa596959dd8f
Analyze and fix the following issue in the Linux kernel code: Bluetooth: L2CAP: Fix not responding with L2CAP_CR_LE_ENCRYPTION
Problem Details: Depending on the security set the response to L2CAP_LE_CONN_REQ shall be just L2CAP_CR_LE_ENCRYPTION if only encryption when BT_SECURITY_MEDIUM is selected since that means security mode 2 which doesn't require authentication which is something that is covered in the qualification test L2CAP/LE/CFC/BV-...
```diff diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 042d3ac3b4a3..a5bde5db58ef 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -4870,7 +4870,8 @@ static int l2cap_le_connect_req(struct l2cap_conn *conn, if (!smp_sufficient_security(conn->hcon, pchan->sec_le...
0fb410c914eb03c7e9d821e26d03bac0a239e5db
Analyze and fix the following issue in the Linux kernel code: Bluetooth: hci_qca: move the SoC type check to the right place
Problem Details: Commit 3d05fc82237a ("Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional()") accidentally changed the prevous behavior where power control would be disabled without the BT_EN GPIO only on QCA_WCN6750 and QCA_WCN6855 while also getting the error check wrong. We should treat ev...
```diff diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index e00590ba24fd..a2dc39c005f4 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -2415,14 +2415,14 @@ static int qca_serdev_probe(struct serdev_device *serdev) qcadev->bt_en = devm_gpiod_get_optional(&serde...
edc14f2adc6401d67bf73828d9135c80d32615a2
Analyze and fix the following issue in the Linux kernel code: Bluetooth: btnxpuart: Fix missing devm_request_irq() return value check
Problem Details: Return value of devm_request_irq() must be checked (function is even annotated) and without it clang W=1 complains: btnxpuart.c:494:6: error: unused variable 'ret' [-Werror,-Wunused-variable] Setting up wakeup IRQ handler is not really critical, because the handler is empty, so just log the informa...
```diff diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c index b34623a69b8a..6b13feed06df 100644 --- a/drivers/bluetooth/btnxpuart.c +++ b/drivers/bluetooth/btnxpuart.c @@ -533,6 +533,8 @@ static int ps_setup(struct hci_dev *hdev) ps_host_wakeup_irq_handler, IRQF_ONESHOT | IRQF_TRI...
03f1700b9b4d4f2fed3165370f3c23db76553178
Analyze and fix the following issue in the Linux kernel code: Bluetooth: MGMT: reject malformed HCI_CMD_SYNC commands
Problem Details: In 'mgmt_hci_cmd_sync()', check whether the size of parameters passed in 'struct mgmt_cp_hci_cmd_sync' matches the total size of the data (i.e. 'sizeof(struct mgmt_cp_hci_cmd_sync)' plus trailing bytes). Otherwise, large invalid 'params_len' will cause 'hci_cmd_sync_alloc()' to do 'skb_put_data()' from...
```diff diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 261926dccc7e..14a9462fced5 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -2566,7 +2566,8 @@ static int mgmt_hci_cmd_sync(struct sock *sk, struct hci_dev *hdev, struct mgmt_pending_cmd *cmd; int err; - if (len < sizeof(*cp)) +...
9126d2754c5e5d1818765811a10af0a14cf1fa0a
Analyze and fix the following issue in the Linux kernel code: gfs2: Don't clear sb->s_fs_info in gfs2_sys_fs_add
Problem Details: When gfs2_sys_fs_add() fails, it sets sb->s_fs_info to NULL on its error path (see commit 0d515210b696 ("GFS2: Add kobject release method")). The intention seems to be to prevent dereferencing sb->s_fs_info once the object pointed to has been deallocated, but that would be better achieved by setting th...
```diff diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 653f0ff4b057..85c491fcf1a3 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -64,7 +64,10 @@ static void gfs2_tune_init(struct gfs2_tune *gt) void free_sbd(struct gfs2_sbd *sdp) { + struct super_block *sb = sdp->sd_vfs; + free_pe...
61761a6b57f2818983466d24aab60baab471ba21
Analyze and fix the following issue in the Linux kernel code: drm/xe: drop redundant conversion to bool
Problem Details: The result of integer comparison already evaluates to bool. No need for explicit conversion. No functional impact. Fixes: 0e414bf7ad01 ("drm/xe: Expose PCIe link downgrade attributes") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202505292205.MoljmkjQ-l...
```diff diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c index 2e657692e5b5..b9440f8c781e 100644 --- a/drivers/gpu/drm/xe/xe_device_sysfs.c +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c @@ -115,7 +115,7 @@ auto_link_downgrade_capable_show(struct device *dev, struct device_attribute ...
0c5405d3aa4ad871837bb1261f4128de09680c83
Analyze and fix the following issue in the Linux kernel code: drm/xe/hwmon: Read energy status from PMT
Problem Details: Read card and package energy status using pmt apis instead of xe_mmio for supported platforms. Enable Battlemage to read energy from PMT. v2: - Remove unused has_pmt_energy field. (Badal) - Use GENMASK to extract energy data. (Badal) v3: - Move PMT energy register offset and GENMASK to xe_pmt.h -...
```diff diff --git a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h index c556a04670ee..fb097607b86c 100644 --- a/drivers/gpu/drm/xe/regs/xe_pcode_regs.h +++ b/drivers/gpu/drm/xe/regs/xe_pcode_regs.h @@ -18,12 +18,10 @@ #define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)...
c713b9a23c73f6ce9c0197369668f216ed0e04c9
Analyze and fix the following issue in the Linux kernel code: drm/xe/hwmon: Add support to manage PL2 though mailbox
Problem Details: Add support to manage power limit PL2 (burst limit) through pcode mailbox commands. v2: - Update power1_cap definition in hwmon documentation. (Badal) - Clamp PL2 power limit to GPU firmware default value. v3: - Activate the power label when either the PL1 or PL2 power limit is enabled. v4: -...
```diff diff --git a/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon index 5a91dcccd3ac..dffd6443664a 100644 --- a/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon +++ b/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon @@ -148,3 +148,33 @@ Contact:...
25e963a09e059ffdb15c09cc79cfded855b43668
Analyze and fix the following issue in the Linux kernel code: drm/xe/hwmon: Move card reactive critical power under channel card
Problem Details: Move power2/curr2_crit to channel 1 i.e power1/curr1_crit as this represents the entire card critical power/current. v2: Update the date of curr1_crit also in hwmon documentation. Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> Fixes: 345dadc4f68b ("drm/xe/hwmon: Add infra to support card powe...
```diff diff --git a/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon b/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon index 4ca917ac6382..5a91dcccd3ac 100644 --- a/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon +++ b/Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon @@ -60,26 +60,26 @@ Descripti...
7596d839f6228757fe17a810da2d1c5f3305078c
Analyze and fix the following issue in the Linux kernel code: drm/xe/hwmon: Add support to manage power limits though mailbox
Problem Details: Add support to manage power limits using pcode mailbox commands for supported platforms. v2: - Address review comments. (Badal) - Use mailbox commands instead of registers to manage power limits for BMG. - Clamp the maximum power limit to GPU firmware default value. v3: - Clamp power limit in ...
```diff diff --git a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h index f5e5234857c1..5394a1373a6b 100644 --- a/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h +++ b/drivers/gpu/drm/xe/regs/xe_mchbar_regs.h @@ -38,10 +38,10 @@ #define TEMP_MASK REG_GENMASK(7, 0) #define PCU_CR_P...
ee084fa96123ede8b0563a1b5a9b23adc43cd50d
Analyze and fix the following issue in the Linux kernel code: LoongArch: Fix panic caused by NULL-PMD in huge_pte_offset()
Problem Details: ERROR INFO: CPU 25 Unable to handle kernel paging request at virtual address 0x0 ... Call Trace: [<900000000023c30c>] huge_pte_offset+0x3c/0x58 [<900000000057fd4c>] hugetlb_follow_page_mask+0x74/0x438 [<900000000051fee8>] __get_user_pages+0xe0/0x4c8 [<9000000000522414>] faultin_page_rang...
```diff diff --git a/arch/loongarch/mm/hugetlbpage.c b/arch/loongarch/mm/hugetlbpage.c index cea84d7f2b91..02dad4624fe3 100644 --- a/arch/loongarch/mm/hugetlbpage.c +++ b/arch/loongarch/mm/hugetlbpage.c @@ -47,7 +47,8 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr, pmd = pmd_offset(pud, addr); ...
a45728fd4120011c78af1d056e571b84d47dfcc1
Analyze and fix the following issue in the Linux kernel code: LoongArch: Enable HAVE_ARCH_STACKLEAK
Problem Details: Add support for the stackleak feature. It initializes the stack with the poison value before returning from system calls which improves the kernel security. At the same time, disables the plugin in EFI stub code because EFI stub is out of scope for the protection. Tested on Loongson-3A5000 (enable GC...
```diff diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index bfc5604c494d..38706186cf13 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -124,6 +124,7 @@ config LOONGARCH select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET select HAVE_ARCH_SECCOMP select HAVE_ARCH_SECCOMP_FILTER + select HAV...
b9802b54d41bbe98f673e08bc148b0c563fdc02e
Analyze and fix the following issue in the Linux kernel code: asm-generic: Add sched.h inclusion in simd.h
Problem Details: Commit 7ba8df47810f073 ("asm-generic: Make simd.h more resilient") causes a build error for PREEMPT_RT kernels: CC lib/crypto/sha256.o In file included from ./include/asm-generic/simd.h:6, from ./arch/loongarch/include/generated/asm/simd.h:1, from ./include/cry...
```diff diff --git a/include/asm-generic/simd.h b/include/asm-generic/simd.h index ac29a22eb7cf..70c8716ad32a 100644 --- a/include/asm-generic/simd.h +++ b/include/asm-generic/simd.h @@ -4,6 +4,7 @@ #include <linux/compiler_attributes.h> #include <linux/preempt.h> +#include <linux/sched.h> #include <linux/types.h>...
cddded9803cd6c4f53432cc64377d34522aa11c9
Analyze and fix the following issue in the Linux kernel code: crypto: s390/sha256 - rename module to sha256-s390
Problem Details: When the s390 SHA-256 code is built as a loadable module, name it sha256-s390.ko instead of sha256.ko. This avoids a module name collision with crypto/sha256.ko and makes it consistent with the other architectures. We should consider making a single module provide all the SHA-256 library code, which ...
```diff diff --git a/arch/s390/lib/crypto/Makefile b/arch/s390/lib/crypto/Makefile index 920197967f46..5df30f1e7930 100644 --- a/arch/s390/lib/crypto/Makefile +++ b/arch/s390/lib/crypto/Makefile @@ -3,4 +3,5 @@ obj-$(CONFIG_CRYPTO_CHACHA_S390) += chacha_s390.o chacha_s390-y := chacha-glue.o chacha-s390.o -obj-$(CON...
d3faab9b5a6a0477d69c38bd11c43aa5e936f929
Analyze and fix the following issue in the Linux kernel code: net: usb: aqc111: debug info before sanitation
Problem Details: If we sanitize error returns, the debug statements need to come before that so that we don't lose information. Signed-off-by: Oliver Neukum <oneukum@suse.com> Fixes: 405b0d610745 ("net: usb: aqc111: fix error handling of usbnet read calls") Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Davi...
```diff diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 453a2cf82753..9201ee10a13f 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -31,11 +31,11 @@ static int aqc111_read_cmd_nopm(struct usbnet *dev, u8 cmd, u16 value, USB_RECIP_DEVICE, value, index, data, size); ...
3d6d84c8f2f66d3fd6a43a1e2ce8e6b54c573960
Analyze and fix the following issue in the Linux kernel code: spi: bcm63xx-hsspi: fix shared reset
Problem Details: Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI and HSSPI controllers, so reset shouldn't be exclusive. Fixes: 0eeadddbf09a ("spi: bcm63xx-hsspi: add reset support") Reported-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> R...
```diff diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c index 644b44d2aef2..18261cbd413b 100644 --- a/drivers/spi/spi-bcm63xx-hsspi.c +++ b/drivers/spi/spi-bcm63xx-hsspi.c @@ -745,7 +745,7 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev) if (IS_ERR(clk)) return PTR_ERR...
5ad20e3d8cfe3b2e42bbddc7e0ebaa74479bb589
Analyze and fix the following issue in the Linux kernel code: spi: bcm63xx-spi: fix shared reset
Problem Details: Some bmips SoCs (bcm6362, bcm63268) share the same SPI reset for both SPI and HSSPI controllers, so reset shouldn't be exclusive. Fixes: 38807adeaf1e ("spi: bcm63xx-spi: add reset support") Reported-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Rev...
```diff diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index c8f64ec69344..b56210734caa 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -523,7 +523,7 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) return PTR_ERR(clk); } - reset = devm_reset_control_get...
4d62121ce9b58ea23c8d62207cbc604e98ecdc0a
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic-debug: Avoid dereferencing NULL ITE pointer
Problem Details: Dan reports that iterating over a device ITEs can legitimately lead to a NULL pointer, and that the NULL check is placed *after* the pointer has already been dereferenced. Hoist the pointer check as early as possible and be done with it. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Fixes: 30...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-debug.c b/arch/arm64/kvm/vgic/vgic-debug.c index f8425f381de9..2684f273d9e1 100644 --- a/arch/arm64/kvm/vgic/vgic-debug.c +++ b/arch/arm64/kvm/vgic/vgic-debug.c @@ -490,6 +490,9 @@ static int vgic_its_debug_show(struct seq_file *s, void *v) struct its_device *dev = iter->...
07212d16adc7a02810e1641c2721762751ce4f88
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: vgic-init: Plug vCPU vs. VGIC creation race
Problem Details: syzkaller has found another ugly race in the VGIC, this time dealing with VGIC creation. Since kvm_vgic_create() doesn't sufficiently protect against in-flight vCPU creations, it is possible to get a vCPU into the kernel w/ an in-kernel VGIC but no allocation of private IRQs: Unable to handle kernel...
```diff diff --git a/arch/arm64/kvm/vgic/vgic-init.c b/arch/arm64/kvm/vgic/vgic-init.c index 1f33e71c2a73..0611a1c2ce8e 100644 --- a/arch/arm64/kvm/vgic/vgic-init.c +++ b/arch/arm64/kvm/vgic/vgic-init.c @@ -84,15 +84,40 @@ int kvm_vgic_create(struct kvm *kvm, u32 type) !kvm_vgic_global_state.can_emulate_gicv2) re...
05b9405f2fa1848e984f231708fa1e5d385e4d27
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Resolve vLPI by host IRQ in vgic_v4_unset_forwarding()
Problem Details: The virtual mapping and "GSI" routing of a particular vLPI is subject to change in response to the guest / userspace. This can be pretty annoying to deal with when KVM needs to track the physical state that's managed for vLPI direct injection. Make vgic_v4_unset_forwarding() resilient by using the hos...
```diff diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 36cfcffb40d8..1de49b48e35e 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -2800,8 +2800,7 @@ void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *cons, if (irq_entry->type != KVM_IRQ_ROUTING_MSI) return; - kvm_vg...
667304740537e546dac676be9eb81cee41d2ebdd
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Mask out non-VA bits from TLBI VA* on VNCR invalidation
Problem Details: When handling a TLBI VA* instruction that potentially targets a VNCR page mapping, we fail to mask out the top bits that contain the ASID and TTL fields, hence potentially failing the VA check in the TLB code. An additional wrinkle is that we fail to sign extend the VA, again leading to failed VA chec...
```diff diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c index 291dbe38eb5c..4a53e4147fb0 100644 --- a/arch/arm64/kvm/nested.c +++ b/arch/arm64/kvm/nested.c @@ -918,6 +918,8 @@ static void invalidate_vncr_va(struct kvm *kvm, } } +#define tlbi_va_s1_to_va(v) (u64)sign_extend64((v) << 12, 48) + static...
94d889713d8b8e3bb78e19a1bbe76e36e34e8113
Analyze and fix the following issue in the Linux kernel code: arm64: sysreg: Drag linux/kconfig.h to work around vdso build issue
Problem Details: Broonie reports that fed55f49fad18 ("arm64: errata: Work around AmpereOne's erratum AC04_CPU_23") breaks one of the vdso selftests (vdso_test_chacha) as it indirectly drags asm/sysreg.h. It is rather unfortunate (and worrying) that userspace gets built with non-UAPI headers. In any case, paper over th...
```diff diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index cd853801a8f7..f1bb0d10c39a 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -12,6 +12,7 @@ #include <linux/bits.h> #include <linux/stringify.h> #include <linux/kasan-tags.h> +#include <li...
fe19655b72f3494ff7c4083c1217bef528d424a5
Analyze and fix the following issue in the Linux kernel code: drm/gem-vram: Do not set pin and unpin callbacks
Problem Details: Gem-vram helpers do not support PRIME dma-buf sharing. So nothing will ever call pin/unpin on its buffer objects. Do not set these callbacks in struct drm_gem_object_funcs. v2: - fix typo in commit description Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Dmitry Osipenko <dmitry...
```diff diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index 22b1fe9c03b8..c73480d31836 100644 --- a/drivers/gpu/drm/drm_gem_vram_helper.c +++ b/drivers/gpu/drm/drm_gem_vram_helper.c @@ -689,41 +689,6 @@ EXPORT_SYMBOL(drm_gem_vram_plane_helper_cleanup_fb); * PRIME helpers ...
2afe17794cfed5f80295b1b9facd66e6f65e5002
Analyze and fix the following issue in the Linux kernel code: md/md-bitmap: fix dm-raid max_write_behind setting
Problem Details: It's supposed to be COUNTER_MAX / 2, not COUNTER_MAX. Link: https://lore.kernel.org/linux-raid/20250524061320.370630-14-yukuai1@huaweicloud.com Signed-off-by: Yu Kuai <yukuai3@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de>
```diff diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index 37b08f26c62f..45dd3d9f01a8 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -789,7 +789,7 @@ static int md_bitmap_new_disk_sb(struct bitmap *bitmap) * is a good choice? We choose COUNTER_MAX / 2 arbitrarily. */ write_...
9f346f7d4ea73692b82f5102ca8698e4040469ea
Analyze and fix the following issue in the Linux kernel code: md/raid1,raid10: don't handle IO error for REQ_RAHEAD and REQ_NOWAIT
Problem Details: IO with REQ_RAHEAD or REQ_NOWAIT can fail early, even if the storage medium is fine, hence record badblocks or remove the disk from array does not make sense. This problem if found by lvm2 test lvcreate-large-raid, where dm-zero will fail read ahead IO directly. Fixes: e879a0d9cb08 ("md/raid1,raid10:...
```diff diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c index c7efd8aab675..b8b3a9069701 100644 --- a/drivers/md/raid1-10.c +++ b/drivers/md/raid1-10.c @@ -293,3 +293,13 @@ static inline bool raid1_should_read_first(struct mddev *mddev, return false; } + +/* + * bio with REQ_RAHEAD or REQ_NOWAIT can fai...
5402c4d4d2000a9baa30c1157c97152ec6383733
Analyze and fix the following issue in the Linux kernel code: exportfs: require ->fh_to_parent() to encode connectable file handles
Problem Details: When user requests a connectable file handle explicitly with the AT_HANDLE_CONNECTABLE flag, fail the request if filesystem (e.g. nfs) does not know how to decode a connected non-dir dentry. Fixes: c374196b2b9f ("fs: name_to_handle_at() support for "explicit connectable" file handles") Signed-off-by: ...
```diff diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index fc93f0abf513..25c4a5afbd44 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h @@ -314,6 +314,9 @@ static inline bool exportfs_can_decode_fh(const struct export_operations *nop) static inline bool exportfs_can_encode_fh(con...
a7c9add482c7b0e7e28433816fa9e8f7b890086e
Analyze and fix the following issue in the Linux kernel code: bcachefs: Include b->ob.nr in cached_btree_node_to_text()
Problem Details: We have a bug report that looks like we might be leaking open buckets - let's check if they got left attached to the cached btree node. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c index 4fa70634c90e..04db3e0ed82b 100644 --- a/fs/bcachefs/debug.c +++ b/fs/bcachefs/debug.c @@ -492,6 +492,8 @@ static void bch2_cached_btree_node_to_text(struct printbuf *out, struct bch_fs * prt_printf(out, "journal pin %px:\t%llu\n", &b->writes[1...
f54b2a80d0df06f8c13cbd102ca9dc2c6a578c5c
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix misaligned bucket check in journal space calculations
Problem Details: Fix an assertion pop in the tiering_misaligned test: rounding down to bucket size at the end of the journal space calculations leaves cur_entry_sectors == 0, which is incorrect with !cur_entry_err. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c index 70f36f6bc482..d0604218bf65 100644 --- a/fs/bcachefs/journal_reclaim.c +++ b/fs/bcachefs/journal_reclaim.c @@ -83,18 +83,20 @@ static struct journal_space journal_dev_space_available(struct journal *j, struct bch_dev *ca, e...
813825d24135aa3109cf7746ce11f1ec2ab901fd
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix incorrect multiple dev check in journal write path
Problem Details: It's uncomon to have multiple devices with journalling only on a subset, but can be specified with the 'data_allowed' option. We need to know if we're doing data/metadata writes to multiple devices, as that requires issuing flushes before the journal writes. Signed-off-by: Kent Overstreet <kent.overst...
```diff diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index 30122abf3e2c..527ce6f74b63 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -1635,6 +1635,16 @@ retry_alloc: done: BUG_ON(bkey_val_u64s(&w->key.k) > BCH_REPLICAS_MAX); +#if 0 + /* + * XXX: we need a way to alert ...
d6efd42a8450c67d283dbaacd127dcccca858f51
Analyze and fix the following issue in the Linux kernel code: bcachefs: Fix infinite loop in journal_entry_btree_keys_to_text()
Problem Details: Fix an infinite loop when bkey_i->k.u64s is 0. This only happens in userspace, where 'bcachefs list_journal' can print the entire contents of the journal, and non-dirty entries aren't validated. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
```diff diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index a322c3d7123a..30122abf3e2c 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -429,6 +429,10 @@ static void journal_entry_btree_keys_to_text(struct printbuf *out, struct bch_fs bool first = true; jset_entry_for_eac...
946026ba4293a14970b4b0b72f5f0cbb698ad77e
Analyze and fix the following issue in the Linux kernel code: rust: file: improve safety comments
Problem Details: Some of the safety comments in `LocalFile`'s methods incorrectly refer to the `File` type instead of `LocalFile`, so fix them to use the correct type. Also add missing Markdown code spans around lifetimes in the safety comments, i.e. change 'a to `'a`. Link: https://github.com/Rust-for-Linux/linux/is...
```diff diff --git a/rust/kernel/fs/file.rs b/rust/kernel/fs/file.rs index 138693bdeb3f..72d84fb0e266 100644 --- a/rust/kernel/fs/file.rs +++ b/rust/kernel/fs/file.rs @@ -225,7 +225,7 @@ pub struct LocalFile { } // SAFETY: The type invariants guarantee that `LocalFile` is always ref-counted. This implementation -//...
15ecd83dc06277385ad71dc7ea26911d9a79acaf
Analyze and fix the following issue in the Linux kernel code: rust: file: mark `LocalFile` as `repr(transparent)`
Problem Details: Unsafe code in `LocalFile`'s methods assumes that the type has the same layout as the inner `bindings::file`. This is not guaranteed by the default struct representation in Rust, but requires specifying the `transparent` representation. The `File` struct (which also wraps `bindings::file`) is already ...
```diff diff --git a/rust/kernel/fs/file.rs b/rust/kernel/fs/file.rs index 13a0e44cd1aa..138693bdeb3f 100644 --- a/rust/kernel/fs/file.rs +++ b/rust/kernel/fs/file.rs @@ -219,6 +219,7 @@ unsafe impl AlwaysRefCounted for File { /// must be on the same thread as this file. /// /// [`assume_no_fdget_pos`]: LocalFile:...
dd59137bfe70cf3646021b4721e430213b9c71bd
Analyze and fix the following issue in the Linux kernel code: fs/dax: Fix "don't skip locked entries when scanning entries"
Problem Details: Commit 6be3e21d25ca ("fs/dax: don't skip locked entries when scanning entries") introduced a new function, wait_entry_unlocked_exclusive(), which waits for the current entry to become unlocked without advancing the XArray iterator state. Waiting for the entry to become unlocked requires dropping the X...
```diff diff --git a/fs/dax.c b/fs/dax.c index 676303419e9e..f8d8b1afd232 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -257,7 +257,7 @@ static void *wait_entry_unlocked_exclusive(struct xa_state *xas, void *entry) wq = dax_entry_waitqueue(xas, entry, &ewait.key); prepare_to_wait_exclusive(wq, &ewait.wait, TASK_U...