id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
ebc4ed14a4dbf51307102bb7ffc82ed6c16a37c2
Analyze and fix the following issue in the Linux kernel code: cpufreq: mediatek: fix device leak on probe failure
Problem Details: Make sure to drop the reference to the cci device taken by of_find_device_by_node() on probe failure (e.g. probe deferral). Fixes: 0daa47325bae ("cpufreq: mediatek: Link CCI device to CPU") Cc: Jia-Wei Chang <jia-wei.chang@mediatek.com> Cc: Rex-BC Chen <rex-bc.chen@mediatek.com> Signed-off-by: Johan H...
```diff diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c index 00de1166188a..5d50a231f944 100644 --- a/drivers/cpufreq/mediatek-cpufreq.c +++ b/drivers/cpufreq/mediatek-cpufreq.c @@ -403,9 +403,11 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) } i...
4957089a23f41f31f8e7e22802a8ef9f5789c191
Analyze and fix the following issue in the Linux kernel code: locking/local_lock: Introduce local_lock_is_locked().
Problem Details: Introduce local_lock_is_locked() that returns true when given local_lock is locked by current cpu (in !PREEMPT_RT) or by current task (in PREEMPT_RT). The goal is to detect a deadlock by the caller. Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Alexei Starovoitov <ast@k...
```diff diff --git a/include/linux/local_lock.h b/include/linux/local_lock.h index 2ba846419524..0d91d060e3e9 100644 --- a/include/linux/local_lock.h +++ b/include/linux/local_lock.h @@ -66,6 +66,8 @@ */ #define local_trylock(lock) __local_trylock(this_cpu_ptr(lock)) +#define local_lock_is_locked(lock) __local_lo...
da577f1fcbdd0317b7c5089c19d5d61ec194f0e0
Analyze and fix the following issue in the Linux kernel code: tools/testing/vma: clean up stubs in vma_internal.h
Problem Details: We do not need to references arguments just to avoid compiler warnings, the warning in question does not arise here, so remove all of the instances of '(void)xxx' introduced purely to avoid this warning. As reported by WagYuli in the referenced mail, GCC 8.3 and before will have issues compiling this ...
```diff diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_internal.h index 3639aa8dd2b0..f8cf5b184d5b 100644 --- a/tools/testing/vma/vma_internal.h +++ b/tools/testing/vma/vma_internal.h @@ -676,9 +676,7 @@ static inline struct kmem_cache *__kmem_cache_create(const char *name, static inline void ...
3c1ea5c5019ff197aca7e886a3a240c38f6c6f0d
Analyze and fix the following issue in the Linux kernel code: slab: sheaf prefilling for guaranteed allocations
Problem Details: Add functions for efficient guaranteed allocations e.g. in a critical section that cannot sleep, when the exact number of allocations is not known beforehand, but an upper limit can be calculated. kmem_cache_prefill_sheaf() returns a sheaf containing at least given number of objects. kmem_cache_alloc...
```diff diff --git a/include/linux/slab.h b/include/linux/slab.h index 49acbcdc6696..680193356ac7 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -829,6 +829,22 @@ void *kmem_cache_alloc_node_noprof(struct kmem_cache *s, gfp_t flags, int node) __assume_slab_alignment __malloc; #define kmem_cach...
db74430a4218f282d16e58a38337275ad3f9f517
Analyze and fix the following issue in the Linux kernel code: Input: psxpad-spi - add a check for the return value of spi_setup()
Problem Details: The probe function in the psxpad-spi driver calls spi_setup() but fails to check its return value. If the SPI bus setup fails, the driver will still load successfully, resulting in potential error in later I/O operations. Add a check for the return value of spi_setup() and return an error on failure. ...
```diff diff --git a/drivers/input/joystick/psxpad-spi.c b/drivers/input/joystick/psxpad-spi.c index c47fc5f34bd0..f902a56d011f 100644 --- a/drivers/input/joystick/psxpad-spi.c +++ b/drivers/input/joystick/psxpad-spi.c @@ -344,7 +344,11 @@ static int psxpad_spi_probe(struct spi_device *spi) /* (PlayStation 1/2 joypad...
d3366a04770eea807f2826cbdb96934dd8c9bf79
Analyze and fix the following issue in the Linux kernel code: Input: uinput - zero-initialize uinput_ff_upload_compat to avoid info leak
Problem Details: Struct ff_effect_compat is embedded twice inside uinput_ff_upload_compat, contains internal padding. In particular, there is a hole after struct ff_replay to satisfy alignment requirements for the following union member. Without clearing the structure, copy_to_user() may leak stack data to userspace. ...
```diff diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 2c51ea9d01d7..13336a2fd49c 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -775,6 +775,7 @@ static int uinput_ff_upload_to_user(char __user *buffer, if (in_compat_syscall()) { struct uinput_ff_upload_...
fad988a2158d743da7971884b93482a73735b25e
Analyze and fix the following issue in the Linux kernel code: smb: server: fix IRD/ORD negotiation with the client
Problem Details: Already do real negotiation in smb_direct_handle_connect_request() where we see the requested initiator_depth and responder_resources from the client. We should detect legacy iwarp clients using MPA v1 with the custom IRD/ORD negotiation. We need to send the custom IRD/ORD in big endian, but we need ...
```diff diff --git a/fs/smb/server/transport_rdma.c b/fs/smb/server/transport_rdma.c index 74dfb6496095..e1f659d3b4cf 100644 --- a/fs/smb/server/transport_rdma.c +++ b/fs/smb/server/transport_rdma.c @@ -153,6 +153,10 @@ struct smb_direct_transport { struct work_struct disconnect_work; bool negotiation_requested...
ddfcb069c1dd1c909c34605e025e0aeae1b496e3
Analyze and fix the following issue in the Linux kernel code: smb: client: make use of smbdirect_socket.statistics
Problem Details: This will allow us to use common functions soon. Note this generates the following warnings from scripts/checkpatch.pl --quiet: WARNING: quoted string split across lines #59: FILE: fs/smb/client/cifs_debug.c:481: + seq_printf(m, "\nDebug count_get_receive_buffer: %llu " + ...
```diff diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c index 7cf3b045d3fb..55bf867be0e2 100644 --- a/fs/smb/client/cifs_debug.c +++ b/fs/smb/client/cifs_debug.c @@ -477,18 +477,18 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) sp->keepalive_interval_msec * 1000, sp->m...
ac31755c7a649786a9e11c6288513f5f4c1d30c9
Analyze and fix the following issue in the Linux kernel code: smb: client: fix smbdirect keep alive handling to match the documentation
Problem Details: We setup the first timer with the negotiate timeout and set KEEP_ALIVE_PENDING, so that the expired timer disconnects. On every incoming message we need to reset the timer to the keepalive interval (120s). On SMBDIRECT_FLAG_RESPONSE_REQUESTED we need to schedule a response instead of setting KEEP_ALI...
```diff diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index d53e39e91e10..5863dc7e021a 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -610,6 +610,14 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc) response->sge.length, DMA_FROM_DEVICE); + /* + * Rese...
afff34dc025b5f0476645f44b4d9cbc83dd54e71
Analyze and fix the following issue in the Linux kernel code: smb: client: adjust smbdirect related output of cifs_debug_data_proc_show()
Problem Details: For the reader it is not obvious that the counter values are displayed in hex as there's no leading '0x' before '%x'. So changed them to %u instead and added '0x' for non-counter values and also a string for the status. Note this generates some checkpatch warnings like this: WARNING: quoted string ...
```diff diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c index 2337cf795db3..265e063e95bd 100644 --- a/fs/smb/client/cifs_debug.c +++ b/fs/smb/client/cifs_debug.c @@ -456,55 +456,56 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) sc = &server->smbd_conn->socket; sp = &sc->...
ef71f1e046489c77a2f7d012edc762fba0a7aadc
Analyze and fix the following issue in the Linux kernel code: smb: client: fix sending the iwrap custom IRD/ORD negotiation messages
Problem Details: Do a real negotiation and check the servers initiator_depth and responder_resources. This should use big endian in order to be useful. I have captures of windows clients showing this. The fact that we used little endian up to now means that we sent very large numbers and the negotiation with the serv...
```diff diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index e0fce5033004..6480945c2459 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -179,6 +179,8 @@ static int smbd_conn_upcall( struct smbd_connection *info = id->context; struct smbdirect_socket *sc = &info->socket;...
1e2f487584ed426a744b86e04f96662488c7aa0e
Analyze and fix the following issue in the Linux kernel code: smb: smbdirect: introduce smbdirect_socket_status_string()
Problem Details: This will be used for more useful debug messages. Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: Long Li <longli@microsoft.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Stefan Metzmacher <...
```diff diff --git a/fs/smb/common/smbdirect/smbdirect_socket.h b/fs/smb/common/smbdirect/smbdirect_socket.h index 3c4a8d627aa3..8484c6f09317 100644 --- a/fs/smb/common/smbdirect/smbdirect_socket.h +++ b/fs/smb/common/smbdirect/smbdirect_socket.h @@ -16,6 +16,29 @@ enum smbdirect_socket_status { SMBDIRECT_SOCKET_DEST...
d6ddd9beb1a5c32acb9b80f5c2cd8b17f41371d1
Analyze and fix the following issue in the Linux kernel code: i3c: fix big-endian FIFO transfers
Problem Details: Short MMIO transfers that are not a multiple of four bytes in size need a special case for the final bytes, however the existing implementation is not endian-safe and introduces an incorrect byteswap on big-endian kernels. This usually does not cause problems because most systems are little-endian and...
```diff diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h index 0d857cc68cc5..79ceaa5f5afd 100644 --- a/drivers/i3c/internals.h +++ b/drivers/i3c/internals.h @@ -38,7 +38,11 @@ static inline void i3c_writel_fifo(void __iomem *addr, const void *buf, u32 tmp = 0; memcpy(&tmp, buf + (nbytes & ~3), nby...
8a1f3fd1a89cd1d4acccb0181346ad212a275a69
Analyze and fix the following issue in the Linux kernel code: i3c: master: adi: fix number of bytes written to fifo
Problem Details: adi_i3c_master_wr_to_tx_fifo computes the maximum number of bytes that can be sent to the fifo but never makes use of it, actually limit the number of bytes sent. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202509190505.fKGvEJRa-lkp@intel.com/ Reviewed-...
```diff diff --git a/drivers/i3c/master/adi-i3c-master.c b/drivers/i3c/master/adi-i3c-master.c index 18597ba1f1c3..82ac0b3d057a 100644 --- a/drivers/i3c/master/adi-i3c-master.c +++ b/drivers/i3c/master/adi-i3c-master.c @@ -135,7 +135,7 @@ static void adi_i3c_master_wr_to_tx_fifo(struct adi_i3c_master *master, n = r...
edf7e9040fc52c922db947f9c6c36f07377c52ea
Analyze and fix the following issue in the Linux kernel code: f2fs: fix UAF issue in f2fs_merge_page_bio()
Problem Details: As JY reported in bugzilla [1], Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 pc : [0xffffffe51d249484] f2fs_is_cp_guaranteed+0x70/0x98 lr : [0xffffffe51d24adbc] f2fs_merge_page_bio+0x520/0x6d4 CPU: 3 UID: 0 PID: 6790 Comm: kworker/u16:3 Tainted: P B W OE ...
```diff diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index ed90b2c18d4c..ef38e62cda8f 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -913,7 +913,7 @@ alloc_new: if (fio->io_wbc) wbc_account_cgroup_owner(fio->io_wbc, folio, folio_size(folio)); - inc_page_count(fio->sbi, WB_DATA_TYPE(data_folio, false)); + in...
1367da7eb875d01102d2ed18654b24d261ff5393
Analyze and fix the following issue in the Linux kernel code: mm: swap: check for stable address space before operating on the VMA
Problem Details: It is possible to hit a zero entry while traversing the vmas in unuse_mm() called from swapoff path and accessing it causes the OOPS: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000446--> Loading the memory from offset 0x40 on the XA_ZERO_ENTRY as address. Mem abort i...
```diff diff --git a/mm/swapfile.c b/mm/swapfile.c index 890b410d77b6..10760240a3a2 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2389,6 +2389,8 @@ static int unuse_mm(struct mm_struct *mm, unsigned int type) VMA_ITERATOR(vmi, mm, 0); mmap_read_lock(mm); + if (check_stable_address_space(mm)) + goto unlock; ...
dd83609b88986f4add37c0871c3434310652ebd5
Analyze and fix the following issue in the Linux kernel code: hugetlbfs: skip VMAs without shareable locks in hugetlb_vmdelete_list
Problem Details: hugetlb_vmdelete_list() uses trylock to acquire VMA locks during truncate operations. As per the original design in commit 40549ba8f8e0 ("hugetlb: use new vma_lock for pmd sharing synchronization"), if the trylock fails or the VMA has no lock, it should skip that VMA. Any remaining mapped pages are h...
```diff diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 3cfdf4091001..94b4d854429e 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -478,6 +478,14 @@ hugetlb_vmdelete_list(struct rb_root_cached *root, pgoff_t start, pgoff_t end, if (!hugetlb_vma_trylock_write(vma)) continue; + /*...
fb552b2425cf8f16c9c72229a972d1744b24d855
Analyze and fix the following issue in the Linux kernel code: alloc_tag: fix boot failure due to NULL pointer dereference
Problem Details: There is a boot failure when both CONFIG_DEBUG_KMEMLEAK and CONFIG_MEM_ALLOC_PROFILING are enabled. BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:__alloc_tagging_slab_alloc_hook+0x181/0x2f0 Call Trace: kmem_cache_alloc_noprof+0x1c8/0x5c0 __alloc_object+0x2f/0x290 __creat...
```diff diff --git a/mm/slub.c b/mm/slub.c index 9c04f29ee8de..9d73cca9f1de 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2109,15 +2109,6 @@ prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p) { struct slab *slab; - if (!p) - return NULL; - - if (s->flags & (SLAB_NO_OBJ_EXT | SLAB_NOLEAKTRACE)) - ...
989c2f55ca4839121cbf23b5802f8513dbd54e1e
Analyze and fix the following issue in the Linux kernel code: mm: silence data-race in update_hiwater_rss
Problem Details: KCSAN reports a data race on mm_cluster.hiwater_rss, which can be accessed concurrently from various paths like page migration and memory unmapping without synchronization. Since hiwater_rss is a statistical field for accounting purposes, this data race is benign. Annotate both the read and write acc...
```diff diff --git a/include/linux/mm.h b/include/linux/mm.h index fcb1e72eea40..06978b4dbeb8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2742,7 +2742,7 @@ static inline void update_hiwater_rss(struct mm_struct *mm) unsigned long _rss = get_mm_rss(mm); if (data_race(mm->hiwater_rss) < _rss) - (m...
b4c9ffb54b3204dc8b4013c6410c897cff8cdd70
Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: remove definition of struct khugepaged_mm_slot
Problem Details: Current code is not correct to get struct khugepaged_mm_slot by mm_slot_entry() without checking mm_slot is !NULL. There is no problem reported since slot is the first element of struct khugepaged_mm_slot. While struct khugepaged_mm_slot is just a wrapper of struct mm_slot, there is no need to define...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 9ed1af2b5c38..52786ffef80a 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -103,14 +103,6 @@ struct collapse_control { nodemask_t alloc_nmask; }; -/** - * struct khugepaged_mm_slot - khugepaged information per mm that is being scanned - * @slot: ha...
08498be43ee676d8a5eefb22278266322578a3e0
Analyze and fix the following issue in the Linux kernel code: mm/ksm: get mm_slot by mm_slot_entry() when slot is !NULL
Problem Details: Patch series "mm_slot: fix the usage of mm_slot_entry", v2. When using mm_slot in ksm, there is code like: slot = mm_slot_lookup(mm_slots_hash, mm); mm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); if (mm_slot && ..) { } The mm_slot_entry() won't return a valid value if s...
```diff diff --git a/mm/ksm.c b/mm/ksm.c index 2dbe92e3dd52..04019a15b25d 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -2936,15 +2936,17 @@ void __ksm_exit(struct mm_struct *mm) spin_lock(&ksm_mmlist_lock); slot = mm_slot_lookup(mm_slots_hash, mm); - mm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); - if (mm_sl...
4d6fc29f36341d7795db1d1819b4c15fe9be7b23
Analyze and fix the following issue in the Linux kernel code: mm/ksm: fix incorrect KSM counter handling in mm_struct during fork
Problem Details: Patch series "mm/ksm: Fix incorrect accounting of KSM counters during fork", v3. The first patch in this series fixes the incorrect accounting of KSM counters such as ksm_merging_pages, ksm_rmap_items, and the global ksm_zero_pages during fork. The following patch add a selftest to verify the ksm_mer...
```diff diff --git a/include/linux/ksm.h b/include/linux/ksm.h index 22e67ca7cba3..067538fc4d58 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h @@ -56,8 +56,14 @@ static inline long mm_ksm_zero_pages(struct mm_struct *mm) static inline void ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm) { /* Add...
0efdedfa537eb534c251a5b4794caaf72cc55869
Analyze and fix the following issue in the Linux kernel code: drivers/base/node: fix double free in register_one_node()
Problem Details: When device_register() fails in register_node(), it calls put_device(&node->dev). This triggers node_device_release(), which calls kfree(to_node(dev)), thereby freeing the entire node structure. As a result, when register_node() returns an error, the node memory has already been freed. Calling kfree...
```diff diff --git a/drivers/base/node.c b/drivers/base/node.c index 45d512939c40..67b01d579737 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -887,7 +887,6 @@ int register_one_node(int nid) error = register_node(node_devices[nid], nid); if (error) { node_devices[nid] = NULL; - kfree(node); re...
51032f26cff7a5ab458d549d88b905ca5bf7a7f5
Analyze and fix the following issue in the Linux kernel code: mm/memory_hotplug: fix typo 'esecially' -> 'especially'
Problem Details: Link: https://lkml.kernel.org/r/20250918174528.90879-1-manish1588@gmail.com Signed-off-by: Manish Kumar <manish1588@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
```diff diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 883b8e4d51ba..e9f14de4a9c9 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -955,7 +955,7 @@ static struct zone *default_kernel_zone_for_pfn(int nid, unsigned long start_pfn * effectively unused by the kernel, yet they account to "pr...
a2880202767daded2898f62265f6cdf4cfb53bc4
Analyze and fix the following issue in the Linux kernel code: mm/rmap: fix a mlock race condition in folio_referenced_one()
Problem Details: The mlock_vma_folio() function requires the page table lock to be held in order to safely mlock the folio. However, folio_referenced_one() mlocks a large folios outside of the page_vma_mapped_walk() loop where the page table lock has already been dropped. Rework the mlock logic to use the same code p...
```diff diff --git a/mm/rmap.c b/mm/rmap.c index 34333ae3bd80..d174168b8f93 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -850,34 +850,34 @@ static bool folio_referenced_one(struct folio *folio, { struct folio_referenced_arg *pra = arg; DEFINE_FOLIO_VMA_WALK(pvmw, folio, vma, address, 0); - int referenced = 0; - unsig...
2db579838296239545554443234fafb8f485cca0
Analyze and fix the following issue in the Linux kernel code: mm/page_vma_mapped: track if the page is mapped across page table boundary
Problem Details: Patch series "mm: Improve mlock tracking for large folios", v3. The patchset includes several fixes and improvements related to mlock tracking of large folios. The main objective is to reduce the undercount of Mlocked memory in /proc/meminfo and improve the accuracy of the statistics. Patches 1-2: ...
```diff diff --git a/include/linux/rmap.h b/include/linux/rmap.h index e8aff6d2deda..daa92a58585d 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -922,6 +922,11 @@ struct page *make_device_exclusive(struct mm_struct *mm, unsigned long addr, /* Look for migration entries rather than present PTEs */ #de...
89e688edcffee7858aa394fd107df98bfd7647a4
Analyze and fix the following issue in the Linux kernel code: mm/compaction: fix low_pfn advance on isolating hugetlb
Problem Details: Commit 56ae0bb349b4 ("mm: compaction: convert to use a folio in isolate_migratepages_block()") converts api from page to folio. But the low_pfn advance for hugetlb page seems wrong when low_pfn doesn't point to head page. Originally, if page is a hugetlb tail page, compound_nr() return 1, which means...
```diff diff --git a/mm/compaction.c b/mm/compaction.c index bf021b31c7ec..1e8f8eca318c 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -989,7 +989,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, * Hugepage was successfully isolated and placed * on the cc->migratepag...
9f1c14c1de1bdde395f6cc893efa4f80a2ae3b2b
Analyze and fix the following issue in the Linux kernel code: Squashfs: reject negative file sizes in squashfs_read_inode()
Problem Details: Syskaller reports a "WARNING in ovl_copy_up_file" in overlayfs. This warning is ultimately caused because the underlying Squashfs file system returns a file with a negative file size. This commit checks for a negative file size and returns EINVAL. [phillip@squashfs.org.uk: only need to check 64 bit ...
```diff diff --git a/fs/squashfs/inode.c b/fs/squashfs/inode.c index ddc65d006063..cceae3b78698 100644 --- a/fs/squashfs/inode.c +++ b/fs/squashfs/inode.c @@ -197,6 +197,10 @@ int squashfs_read_inode(struct inode *inode, long long ino) goto failed_read; inode->i_size = le64_to_cpu(sqsh_ino->file_size); + if (...
94b3f02fb33f56c896d855ccbac270766d1aa48b
Analyze and fix the following issue in the Linux kernel code: kallsyms: use kmalloc_array() instead of kmalloc()
Problem Details: Replace kmalloc(sizeof(*stat) * 2, GFP_KERNEL) with kmalloc_array(2, sizeof(*stat), GFP_KERNEL) to prevent potential overflow, as recommended in Documentation/process/deprecated.rst. Link: https://lkml.kernel.org/r/20250926075053.25615-1-chandna.linuxkernel@gmail.com Signed-off-by: Sahil Chandna <chan...
```diff diff --git a/kernel/kallsyms_selftest.c b/kernel/kallsyms_selftest.c index cf4af5728307..2b082a7e24a2 100644 --- a/kernel/kallsyms_selftest.c +++ b/kernel/kallsyms_selftest.c @@ -264,7 +264,7 @@ static int test_kallsyms_basic_function(void) char namebuf[KSYM_NAME_LEN]; struct test_stat *stat, *stat2; - st...
1260cbcffa608219fc9188a6cbe9c45a300ef8b5
Analyze and fix the following issue in the Linux kernel code: lib/genalloc: fix device leak in of_gen_pool_get()
Problem Details: Make sure to drop the reference taken when looking up the genpool platform device in of_gen_pool_get() before returning the pool. Note that holding a reference to a device does typically not prevent its devres managed resources from being released so there is no point in keeping the reference. Link: ...
```diff diff --git a/lib/genalloc.c b/lib/genalloc.c index 4fa5635bf81b..841f29783833 100644 --- a/lib/genalloc.c +++ b/lib/genalloc.c @@ -899,8 +899,11 @@ struct gen_pool *of_gen_pool_get(struct device_node *np, if (!name) name = of_node_full_name(np_pool); } - if (pdev) + if (pdev) { pool = gen_pool_get(&...
8f45f089337d924db24397f55697cda0e6960516
Analyze and fix the following issue in the Linux kernel code: ocfs2: fix double free in user_cluster_connect()
Problem Details: user_cluster_disconnect() frees "conn->cc_private" which is "lc" but then the error handling frees "lc" a second time. Set "lc" to NULL on this path to avoid a double free. Link: https://lkml.kernel.org/r/aNKDz_7JF7aycZ0k@stanley.mountain Fixes: c994c2ebdbbc ("ocfs2: use the new DLM operation callbac...
```diff diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 0f045e45fa0c..439742cec3c2 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -1011,6 +1011,7 @@ static int user_cluster_connect(struct ocfs2_cluster_connection *conn) printk(KERN_ERR "ocfs2: Could not determine" " locking...
20a8e0454d833d80d0c0cae304841a50a2a126bd
Analyze and fix the following issue in the Linux kernel code: cramfs: fix incorrect physical page address calculation
Problem Details: Commit 21aa65bf82a7 ("mm: remove callers of pfn_t functionality") incorrectly replaced the pfn with the physical address when calling vmf_insert_mixed(). Instead the phys_to_pfn_t() call should have been replaced with PHYS_PFN(). Found by inspection after a similar issue was noted in fuse virtio_fs. ...
```diff diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index b002e9b734f9..56c8005b24a3 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -412,7 +412,7 @@ static int cramfs_physmem_mmap(struct file *file, struct vm_area_struct *vma) vm_fault_t vmf; unsigned long off = i * PAGE_SIZE; vmf = vmf_in...
634cdfd6b394cf4a5bfaeacf3b325998c752df45
Analyze and fix the following issue in the Linux kernel code: kernel: prevent prctl(PR_SET_PDEATHSIG) from racing with parent process exit
Problem Details: If a process calls prctl(PR_SET_PDEATHSIG) at the same time that the parent process exits, the child will write to me->pdeath_sig at the same time the parent is reading it. Since there is no synchronization, this is a data race. Worse, it is possible that a subsequent call to getppid() can continue t...
```diff diff --git a/kernel/sys.c b/kernel/sys.c index 36d66ff41611..bd25f39a6b57 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -2488,7 +2488,17 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, error = -EINVAL; break; } + /* + * Ensure that either: + * + * 1. Subseque...
74058c0a9fc8b2b4d5f4a0ef7ee2cfa66a9e49cf
Analyze and fix the following issue in the Linux kernel code: Squashfs: fix uninit-value in squashfs_get_parent
Problem Details: Syzkaller reports a "KMSAN: uninit-value in squashfs_get_parent" bug. This is caused by open_by_handle_at() being called with a file handle containing an invalid parent inode number. In particular the inode number is that of a symbolic link, rather than a directory. Squashfs_get_parent() gets called...
```diff diff --git a/fs/squashfs/inode.c b/fs/squashfs/inode.c index dee8fa016930..bb0529b09adc 100644 --- a/fs/squashfs/inode.c +++ b/fs/squashfs/inode.c @@ -169,6 +169,7 @@ int squashfs_read_inode(struct inode *inode, long long ino) squashfs_i(inode)->start = le32_to_cpu(sqsh_ino->start_block); squashfs_i(inode...
f322a97aeb2a05b6b1ee17629145eb02e1a4c6a0
Analyze and fix the following issue in the Linux kernel code: kho: only fill kimage if KHO is finalized
Problem Details: kho_fill_kimage() only checks for KHO being enabled before filling in the FDT to the image. KHO being enabled does not mean that the kernel has data to hand over. That happens when KHO is finalized. When a kexec is done with KHO enabled but not finalized, the FDT page is allocated but not initialize...
```diff diff --git a/kernel/kexec_handover.c b/kernel/kexec_handover.c index 49a39aee6a8e..e238ec6b470b 100644 --- a/kernel/kexec_handover.c +++ b/kernel/kexec_handover.c @@ -1253,7 +1253,7 @@ int kho_fill_kimage(struct kimage *image) int err = 0; struct kexec_buf scratch; - if (!kho_enable) + if (!kho_out.finali...
2ea77fca84f07849aa995271271340d262d0c2e9
Analyze and fix the following issue in the Linux kernel code: modpost: Initialize builtin_modname to stop SIGSEGVs
Problem Details: Segmentation fault ./scripts/mod/modpost -o vmlinux.symvers vmlinux.o stops the kernel build. It comes when write_vmlinux_export_c_file() tries to buf_printf alias->builtin_modname. malloc'ed memory is not necessarily zeroed. NULL new->builtin_modname before adding to aliases. Fixes: 5ab23c7923a1 (...
```diff diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 7da9735e7ab3..b3333560b95e 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -94,6 +94,7 @@ module_alias_printf(struct module *mod, bool append_wildcard, } } + new->builtin_modname = NULL; list_add_tail(&new->n...
4ef77dd584cfd915526328f516fec59e3a54d66e
Analyze and fix the following issue in the Linux kernel code: libbpf: Replace AF_ALG with open coded SHA-256
Problem Details: Reimplement libbpf_sha256() using some basic SHA-256 C code. This eliminates the newly-added dependency on AF_ALG, which is a problematic UAPI that is not supported by all kernels. Make libbpf_sha256() return void, since it can no longer fail. This simplifies some callers. Also drop the unnecessary...
```diff diff --git a/tools/lib/bpf/gen_loader.c b/tools/lib/bpf/gen_loader.c index 376eef292d3a..6945dd99a846 100644 --- a/tools/lib/bpf/gen_loader.c +++ b/tools/lib/bpf/gen_loader.c @@ -371,7 +371,7 @@ static void emit_sys_close_blob(struct bpf_gen *gen, int blob_off) __emit_sys_close(gen); } -static int compute_...
399dbcadc01ebf0035f325eaa8c264f8b5cd0a14
Analyze and fix the following issue in the Linux kernel code: ACPI: battery: Add synchronization between interface updates
Problem Details: There is no synchronization between different code paths in the ACPI battery driver that update its sysfs interface or its power supply class device interface. In some cases this results to functional failures due to race conditions. One example of this is when two ACPI notifications: - ACPI_BATTE...
```diff diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 6905b56bf3e4..67b76492c839 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -92,7 +92,7 @@ enum { struct acpi_battery { struct mutex lock; - struct mutex sysfs_lock; + struct mutex update_lock; struct power_supply *bat;...
15cf39221e89ad413c3cc2cb8f15a2487db2ba2f
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add stress test for rqspinlock in NMI
Problem Details: Introduce a kernel module that will exercise lock acquisition in the NMI path, and bias toward creating contention such that NMI waiters end up being non-head waiters. Prior to the rqspinlock fix made in the commit 0d80e7f951be ("rqspinlock: Choose trylock fallback for NMI waiters"), it was possible fo...
```diff diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 0b6ee902bce5..f00587d4ede6 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -120,7 +120,7 @@ TEST_PROGS_EXTENDED := \ test_bpftool.py TEST_KMODS := bpf_testmod.ko bp...
ffd586126a82e497e16336a1006430584d0570c4
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: improve module param quirk_flags
Problem Details: It accepts strings like `VID:PID:quirk_flag_name1|quirk_flag_name2;...` from now on, so that we can use it to debug USB audio devices more intuitive and flexible. The compatibility of previous form is kept. Co-developed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Cryolitia PukNgae <cryolitia@union...
```diff diff --git a/sound/usb/card.c b/sound/usb/card.c index 0265206a8e8c..66c6c92fa9e8 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -73,7 +73,7 @@ static bool lowlatency = true; static char *quirk_alias[SNDRV_CARDS]; static char *delayed_register[SNDRV_CARDS]; static bool implicit_fb[SNDRV_CARDS]; -sta...
ce0172627390c3c3885c60093904c79fbe19c543
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: add two-way convert between name and bit for QUIRK_FLAG_*
Problem Details: Define quirk flags enum and its name. Add helper for converting between quirk flags' name and bit. - snd_usb_quirk_flag_find_name() - snd_usb_quirk_flags_from_name() Add helper for printing debug: log snd_usb_apply_flag_dbg() Co-developed-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Cryolitia...
```diff diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 7e8609ac6822..6263163c5c7b 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -2443,6 +2443,84 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { {} /* terminator */ }; +#define QUIRK_STRING_ENTRY(x) \ + [QUIRK_TYPE...
9f2c0ac1423d5f267e7f1d1940780fc764b0fee3
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: fix race condition to UAF in snd_usbmidi_free
Problem Details: The previous commit 0718a78f6a9f ("ALSA: usb-audio: Kill timer properly at removal") patched a UAF issue caused by the error timer. However, because the error timer kill added in this patch occurs after the endpoint delete, a race condition to UAF still occurs, albeit rarely. Additionally, since kill...
```diff diff --git a/sound/usb/midi.c b/sound/usb/midi.c index acb3bf92857c..97e7e7662b12 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -1522,15 +1522,14 @@ static void snd_usbmidi_free(struct snd_usb_midi *umidi) { int i; + if (!umidi->disconnected) + snd_usbmidi_disconnect(&umidi->list); + for (i = ...
fa7d16734f9606c396681648618dd76a5af861e6
Analyze and fix the following issue in the Linux kernel code: ALSA: compress: document 'chan_map' member in snd_dec_opus
Problem Details: When building kernel docs, the following warning appeared: WARNING: ./include/uapi/sound/compress_params.h:364 struct member 'chan_map' not described in 'snd_dec_opus' The inline struct 'snd_dec_opus_ch_map' inside 'snd_dec_opus' was not properly documented. This patch documents the 'chan_map' me...
```diff diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h index faf4fa911f7f..d7db6b4e1166 100644 --- a/include/uapi/sound/compress_params.h +++ b/include/uapi/sound/compress_params.h @@ -336,16 +336,14 @@ struct snd_dec_ape { * @mapping_family: Order and meaning of output chann...
612b1dfeb414dfa780a6316014ceddf9a74ff5c0
Analyze and fix the following issue in the Linux kernel code: hwrng: ks-sa - fix division by zero in ks_sa_rng_init
Problem Details: Fix division by zero in ks_sa_rng_init caused by missing clock pointer initialization. The clk_get_rate() call is performed on an uninitialized clk pointer, resulting in division by zero when calculating delay values. Add clock initialization code before using the clock. Fixes: 6d01d8511dce ("hwrng: ...
```diff diff --git a/drivers/char/hw_random/ks-sa-rng.c b/drivers/char/hw_random/ks-sa-rng.c index d8fd8a354482..9e408144a10c 100644 --- a/drivers/char/hw_random/ks-sa-rng.c +++ b/drivers/char/hw_random/ks-sa-rng.c @@ -231,6 +231,10 @@ static int ks_sa_rng_probe(struct platform_device *pdev) if (IS_ERR(ks_sa_rng->reg...
5851afffe2ab323a53e184ba5a35fddf268f096b
Analyze and fix the following issue in the Linux kernel code: KEYS: X.509: Fix Basic Constraints CA flag parsing
Problem Details: Fix the X.509 Basic Constraints CA flag parsing to correctly handle the ASN.1 DER encoded structure. The parser was incorrectly treating the length field as the boolean value. Per RFC 5280 section 4.1, X.509 certificates must use ASN.1 DER encoding. According to ITU-T X.690, a DER-encoded BOOLEAN is r...
```diff diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c index 2ffe4ae90bea..8df3fa60a44f 100644 --- a/crypto/asymmetric_keys/x509_cert_parser.c +++ b/crypto/asymmetric_keys/x509_cert_parser.c @@ -610,11 +610,14 @@ int x509_process_extension(void *context, size_t hdrlen...
40d4c761200b796a44bf2c7675ae09c87b17d4af
Analyze and fix the following issue in the Linux kernel code: firewire: core: fix undefined reference error in ARM EABI
Problem Details: For ARM EABI, GCC generates a reference to __aeabi_uldivmod when compiling a division of 64-bit integer with 32-bit integer. This function is not available in Linux kernel. In such cases, helper macros are defined in include/linux/math64.h. This commit replaces the division with div_u64(). Fixes: 8ec...
```diff diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h index 2dd715a580ac..e67395ce26b5 100644 --- a/drivers/firewire/core.h +++ b/drivers/firewire/core.h @@ -30,7 +30,7 @@ struct fw_packet; // This is the arbitrary value we use to indicate a mismatched gap count. #define GAP_COUNT_MISMATCHED 0 -#de...
cdc59a62bccadf104159547690a06d2b9aa88085
Analyze and fix the following issue in the Linux kernel code: kernel/acct.c: saner struct file treatment
Problem Details: Instead of switching ->f_path.mnt of an opened file to internal clone, get a struct path with ->mnt set to internal clone of that ->f_path.mnt, then dentry_open() that to get the file with right ->f_path.mnt from the very beginning. The only subtle part here is that on failure exits we need to close ...
```diff diff --git a/kernel/acct.c b/kernel/acct.c index 6520baa13669..61630110e29d 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -44,19 +44,14 @@ * a struct file opened for write. Fixed. 2/6/2000, AV. */ -#include <linux/mm.h> #include <linux/slab.h> #include <linux/acct.h> #include <linux/capability.h> -...
095530512152e6811278de9c30f170f0ac9705eb
Analyze and fix the following issue in the Linux kernel code: i2c: rtl9300: Drop unsupported I2C_FUNC_SMBUS_I2C_BLOCK
Problem Details: While applying the patch for commit ede965fd555a ("i2c: rtl9300: remove broken SMBus Quick operation support"), a conflict was incorrectly solved by adding the I2C_FUNC_SMBUS_I2C_BLOCK feature flag. But the code to handle I2C_SMBUS_I2C_BLOCK_DATA requests will be added by a separate commit. Fixes: ede...
```diff diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c index 9e1f71fed0fe..af991b28e4f8 100644 --- a/drivers/i2c/busses/i2c-rtl9300.c +++ b/drivers/i2c/busses/i2c-rtl9300.c @@ -307,8 +307,7 @@ out_unlock: static u32 rtl9300_i2c_func(struct i2c_adapter *a) { return I2C_FUNC_SMBUS_BY...
dc67521c20b701b5237ff486ae078829dc1f8fea
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/renesas/rzg3e: Fix add thermal driver for the Renesas RZ/G3E SoC
Problem Details: When applied the change commit 19d3a401a617, a conflict appeared resulting into a manual fix. However the new file rzg3e_thermal.c was not added but stayed locally in source tree and miss to be merged with the entire change. Fix this by adding the file back. Fixes: 19d3a401a617 ("Add thermal driver f...
```diff diff --git a/drivers/thermal/renesas/rzg3e_thermal.c b/drivers/thermal/renesas/rzg3e_thermal.c new file mode 100644 index 000000000000..e66d73ca6752 --- /dev/null +++ b/drivers/thermal/renesas/rzg3e_thermal.c @@ -0,0 +1,547 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Renesas RZ/G3E TSU Temperature Sensor Un...
eed0e3d305530066b4fc5370107cff8ef1a0d229
Analyze and fix the following issue in the Linux kernel code: KEYS: trusted_tpm1: Compare HMAC values in constant time
Problem Details: To prevent timing attacks, HMAC value comparison needs to be constant time. Replace the memcmp() with the correct function, crypto_memneq(). [For the Fixes commit I used the commit that introduced the memcmp(). It predates the introduction of crypto_memneq(), but it was still a bug at the time even t...
```diff diff --git a/security/keys/trusted-keys/trusted_tpm1.c b/security/keys/trusted-keys/trusted_tpm1.c index 89c9798d1800..e73f2c6c817a 100644 --- a/security/keys/trusted-keys/trusted_tpm1.c +++ b/security/keys/trusted-keys/trusted_tpm1.c @@ -7,6 +7,7 @@ */ #include <crypto/hash_info.h> +#include <crypto/utils...
f12b69d8f22824a07f17c1399c99757072de73e0
Analyze and fix the following issue in the Linux kernel code: batman-adv: Release references to inactive interfaces
Problem Details: Trying to dump the originators or the neighbors via netlink for a meshif with an inactive primary interface is not allowed. The dump functions were checking this correctly but they didn't handle non-existing primary interfaces and existing _inactive_ interfaces differently. (Primary) batadv_hard_iface...
```diff diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index a464ff96b929..ed89d7fd1e7f 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -764,11 +764,16 @@ int batadv_hardif_neigh_dump(struct sk_buff *msg, struct netlink_callback *cb) bat_priv = netdev_priv(mesh_if...
be812ace0378a9db86344ad637c5ed2a5d11f216
Analyze and fix the following issue in the Linux kernel code: Bluetooth: Avoid a couple dozen -Wflex-array-member-not-at-end warnings
Problem Details: -Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Use the __struct_group() helper to fix 31 instances of the following type of warnings: 30 net/bluetooth/mgmt_config.c:16:33: warning: structure containing a flexible array member is not at the en...
```diff diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 3575cd16049a..74edea06985b 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h @@ -53,10 +53,15 @@ struct mgmt_hdr { } __packed; struct mgmt_tlv { - __le16 type; - __u8 length; + /* New members MUST be ...
03ddb4ac251463ec5b7b069395d9ab89163dd56c
Analyze and fix the following issue in the Linux kernel code: Bluetooth: hci_sync: Fix using random address for BIG/PA advertisements
Problem Details: When creating an advertisement for BIG the address shall not be non-resolvable since in case of acting as BASS/Broadcast Assistant the address must be the same as the connection in order to use the PAST method and even when PAST/BASS are not in the picture a Periodic Advertisement can still be synchron...
```diff diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 7a7d49890858..eefdb6134ca5 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -1325,7 +1325,7 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance) { struct hci_cp_le_set_ext_adv_params cp; struc...
5bf863f4c5da055c1eb08887ae4f26d99dbc4aac
Analyze and fix the following issue in the Linux kernel code: Bluetooth: ISO: don't leak skb in ISO_CONT RX
Problem Details: For ISO_CONT RX, the data from skb is copied to conn->rx_skb, but the skb is leaked. Free skb after copying its data. Fixes: ccf74f2390d6 ("Bluetooth: Add BTPROTO_ISO socket type") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
```diff diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index ad5c8118a6e3..9b263d061e05 100644 --- a/net/bluetooth/iso.c +++ b/net/bluetooth/iso.c @@ -2427,7 +2427,7 @@ void iso_recv(struct hci_conn *hcon, struct sk_buff *skb, u16 flags) skb_copy_from_linear_data(skb, skb_put(conn->rx_skb, skb->len), ...
6ba85da5804efffe15c89b03742ea868f20b4172
Analyze and fix the following issue in the Linux kernel code: Bluetooth: ISO: free rx_skb if not consumed
Problem Details: If iso_conn is freed when RX is incomplete, free any leftover skb piece. Fixes: dc26097bdb86 ("Bluetooth: ISO: Use kref to track lifetime of iso_conn") Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
```diff diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index d24c7a1ace92..ad5c8118a6e3 100644 --- a/net/bluetooth/iso.c +++ b/net/bluetooth/iso.c @@ -111,6 +111,8 @@ static void iso_conn_free(struct kref *ref) /* Ensure no more work items will run since hci_conn has been dropped */ disable_delayed_work_syn...
9950f095d6c875dbe0c9ebfcf972ec88fdf26fc8
Analyze and fix the following issue in the Linux kernel code: Bluetooth: ISO: Fix possible UAF on iso_conn_free
Problem Details: This attempt to fix similar issue to sco_conn_free where if the conn->sk is not set to NULL may lead to UAF on iso_conn_free. Fixes: ccf74f2390d6 ("Bluetooth: Add BTPROTO_ISO socket type") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
```diff diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c index 5c68c0ea7d97..d24c7a1ace92 100644 --- a/net/bluetooth/iso.c +++ b/net/bluetooth/iso.c @@ -761,6 +761,13 @@ static void iso_sock_kill(struct sock *sk) BT_DBG("sk %p state %d", sk, sk->sk_state); + /* Sock is dead, so set conn->sk to NULL to avoid...
ecb9a843be4d6fd710d7026e359f21015a062572
Analyze and fix the following issue in the Linux kernel code: Bluetooth: SCO: Fix UAF on sco_conn_free
Problem Details: BUG: KASAN: slab-use-after-free in sco_conn_free net/bluetooth/sco.c:87 [inline] BUG: KASAN: slab-use-after-free in kref_put include/linux/kref.h:65 [inline] BUG: KASAN: slab-use-after-free in sco_conn_put+0xdd/0x410 net/bluetooth/sco.c:107 Write of size 8 at addr ffff88811cb96b50 by task kworker/u17:4...
```diff diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index d382d980fd9a..ab0cf442d57b 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -498,6 +498,13 @@ static void sco_sock_kill(struct sock *sk) BT_DBG("sk %p state %d", sk, sk->sk_state); + /* Sock is dead, so set conn->sk to NULL to avoid...
ca94b2b036c22556c3a66f1b80f490882deef7a6
Analyze and fix the following issue in the Linux kernel code: Bluetooth: bcsp: receive data only if registered
Problem Details: Currently, bcsp_recv() can be called even when the BCSP protocol has not been registered. This leads to a NULL pointer dereference, as shown in the following stack trace: KASAN: null-ptr-deref in range [0x0000000000000108-0x000000000000010f] RIP: 0010:bcsp_recv+0x13d/0x1740 drivers/bluetooth/h...
```diff diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index 664d82d1e613..591abe6d63dd 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c @@ -582,6 +582,9 @@ static int bcsp_recv(struct hci_uart *hu, const void *data, int count) struct bcsp_struct *bcsp = hu->priv;...
70cd38d22d4659ca8133c7124528c90678215dda
Analyze and fix the following issue in the Linux kernel code: Bluetooth: btusb: Add new VID/PID 13d3/3633 for MT7922
Problem Details: Add VID 13d3 & PID 3633 for MediaTek MT7922 USB Bluetooth chip. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=06 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendo...
```diff diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index b231caa84757..5e9ebf0c5312 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -701,6 +701,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x13d3, 0x3615),...
576952cf981b7d2b7d3227b246b4326e5548a133
Analyze and fix the following issue in the Linux kernel code: Bluetooth: btusb: Add new VID/PID 13d3/3627 for MT7925
Problem Details: Add VID 13d3 & PID 3627 for MediaTek MT7922 USB Bluetooth chip. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=07 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendo...
```diff diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 505efc4872c3..b231caa84757 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -735,6 +735,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x13d3, 0x3613),...
7722d6fb54e428a8f657fccf422095a8d7e2d72c
Analyze and fix the following issue in the Linux kernel code: Bluetooth: btusb: Check for unexpected bytes when defragmenting HCI frames
Problem Details: Some Barrot based USB Bluetooth dongles erroneously send one extra random byte for the HCI_OP_READ_LOCAL_EXT_FEATURES command. The consequence of that is that the next HCI transfer is misaligned by one byte causing undefined behavior. In most cases the response event for the next command fails with ran...
```diff diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 3595a8bad6bd..505efc4872c3 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -66,6 +66,7 @@ static struct usb_driver btusb_driver; #define BTUSB_INTEL_BROKEN_INITIAL_NCMD BIT(25) #define BTUSB_INTEL_NO_WBS_SUPPORT...
9eb14331885b09adfa7fe69a5a4603e24909c88f
Analyze and fix the following issue in the Linux kernel code: Bluetooth: Add function and line information to bt_dbg
Problem Details: When enabling debug via CONFIG_BT_FEATURE_DEBUG include function and line information by default otherwise it is hard to make any sense of which function the logs comes from. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
```diff diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index e5751f3070b8..d46ed9011ee5 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h @@ -272,7 +272,8 @@ void bt_err_ratelimited(const char *fmt, ...); #define BT_ERR(fmt, ...) bt_err(fmt "\n",...
79e562a52adea4afa0601a15964498fae66c823c
Analyze and fix the following issue in the Linux kernel code: Bluetooth: MGMT: Fix not exposing debug UUID on MGMT_OP_READ_EXP_FEATURES_INFO
Problem Details: The debug UUID was only getting set if MGMT_OP_READ_EXP_FEATURES_INFO was not called with a specific index which breaks the likes of bluetoothd since it only invokes MGMT_OP_READ_EXP_FEATURES_INFO when an adapter is plugged, so instead of depending hdev not to be set just enable the UUID on any index l...
```diff diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 225140fcb3d6..a3d16eece0d2 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -4542,13 +4542,11 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev, return -ENOMEM; #ifdef CONFIG_BT_FEATURE_DEBUG - if (!hdev...
69a86cc17811c411fe336eb484a23bc0b425a814
Analyze and fix the following issue in the Linux kernel code: Bluetooth: HCI: Fix using LE/ACL buffers for ISO packets
Problem Details: ISO packets shall not use LE/ACL buffer pool, that feature seem to be exclusive to LE-ACL only. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
```diff diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index e524bb59bff2..091cff2155e6 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -924,10 +924,9 @@ static struct hci_conn *__hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t case CIS_LINK: case BIS_LINK: case PA_...
58fddb364dd5c4e9bf223a2113a42538d9c040de
Analyze and fix the following issue in the Linux kernel code: Bluetooth: btintel_pcie: Refactor Device Coredump
Problem Details: As device coredumps are not HCI traces, maintain the device coredump at the driver level and eliminate the dependency on hdev_devcd*() Signed-off-by: Kiran K <kiran.k@intel.com> Fixes: 07e6bddb54b4 ("Bluetooth: btintel_pcie: Add support for device coredump") Signed-off-by: Luiz Augusto von Dentz <luiz...
```diff diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index a625a5b2154b..6d3963bd56a9 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -15,6 +15,7 @@ #include <linux/interrupt.h> #include <linux/unaligned.h> +#include <linux/devcoredump.h> ...
34ecb8760190606472f71ebf4ca2817928ce5d40
Analyze and fix the following issue in the Linux kernel code: Bluetooth: btusb: Add USB ID 2001:332a for D-Link AX9U rev. A1
Problem Details: Add USB ID 2001:332a for D-Link AX9U rev. A1 which is based on a Realtek RTL8851BU chip. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below: T: Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 Mx...
```diff diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 8085fabadde8..3595a8bad6bd 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -522,6 +522,8 @@ static const struct usb_device_id quirks_table[] = { /* Realtek 8851BU Bluetooth devices */ { USB_DEVICE(0x3625, 0x01...
4540aed51b12bc13364149bf95f6ecef013197c0
Analyze and fix the following issue in the Linux kernel code: bpf: Enforce expected_attach_type for tailcall compatibility
Problem Details: Yinhao et al. recently reported: Our fuzzer tool discovered an uninitialized pointer issue in the bpf_prog_test_run_xdp() function within the Linux kernel's BPF subsystem. This leads to a NULL pointer dereference when a BPF program attempts to deference the txq member of struct xdp_buff object...
```diff diff --git a/include/linux/bpf.h b/include/linux/bpf.h index fe2a396d8ac6..a98c83346134 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -289,6 +289,7 @@ struct bpf_map_owner { bool xdp_has_frags; u64 storage_cookie[MAX_BPF_CGROUP_STORAGE_TYPE]; const struct btf_type *attach_func_proto; + enu...
0db0934e7f9bb624ed98a665890dbe249f65b8fd
Analyze and fix the following issue in the Linux kernel code: tracing: fgraph: Protect return handler from recursion loop
Problem Details: function_graph_enter_regs() prevents itself from recursion by ftrace_test_recursion_trylock(), but __ftrace_return_to_handler(), which is called at the exit, does not prevent such recursion. Therefore, while it can prevent recursive calls from fgraph_ops::entryfunc(), it is not able to prevent recursiv...
```diff diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index 1e3b32b1e82c..484ad7a18463 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -815,6 +815,7 @@ __ftrace_return_to_handler(struct ftrace_regs *fregs, unsigned long frame_pointe unsigned long bitmap; unsigned long ret; int offse...
86db0c32f16c5538ddb740f54669ace8f3a1f3d7
Analyze and fix the following issue in the Linux kernel code: 9p: fix /sys/fs/9p/caches overwriting itself
Problem Details: caches_show() overwrote its buffer on each iteration, so only the last cache tag was visible in sysfs output. Properly append with snprintf(buf + count, …). Signed-off-by: Randall P. Embry <rpembry@gmail.com> Message-ID: <20250926-v9fs_misc-v1-2-a8b3907fc04d@codewreck.org> Signed-off-by: Dominique Ma...
```diff diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index 01e70a464b60..4d289c56578f 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c @@ -560,7 +560,7 @@ static ssize_t caches_show(struct kobject *kobj, spin_lock(&v9fs_sessionlist_lock); list_for_each_entry(v9ses, &v9fs_sessionlist, slist) { if (v9ses->cachetag) { - ...
623fa18f6c94e589b29c4e6277943364f1bb71d6
Analyze and fix the following issue in the Linux kernel code: 9p: clean up comment typos
Problem Details: Fix a few minor typos in comments (e.g. "trasnport" → "transport"). Signed-off-by: Randall P. Embry <rpembry@gmail.com> Message-ID: <20250926-v9fs_misc-v1-1-a8b3907fc04d@codewreck.org> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
```diff diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index 77e9c4387c1d..01e70a464b60 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c @@ -438,8 +438,7 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses, v9ses->flags &= ~V9FS_ACCESS_MASK; v9ses->flags |= V9FS_ACCESS_USER; } - /*FIXME !! */ - /* for leg...
632d31067be2f414c57955efcf29c79290cc749b
Analyze and fix the following issue in the Linux kernel code: PM: sleep: Do not wait on SYNC_STATE_ONLY device links
Problem Details: Device links with DL_FLAG_SYNC_STATE_ONLY should not affect system suspend and resume, and functions like device_reorder_to_tail() and device_link_add() don't try to reorder the consumers with that flag. However, dpm_wait_for_consumers() and dpm_wait_for_suppliers() don't check thas flag before trigge...
```diff diff --git a/drivers/base/base.h b/drivers/base/base.h index 700aecd22fd3..86fa7fbb3548 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -248,6 +248,7 @@ void device_links_driver_cleanup(struct device *dev); void device_links_no_driver(struct device *dev); bool device_links_busy(struct device *de...
fed7eaa4f037361fe4f3d4170649d6849a25998d
Analyze and fix the following issue in the Linux kernel code: PM: runtime: Update kerneldoc return codes
Problem Details: APIs based on __pm_runtime_idle() (pm_runtime_idle(), pm_request_idle()) do not return 1 when already suspended. They return -EAGAIN. This is already covered in the docs, so the entry for "1" is redundant and conflicting. (pm_runtime_put() and pm_runtime_put_sync() were previously incorrect, but that'...
```diff diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index d88d6b6ccf5b..d1ff76e0e2d0 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -350,13 +350,12 @@ static inline int pm_runtime_force_resume(struct device *dev) { return -ENXIO; } * * 0: Success. * * -EINVAL: R...
d0b8651a026125d58b50b464aeb78f2c5956179f
Analyze and fix the following issue in the Linux kernel code: PM: runtime: Make put{,_sync}() return 1 when already suspended
Problem Details: The pm_runtime.h docs say pm_runtime_put() and pm_runtime_put_sync() return 1 when already suspended, but this is not true -- they return -EAGAIN. On the other hand, pm_runtime_put_sync_suspend() and pm_runtime_put_sync_autosuspend() *do* return 1. This is an artifact of the fact that the former are b...
```diff diff --git a/drivers/base/power/runtime-test.c b/drivers/base/power/runtime-test.c index 2e966fd96664..eca9885e807d 100644 --- a/drivers/base/power/runtime-test.c +++ b/drivers/base/power/runtime-test.c @@ -42,7 +42,7 @@ static void pm_runtime_already_suspended_test(struct kunit *test) pm_runtime_put(dev); ...
4b2113413e76213cb36e30e6d5299208254d9369
Analyze and fix the following issue in the Linux kernel code: bpftool: Remove duplicate string.h header
Problem Details: ./tools/bpf/bpftool/sign.c: string.h is included more than once. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=25502 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Acked-by: Quentin Monnet <qmo@kernel.org> Link: https://lore.k...
```diff diff --git a/tools/bpf/bpftool/sign.c b/tools/bpf/bpftool/sign.c index b29d825bb1d4..b34f74d210e9 100644 --- a/tools/bpf/bpftool/sign.c +++ b/tools/bpf/bpftool/sign.c @@ -11,7 +11,6 @@ #include <stdint.h> #include <stdbool.h> #include <string.h> -#include <string.h> #include <getopt.h> #include <err.h> #i...
87608c2a7718dcac5deef801fb3c18cf36fb0233
Analyze and fix the following issue in the Linux kernel code: bpf: Remove duplicate crypto/sha2.h header
Problem Details: ./include/linux/bpf.h: crypto/sha2.h is included more than once. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=25501 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Acked-by: Quentin Monnet <qmo@kernel.org> Link: https://lore.k...
```diff diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 6338e54a9b1f..fe2a396d8ac6 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -32,7 +32,6 @@ #include <linux/memcontrol.h> #include <linux/cfi.h> #include <asm/rqspinlock.h> -#include <crypto/sha2.h> struct bpf_verifier_env; struct b...
2227f273b7dc25a791ae6b152550098aa6934b2f
Analyze and fix the following issue in the Linux kernel code: rtla/actions: Fix condition for buffer reallocation
Problem Details: The condition to check if the actions buffer needs to be resized was incorrect. The check `self->size >= self->len` would evaluate to true on almost every call to `actions_new()`, causing the buffer to be reallocated unnecessarily each time an action was added. Fix the condition to `self->len >= self....
```diff diff --git a/tools/tracing/rtla/src/actions.c b/tools/tracing/rtla/src/actions.c index eab51c0c0ce2..13ff1934d47c 100644 --- a/tools/tracing/rtla/src/actions.c +++ b/tools/tracing/rtla/src/actions.c @@ -49,7 +49,7 @@ actions_destroy(struct actions *self) static struct action * actions_new(struct actions *self...
b1e0ff7209e952bdb4f9a85a8450546700b4affa
Analyze and fix the following issue in the Linux kernel code: rtla: Fix buffer overflow in actions_parse
Problem Details: Currently, tests 3 and 13-22 in tests/timerlat.t fail with error: *** buffer overflow detected ***: terminated timeout: the monitored command dumped core The result of running `sudo make check` is tests/timerlat.t (Wstat: 0 Tests: 22 Failed: 11) Failed tests: 3, 13-22 Files=3,...
```diff diff --git a/tools/tracing/rtla/src/actions.c b/tools/tracing/rtla/src/actions.c index aaf0808125d7..eab51c0c0ce2 100644 --- a/tools/tracing/rtla/src/actions.c +++ b/tools/tracing/rtla/src/actions.c @@ -131,7 +131,7 @@ actions_parse(struct actions *self, const char *trigger) { enum action_type type = ACTION_...
c4e30c22baa745173997c831011a95e03771e466
Analyze and fix the following issue in the Linux kernel code: tools/rtla: Fix -A option name in test comment
Problem Details: This was changed to --on-threshold when the patches were applied. Cc: John Kacur <jkacur@redhat.com> Cc: Costa Shulyupin <costa.shul@redhat.com> Link: https://lore.kernel.org/20250907022325.243930-6-crwood@redhat.com Reviewed-by: Tomas Glozar <tglozar@redhat.com> Signed-off-by: Crystal Wood <crwood@r...
```diff diff --git a/tools/tracing/rtla/tests/timerlat.t b/tools/tracing/rtla/tests/timerlat.t index c71aed5534bf..b5d1e7260a9b 100644 --- a/tools/tracing/rtla/tests/timerlat.t +++ b/tools/tracing/rtla/tests/timerlat.t @@ -47,9 +47,9 @@ check "trace output through -t" \ "timerlat hist -T 2 -t" 2 "^ Saving trace to t...
70a5ce8bc94545ba0fb47b2498bfb12de2132f4d
Analyze and fix the following issue in the Linux kernel code: net: macb: avoid dealing with endianness in macb_set_hwaddr()
Problem Details: bp->dev->dev_addr is of type `unsigned char *`. Casting it to a u32 pointer and dereferencing implies dealing manually with endianness, which is error-prone. Replace by calls to get_unaligned_le32|le16() helpers. This was found using sparse: ⟩ make C=2 drivers/net/ethernet/cadence/macb_main.o w...
```diff diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index fc082a7a5a31..4af2ec705ba5 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -274,9 +274,9 @@ static void macb_set_hwaddr(struct macb *bp) u32 bottom; ...
78d901897b3cae06b38f54e48a2378cf9da21175
Analyze and fix the following issue in the Linux kernel code: net: macb: single dma_alloc_coherent() for DMA descriptors
Problem Details: Move from 2*NUM_QUEUES dma_alloc_coherent() for DMA descriptor rings to 2 calls overall. Issue is with how all queues share the same register for configuring the upper 32-bits of Tx/Rx descriptor rings. Taking Tx, notice how TBQPH does *not* depend on the queue index: #define GEM_TBQP(hw_q) (0x0440...
```diff diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 73840808ea80..fc082a7a5a31 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2478,32 +2478,30 @@ static unsigned int macb_rx_ring_size_per_queue(struct ma...
92d4256fafd8d0a14d3aaa10452ac771bf9b597c
Analyze and fix the following issue in the Linux kernel code: net: macb: move ring size computation to functions
Problem Details: The tx/rx ring size calculation is somewhat complex and partially hidden behind a macro. Move that out of the {RX,TX}_RING_BYTES() macros and macb_{alloc,free}_consistent() functions into neat separate functions. In macb_free_consistent(), we drop the size variable and directly call the size helpers i...
```diff diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 3e634049dadf..73840808ea80 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -51,14 +51,10 @@ struct sifive_fu540_macb_mgmt { #define DEFAULT_RX_RING_SIZE...
fca3dc859b200ca4dcdd2124beaf3bb2ab80b0f7
Analyze and fix the following issue in the Linux kernel code: net: macb: remove illusion about TBQPH/RBQPH being per-queue
Problem Details: The MACB driver acts as if TBQPH/RBQPH are configurable on a per queue basis; this is a lie. A single register configures the upper 32 bits of each DMA descriptor buffers for all queues. Concrete actions: - Drop GEM_TBQPH/GEM_RBQPH macros which have a queue index argument. Only use MACB_TBQPH/MAC...
```diff diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index c9a5c8beb2fa..a7e845fee4b3 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -213,10 +213,8 @@ #define GEM_ISR(hw_q) (0x0400 + ((hw_q) << 2)) #define GEM_TBQP(hw_q) (0x0...
9665aa15ef8bdf1fa596f9ff8162e9c5e00ac036
Analyze and fix the following issue in the Linux kernel code: dt-bindings: net: cdns,macb: allow tsu_clk without tx_clk
Problem Details: Allow providing tsu_clk without a tx_clk as both are optional. This is about relaxing unneeded constraints. It so happened that in the past HW that needed a tsu_clk always needed a tx_clk. Fixes: 4e5b6de1f46d ("dt-bindings: net: cdns,macb: Convert to json-schema") Reviewed-by: Krzysztof Kozlowski <kr...
```diff diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml index 559d0f733e7e..6e20d67e7628 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -85,7 +85,7 @@ properties: ...
008385efd05e04d8dff299382df2e8be0f91d8a0
Analyze and fix the following issue in the Linux kernel code: selftests: mptcp: join: validate C-flag + def limit
Problem Details: The previous commit adds an exception for the C-flag case. The 'mptcp_join.sh' selftest is extended to validate this case. In this subtest, there is a typical CDN deployment with a client where MPTCP endpoints have been 'automatically' configured: - the server set net.mptcp.allow_join_initial_addr_po...
```diff diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 6055ee5762e1..a94b3960ad5e 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3306,6 +3306,17 @@ deny_join_id0_tests() run_t...
4b1ff850e0c1aacc23e923ed22989b827b9808f9
Analyze and fix the following issue in the Linux kernel code: mptcp: pm: in-kernel: usable client side with C-flag
Problem Details: When servers set the C-flag in their MP_CAPABLE to tell clients not to create subflows to the initial address and port, clients will likely not use their other endpoints. That's because the in-kernel path-manager uses the 'subflow' endpoints to create subflows only to the initial address and port. If ...
```diff diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 204e1f61212e..584cab90aa6e 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -637,9 +637,12 @@ void mptcp_pm_add_addr_received(const struct sock *ssk, } else { __MPTCP_INC_STATS(sock_net((struct sock *)msk), MPTCP_MIB_ADDADDRDROP); } - /* id0 should...
bf91f4bc9c1dfba75e457e6a5f11e3cda658729a
Analyze and fix the following issue in the Linux kernel code: net: phy: micrel: Fix lan8814_config_init
Problem Details: The blamed commit introduced the function lanphy_modify_page_reg which as name suggests it, it modifies the registers. In the same commit we have started to use this function inside the drivers. The problem is that in the function lan8814_config_init we passed the wrong page number when disabling the a...
```diff diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 0b42400e5e09..79ce3eb6752b 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -4367,7 +4367,7 @@ static int lan8814_config_init(struct phy_device *phydev) LAN8814_QSGMII_SOFT_RESET_BIT); /* Disable ANEG wi...
439263376c2c4e126cac0d07e4987568de4eaba5
Analyze and fix the following issue in the Linux kernel code: vhost: vringh: Fix copy_to_iter return value check
Problem Details: The return value of copy_to_iter can't be negative, check whether the copied length is equal to the requested length instead of checking for negative values. Cc: zhang jiao <zhangjiao2@cmss.chinamobile.com> Link: https://lore.kernel.org/all/20250910091739.2999-1-zhangjiao2@cmss.chinamobile.com Signed-...
```diff diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 9f27c3f6091b..1778eff7ab00 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -1161,6 +1161,7 @@ static inline int copy_to_iotlb(const struct vringh *vrh, void *dst, struct iov_iter iter; u64 translated; int ret; + siz...
e9f35294e18da82162004a2f35976e7031aaf7f9
Analyze and fix the following issue in the Linux kernel code: ptp: Add a upper bound on max_vclocks
Problem Details: syzbot reported WARNING in max_vclocks_store. This occurs when the argument max is too large for kcalloc to handle. Extend the guard to guard against values that are too large for kcalloc Reported-by: syzbot+94d20db923b9f51be0df@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?ext...
```diff diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h index b352df4cd3f9..f329263f33aa 100644 --- a/drivers/ptp/ptp_private.h +++ b/drivers/ptp/ptp_private.h @@ -22,6 +22,7 @@ #define PTP_MAX_TIMESTAMPS 128 #define PTP_BUF_TIMESTAMPS 30 #define PTP_DEFAULT_MAX_VCLOCKS 20 +#define PTP_MAX_VCLOCKS...
347afa39042728267550fa7a5ab5e9af52671add
Analyze and fix the following issue in the Linux kernel code: dpll: zl3073x: Fix double free in zl3073x_devlink_flash_update()
Problem Details: The zl3073x_devlink_flash_prepare() function calls zl3073x_fw_free() and the caller, zl3073x_devlink_flash_update(), also calls that same free function so it leads to a double free. Delete the extra free. Fixes: a1e891fe4ae8 ("dpll: zl3073x: Implement devlink flash callback") Signed-off-by: Dan Carpe...
```diff diff --git a/drivers/dpll/zl3073x/devlink.c b/drivers/dpll/zl3073x/devlink.c index f55d5309d4f9..ccc22332b346 100644 --- a/drivers/dpll/zl3073x/devlink.c +++ b/drivers/dpll/zl3073x/devlink.c @@ -167,7 +167,6 @@ zl3073x_devlink_flash_prepare(struct zl3073x_dev *zldev, zl3073x_devlink_flash_notify(zldev, ...
81dcfdd21dbd7067068c7c341ee448c3f0d6f115
Analyze and fix the following issue in the Linux kernel code: selftest: net: Fix error message if empty variable
Problem Details: Fix to avoid cases where the `res` shell variable is empty in script comparisons. The comparison has been modified into string comparison to handle other possible values the variable could assume. The issue can be reproduced with the command: make kselftest TARGETS=net It solves the error: ./tfo_pass...
```diff diff --git a/tools/testing/selftests/net/tfo_passive.sh b/tools/testing/selftests/net/tfo_passive.sh index 80bf11fdc046..a4550511830a 100755 --- a/tools/testing/selftests/net/tfo_passive.sh +++ b/tools/testing/selftests/net/tfo_passive.sh @@ -95,7 +95,7 @@ wait res=$(cat $out_file) rm $out_file -if [ $res -...
ffa8f0791955dec12af2a09a1655a41e3fff783a
Analyze and fix the following issue in the Linux kernel code: net: dns_resolver: Fix request-key cross-reference
Problem Details: Link to "Key Request Service" docs uses file:// scheme instead due to angled brackets markup. Fix it to proper cross-reference. Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com> Link: https://patch.msgid.link/20250924020626.17073-4-bagasdotme@gmail.com Si...
```diff diff --git a/Documentation/networking/dns_resolver.rst b/Documentation/networking/dns_resolver.rst index fbbd2c4635cb..52f298834db6 100644 --- a/Documentation/networking/dns_resolver.rst +++ b/Documentation/networking/dns_resolver.rst @@ -140,8 +140,8 @@ the key will be discarded and recreated when the data it ...
958baf5eaee394e5fd976979b0791a875f14a179
Analyze and fix the following issue in the Linux kernel code: net: usb: Remove disruptive netif_wake_queue in rtl8150_set_multicast
Problem Details: syzbot reported WARNING in rtl8150_start_xmit/usb_submit_urb. This is the sequence of events that leads to the warning: rtl8150_start_xmit() { netif_stop_queue(); usb_submit_urb(dev->tx_urb); } rtl8150_set_multicast() { netif_stop_queue(); netif_wake_queue(); <-- wakes up TX queue before URB is ...
```diff diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index ddff6f19ff98..92add3daadbb 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c @@ -664,7 +664,6 @@ static void rtl8150_set_multicast(struct net_device *netdev) rtl8150_t *dev = netdev_priv(netdev); u16 rx_creg = 0x9e...
231889d9b62650a2242b8b752565892a6cd18372
Analyze and fix the following issue in the Linux kernel code: dibs: Check correct variable in dibs_init()
Problem Details: There is a typo in this code. It should check "dibs_class" instead of "&dibs_class". Remove the &. Fixes: 804737349813 ("dibs: Create class dibs") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Alexandra Winter <wintera@linux.ibm.com> Link: https://patch.msgid.link/aNP-XcrjSUjZ...
```diff diff --git a/drivers/dibs/dibs_main.c b/drivers/dibs/dibs_main.c index 5425238d5a42..0374f8350ff7 100644 --- a/drivers/dibs/dibs_main.c +++ b/drivers/dibs/dibs_main.c @@ -258,8 +258,8 @@ static int __init dibs_init(void) max_client = 0; dibs_class = class_create("dibs"); - if (IS_ERR(&dibs_class)) - retu...
c35cf24a69b00b7f54f2f19838f2b82d54480b0f
Analyze and fix the following issue in the Linux kernel code: net: enetc: Fix probing error message typo for the ENETCv4 PF driver
Problem Details: Blamed commit wrongly indicates VF error in case of PF probing error. Fixes: 99100d0d9922 ("net: enetc: add preliminary support for i.MX95 ENETC PF") Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com> Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: htt...
```diff diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c index b3dc1afeefd1..a5c1f1cef3b0 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c @@ -1030,7 +1030,7 @@ static int enetc4_pf_probe(...
267bca002c504b6c656c23dc973a34ddaededbce
Analyze and fix the following issue in the Linux kernel code: dt-bindings: net: sparx5: correct LAN969x register space windows
Problem Details: LAN969x needs only 2 register space windows as GCB is already covered by the "devices" register space window, so expect only 2 "reg" and "reg-names" properties. Fixes: 41c6439fdc2b ("dt-bindings: net: add compatible strings for lan969x targets") Signed-off-by: Robert Marko <robert.marko@sartura.hr> Ac...
```diff diff --git a/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml b/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml index 082982c59a55..5caa3779660d 100644 --- a/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml +++ b/Documentation/devicetree/bindings/net/microc...
05703271c3cdcc0f2a8cf6ebdc45892b8ca83520
Analyze and fix the following issue in the Linux kernel code: PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV
Problem Details: Before disabling SR-IOV via config space accesses to the parent PF, sriov_disable() first removes the PCI devices representing the VFs. Since commit 9d16947b7583 ("PCI: Add global pci_lock_rescan_remove()") such removal operations are serialized against concurrent remove and rescan using the pci_resca...
```diff diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index ac4375954c94..77dee43b7858 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -629,15 +629,18 @@ static int sriov_add_vfs(struct pci_dev *dev, u16 num_vfs) if (dev->no_vf_scan) return 0; + pci_lock_rescan_remove(); for (i = 0; i < num_vfs;...
11ae737efea10a8cc1c48b6288bde93180946b8c
Analyze and fix the following issue in the Linux kernel code: selftests: drv-net: Reload pkt pointer after calling filter_udphdr
Problem Details: Fix a verification failure. filter_udphdr() calls bpf_xdp_pull_data(), which will invalidate all pkt pointers. Therefore, all ctx->data loaded before filter_udphdr() cannot be used. Reload it to prevent verification errors. The error may not appear on some compiler versions if they decide to load ctx-...
```diff diff --git a/tools/testing/selftests/net/lib/xdp_native.bpf.c b/tools/testing/selftests/net/lib/xdp_native.bpf.c index df4eea5c192b..c368fc045f4b 100644 --- a/tools/testing/selftests/net/lib/xdp_native.bpf.c +++ b/tools/testing/selftests/net/lib/xdp_native.bpf.c @@ -420,7 +420,6 @@ static int xdp_adjst_tail_gro...
33b6c8ed1ddd6118fbc150269cd2201462fbd7e6
Analyze and fix the following issue in the Linux kernel code: dt-bindings: vendor-prefixes: update regex for properties without a prefix
Problem Details: Update vendor-prefixes.yaml to allow property names without a prefix to contain '#' character in all positions Signed-off-by: Kael D'Alcamo <dev@kael-k.io> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
```diff diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 699560820fdf..6ce9de649f4b 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1862,7 +1862,7 @@ pat...
77e46093e83a2788e2cf80ba8c8731375e587ad2
Analyze and fix the following issue in the Linux kernel code: scripts: dt_to_config: fix grammar and a typo in --help text
Problem Details: - grammar: singular/plural inconsistency - typo: "of" -> "or" Signed-off-by: Markus Heidelberg <m.heidelberg@cab.de> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
```diff diff --git a/scripts/dtc/dt_to_config b/scripts/dtc/dt_to_config index 299d1c2b20d7..70d6d5f06bdc 100755 --- a/scripts/dtc/dt_to_config +++ b/scripts/dtc/dt_to_config @@ -51,10 +51,10 @@ $num_pr_flags = $pr_flag_pos_config_test_fail + 1; "compatible is white listed", "matching driver and/or kernel con...
d6f57d8c5a5aede34c72382cdbd5b35616e171e6
Analyze and fix the following issue in the Linux kernel code: dt-bindings: fix spelling, typos, grammar, duplicated words
Problem Details: Signed-off-by: Markus Heidelberg <m.heidelberg@cab.de> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
```diff diff --git a/Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml b/Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml index 89298b39903f..4cdca5320544 100644 --- a/Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml +++ b/Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml @...