id stringlengths 40 40 | instruction stringlengths 68 308 | input stringlengths 17 33.4k | output stringlengths 100 30k |
|---|---|---|---|
7fef1796ec4d8c4cce70c374efafdbbc8d6d6cbc | Analyze and fix the following issue in the Linux kernel code: libbpf: Guard add_data() against size overflow | Problem Details:
add_data() computes size8 = roundup(size, 8) and then hands size8 to
realloc_data_buf() before doing memcpy(gen->data_cur, data, size) with
the original size. A wrapped size8 passes through the realloc_data_buf()
INT32_MAX check. Harden this against overflow, though not realistic to
happen in practice.... | ```diff
diff --git a/tools/lib/bpf/gen_loader.c b/tools/lib/bpf/gen_loader.c
index 66e13566bc31..d79695f01c87 100644
--- a/tools/lib/bpf/gen_loader.c
+++ b/tools/lib/bpf/gen_loader.c
@@ -160,10 +160,16 @@ void bpf_gen__init(struct bpf_gen *gen, int log_level, int nr_progs, int nr_maps
static int add_data(struct bpf_... |
3c56ee343f9412d81918635c3e25e22a5dd6d87e | Analyze and fix the following issue in the Linux kernel code: bpf: Reject exclusive maps for bpf_map_elem iterators | Problem Details:
Exclusive maps (aka excl_prog_hash) are meant to be reachable only
from the single program whose hash matches. This is enforced by
check_map_prog_compatibility() when the map is referenced from a
program such as signed BPF loaders.
A bpf_map_elem iterator, however, binds its target map at attach
time ... | ```diff
diff --git a/kernel/bpf/map_iter.c b/kernel/bpf/map_iter.c
index 261a03ea73d3..ae0741a09c6d 100644
--- a/kernel/bpf/map_iter.c
+++ b/kernel/bpf/map_iter.c
@@ -112,6 +112,10 @@ static int bpf_iter_attach_map(struct bpf_prog *prog,
map = bpf_map_get_with_uref(linfo->map.map_fd);
if (IS_ERR(map))
return PTR... |
90ae44d1e1bc67e8f6ceef56f184047c5fe775c7 | Analyze and fix the following issue in the Linux kernel code: accel/amdxdna: Preserve user address when PASID is disabled | Problem Details:
When PASID is not used, the buffer user address is set to
AMDXDNA_INVALID_ADDR. As a result, heap buffer user address validation
fails even though the original userspace address is available.
Preserve the userspace address regardless of PASID usage so heap buffer
address validation works correctly.
F... | ```diff
diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c
index 00efa8abfeea..63976c3bcbe0 100644
--- a/drivers/accel/amdxdna/amdxdna_gem.c
+++ b/drivers/accel/amdxdna/amdxdna_gem.c
@@ -349,8 +349,11 @@ static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo,
u32 nr_pages;
i... |
376e118551545190debb3901ea4d0e46aa4c1dc4 | Analyze and fix the following issue in the Linux kernel code: KVM: x86: Take PIC lock on KVM_GET_IRQCHIP path | Problem Details:
When userspace issues the KVM_SET_IRQCHIP ioctl to set the state of
the PIC, kvm_vm_ioctl_set_irqchip() grabs @kvm->arch.vpic->lock before
updating the state. However, the KVM_GET_IRQCHIP ioctl to retrieve the
same PIC state does not grab such lock, potentially causing torn reads
for userspace.
Fix th... | ```diff
diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c
index 9519fec09ee6..8c62c6d4d5c1 100644
--- a/arch/x86/kvm/irq.c
+++ b/arch/x86/kvm/irq.c
@@ -585,12 +585,16 @@ int kvm_vm_ioctl_get_irqchip(struct kvm *kvm, struct kvm_irqchip *chip)
r = 0;
switch (chip->chip_id) {
case KVM_IRQCHIP_PIC_MASTER:
+ spin_... |
8dd640d9233dd1fdd649920fe1f7fce78a8b40fa | Analyze and fix the following issue in the Linux kernel code: arm64: mm: Check for pud_/pmd_set_huge() failures on kernel mappings | Problem Details:
Sashiko reports:
| If pmd_set_huge() rejects an unsafe page table transition (such as
| mapping a different physical address over an existing block mapping),
| it returns 0 and leaves the page table entry unmodified.
|
| Because *pmdp remains unmodified, READ_ONCE(pmd_val(*pmdp)) will equal
| pmd_val(... | ```diff
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 6cc7f9a51634..3b302a0e8f34 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -257,7 +257,7 @@ static int init_pmd(pmd_t *pmdp, unsigned long addr, unsigned long end,
/* try section mapping first */
if (((addr | next | phys) & ~PMD_MA... |
353530ece8523bb1fc65eac7fe2665e1090ef3e1 | Analyze and fix the following issue in the Linux kernel code: ASoC: loongson: Use the `idma` identifier for internal DMA variables | Problem Details:
The Loongson I2S controller can work with two types of DMA:
- Internal DMA (iDMA): integrated DMA engine, driven by dedicated
registers and interrupts.
- External DMA (eDMA): generic DMA engine (e.g., dw_dmac), using the
standard dmaengine API.
To distinguish these two distinct implementations, re... | ```diff
diff --git a/sound/soc/loongson/loongson_dma.c b/sound/soc/loongson/loongson_dma.c
index a149b643175c..f51b5b94e3ab 100644
--- a/sound/soc/loongson/loongson_dma.c
+++ b/sound/soc/loongson/loongson_dma.c
@@ -4,6 +4,7 @@
//
// Copyright (C) 2023 Loongson Technology Corporation Limited
// Author: Yingkun Meng <... |
e24d5dde56a50946020b134fa8448869093db76a | Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8192: Check runtime resume during probe | Problem Details:
The MT8192 AFE probe enables runtime PM temporarily while reinitializing
the regmap cache from hardware, but it uses pm_runtime_get_sync()
without checking the return value. If runtime resume fails, probe keeps
going without the device necessarily being accessible, and
pm_runtime_get_sync() may leave t... | ```diff
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
index 9f5057eeeff9..db0ae44a86af 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
@@ -2227,15 +2227,19 @@ static int mt8192_afe_pcm_dev_probe(struct platfo... |
965e17ae6751c5d3302430c8ebd650e72d45a85f | Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8192: Release reserved memory on cleanup | Problem Details:
The MT8192 AFE probe calls of_reserved_mem_device_init() and falls
back to preallocated buffers when no reserved memory region is
available. When the reserved memory assignment succeeds, however, the
driver never releases it.
Register a devm cleanup action after a successful reserved-memory
assignment... | ```diff
diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
index 3d32fe46118e..9f5057eeeff9 100644
--- a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
+++ b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c
@@ -2155,6 +2155,11 @@ static const dai_register_cb dai_register_cbs[] = ... |
f0334fbfd107682d0c95f3f71e25f6127038e2b9 | Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8183: Check runtime resume during probe | Problem Details:
The MT8183 AFE probe uses pm_runtime_get_sync() before reading hardware
defaults into the regmap cache, but does not check whether runtime resume
failed. If regmap_reinit_cache() then fails, the temporary runtime PM
usage count is also not released.
Use pm_runtime_resume_and_get() so resume failures a... | ```diff
diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
index 49a69728fd72..2634699534db 100644
--- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
+++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
@@ -844,17 +844,21 @@ static int mt8183_afe_pcm_dev_probe(struct platform... |
bee65e00c0924ebecf97718d95dcf4a05ee36471 | Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8183: Release reserved memory on cleanup | Problem Details:
The MT8183 AFE probe can assign reserved memory with
of_reserved_mem_device_init(), but the assignment is never released on
driver removal or later probe failures.
Register a devm cleanup action so the reserved memory assignment is
released consistently, matching newer Mediatek AFE drivers.
Fixes: ec... | ```diff
diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
index a7fef772760a..49a69728fd72 100644
--- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
+++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
@@ -766,6 +766,11 @@ static const dai_register_cb dai_register_cbs[] = {
... |
0cf3489bba9ad13aae052232e223e19a620fe7a7 | Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: rk3328: Use managed GPIO and clock helpers | Problem Details:
rk3328_platform_probe() acquires the mute GPIO with gpiod_get_optional()
but never releases it. It also enables mclk and pclk manually while
relying on probe error labels for unwind, and the driver has no platform
remove callback to disable those clocks after a successful unbind.
This path has already... | ```diff
diff --git a/sound/soc/codecs/rk3328_codec.c b/sound/soc/codecs/rk3328_codec.c
index 9697aefc6e03..5871b5a81975 100644
--- a/sound/soc/codecs/rk3328_codec.c
+++ b/sound/soc/codecs/rk3328_codec.c
@@ -425,7 +425,6 @@ static int rk3328_platform_probe(struct platform_device *pdev)
struct rk3328_codec_priv *rk3328... |
fa11039d6cdff84584a3ef8cc1f5e1b56e045da2 | Analyze and fix the following issue in the Linux kernel code: regulator: scmi: fix of_node refcount leak in scmi_regulator_probe() | Problem Details:
scmi_regulator_probe() calls of_find_node_by_name() which takes a
reference on the returned device node. On the error path where
process_scmi_regulator_of_node() fails, the function returns without
calling of_node_put() on the child node, leaking the reference.
Add of_node_put(np) on the error path to... | ```diff
diff --git a/drivers/regulator/scmi-regulator.c b/drivers/regulator/scmi-regulator.c
index 6d609c42e479..c005e65ba0ec 100644
--- a/drivers/regulator/scmi-regulator.c
+++ b/drivers/regulator/scmi-regulator.c
@@ -345,8 +345,10 @@ static int scmi_regulator_probe(struct scmi_device *sdev)
for_each_child_of_node_s... |
aa1bdbb39f49c5bc9779316891c40005517842a5 | Analyze and fix the following issue in the Linux kernel code: ntfs3: fix out-of-bounds read in ntfs_dir_emit() and hdr_find_e() | Problem Details:
The bounds check in ntfs_dir_emit() compares fname->name_len (a
character count) against e->size (a byte count) without accounting
for the 2-byte-per-character UTF-16LE encoding or the ATTR_FILE_NAME
header size:
if (fname->name_len + sizeof(struct NTFS_DE) > le16_to_cpu(e->size))
This computes: na... | ```diff
diff --git a/fs/ntfs3/dir.c b/fs/ntfs3/dir.c
index a052ba9250e7..873d52233003 100644
--- a/fs/ntfs3/dir.c
+++ b/fs/ntfs3/dir.c
@@ -305,7 +305,9 @@ static inline bool ntfs_dir_emit(struct ntfs_sb_info *sbi,
if (sbi->options->nohidden && (fname->dup.fa & FILE_ATTRIBUTE_HIDDEN))
return true;
- if (fname->na... |
b7a9125cac8645245d2473c6c0a50e338280ad23 | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: fix mount failure on 64K page-size kernels | Problem Details:
On 64K page-size kernels, mounting NTFS volumes smaller than ~650 MB
fails with EINVAL. The issue is in log_replay(): the initial log page
size probe uses PAGE_SIZE (65536) instead of DefaultLogPageSize (4096)
when PAGE_SIZE exceeds DefaultLogPageSize * 2.
This makes norm_file_page() require the $LogF... | ```diff
diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c
index 767f7cdab8d1..92a7e3a46240 100644
--- a/fs/ntfs3/fslog.c
+++ b/fs/ntfs3/fslog.c
@@ -1172,7 +1172,7 @@ static int read_log_page(struct ntfs_log *log, u32 vbo,
goto out;
if (page_buf->rhdr.sign != NTFS_FFFF_SIGNATURE)
- ntfs_fix_post_read(&page_buf->r... |
1bf15dd17385e3730521d17e9e158c475cd7474b | Analyze and fix the following issue in the Linux kernel code: ntfs3: avoid another -Wmaybe-uninitialized warning | Problem Details:
The ntfs3 specific -Wmaybe-uninitialized flag found one more false-postive,
this time with gcc-10 on s390:
fs/ntfs3/frecord.c: In function 'ni_expand_list':
fs/ntfs3/frecord.c:1370:16: error: 'ins_attr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Add an explicit NULL poin... | ```diff
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 0d98bc932c24..abab45f6f180 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -1330,7 +1330,7 @@ int ni_expand_list(struct ntfs_inode *ni)
{
int err = 0;
u32 asize, done = 0;
- struct ATTRIB *attr, *ins_attr;
+ struct ATTRIB *attr, *ins_at... |
70d3855594cf6e8791970714b65cac3202d6160e | Analyze and fix the following issue in the Linux kernel code: ntfs3: Allocate iomap inline_data using alloc_page | Problem Details:
This fixes a BUG reported in iomap_write_end_inline:
iomap_inline_data_valid checks that the inline_data fits within
a page. If the inline_data is allocated with kmemdup there's no
guarantee that it's page-aligned, so the check sometimes fails.
Allocate it with alloc_page to ensure it's page-aligned.
... | ```diff
diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c
index a85d3ee51091..c621a4c582f9 100644
--- a/fs/ntfs3/attrib.c
+++ b/fs/ntfs3/attrib.c
@@ -1001,6 +1001,7 @@ int attr_data_get_block_locked(struct ntfs_inode *ni, CLST vcn, CLST clen,
struct ATTRIB *attr, *attr_b;
struct ATTR_LIST_ENTRY *le, *le_b;
struc... |
ecbb433f9a8e3297f298226c15fada69b3748d3e | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: fold file size handling into ntfs_set_size() | Problem Details:
Remove the separate ntfs_extend() and ntfs_truncate() helpers and route
file size changes through ntfs_set_size().
This consolidates ntfs3 size updates in one place and lets the write,
fallocate, and setattr paths share the same logic for updating i_size,
valid data length, and preallocated extents.
... | ```diff
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
index 26bec5be248e..06a5d9b44ac1 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -450,93 +450,6 @@ out:
return err;
}
-static int ntfs_extend(struct inode *inode, loff_t pos, size_t count,
- struct file *file)
-{
- struct ntfs_inode *ni = ntfs_i(... |
33f29fc7c67e1d7235755202697370f486a25413 | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: add fileattr support | Problem Details:
Implement fileattr_get() and fileattr_set() to fix a problem found
during the internal testing.
This allows ntfs3 to expose and modify inode flags through the generic
file attribute interface used by FS_IOC_GETFLAGS and FS_IOC_SETFLAGS.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-s... | ```diff
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
index b041639ab406..f421a36b1ed6 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -89,6 +89,80 @@ static int ntfs_ioctl_fitrim(struct ntfs_sb_info *sbi, unsigned long arg)
return 0;
}
+/*
+ * ntfs_fileattr_get - inode_operations::fileattr_get
+ */
+int nt... |
e8ed78f40eecd0176fda71d673f6957c98e7ffbe | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: call _ntfs_bad_inode() when failing to rename | Problem Details:
It is safe to call _ntfs_bad_inode on live inodes since:
commit 519b078998ce ("fs/ntfs3: Exclude call make_bad_inode for live nodes.")
The WARN_ON was added when it wasn't safe by:
commit d99208b91933 ("fs/ntfs3: cancle set bad inode after removing name fails")
Replace the WARN_ON with a call to ... | ```diff
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 7b035da63c12..78eb065c7e43 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -2800,8 +2800,8 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,
err = ni_add_name(new_dir_ni, ni, new_de);
if (!err) {
err = ni_remo... |
36c7276816ed4266c155b71b1fa747b2785f23f7 | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: fix wrong LCN in run_remove_range() when splitting a run | Problem Details:
When run_remove_range() removes a middle portion of a non-sparse run,
it splits the run into head and tail parts. The tail is inserted via
run_add_entry() but uses the original r->lcn as its starting LCN
instead of advancing it by the split offset.
For example, removing VCN range [10, 20) from a run
... | ```diff
diff --git a/fs/ntfs3/run.c b/fs/ntfs3/run.c
index 19aa044fd1fc..ad7db67514ef 100644
--- a/fs/ntfs3/run.c
+++ b/fs/ntfs3/run.c
@@ -1297,9 +1297,12 @@ bool run_remove_range(struct runs_tree *run, CLST vcn, CLST len, CLST *done)
if (r_end > end) {
/* Remove a middle part, split. */
+ CLST tail_lcn = r-... |
57382ec6ac63b63dce2789e835fded28b698ae79 | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: validate Dirty Page Table capacity in log_replay copy_lcns | Problem Details:
In the analysis pass of $LogFile journal replay, log_replay() copies
LCNs from each action log record into an existing Dirty Page Table
(DPT) entry without bounding the destination index. A crafted NTFS
image with DPT entry lcns_follow=1 and an action log record with
lcns_follow=2 produces a kernel sla... | ```diff
diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c
index 66ead9db26ee..767f7cdab8d1 100644
--- a/fs/ntfs3/fslog.c
+++ b/fs/ntfs3/fslog.c
@@ -4564,11 +4564,21 @@ copy_lcns:
* whole routine a loop, case Lcns do not fit below.
*/
t16 = le16_to_cpu(lrh->lcns_follow);
- for (i = 0; i < t16; i++) {
- size... |
932fa0c1496286e39e14e27194c1ee7c2181629f | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: fix syncing wrong inode on DIRSYNC cross-directory rename | Problem Details:
In ntfs3_rename(), when IS_DIRSYNC(new_dir) is true, the code syncs
the renamed file inode instead of the target directory new_dir:
if (IS_DIRSYNC(new_dir))
ntfs_sync_inode(inode); /* should be new_dir */
DIRSYNC requires that directory metadata changes are written to disk
synchronous... | ```diff
diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c
index b2af8f695e60..64cde1a856f4 100644
--- a/fs/ntfs3/namei.c
+++ b/fs/ntfs3/namei.c
@@ -340,7 +340,7 @@ static int ntfs_rename(struct mnt_idmap *idmap, struct inode *dir,
ntfs_sync_inode(dir);
if (IS_DIRSYNC(new_dir))
- ntfs_sync_inode(inode);
+ nt... |
98d6e5d9dc1d34dcffc61549617581a5fe1ef807 | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: validate index entry key bounds | Problem Details:
[BUG]
A malformed NTFS directory index entry can advertise a key_size larger
than the bytes actually present in its NTFS_DE payload. Directory lookup
then passes that malformed key to cmp_fnames(), which can read past the
end of the kmalloc'ed index buffer.
BUG: KASAN: slab-out-of-bounds in fname_full... | ```diff
diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c
index 0d1be4da3e4f..66ead9db26ee 100644
--- a/fs/ntfs3/fslog.c
+++ b/fs/ntfs3/fslog.c
@@ -2599,11 +2599,12 @@ static int read_next_log_rec(struct ntfs_log *log, struct lcb *lcb, u64 *lsn)
bool check_index_header(const struct INDEX_HDR *hdr, size_t bytes)
{
+ ... |
b1c1101067d9536bcb0fe023b96ee2dde5535959 | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: preserve non-DOS attribute bits in system.dos_attrib | Problem Details:
[BUG]
A corrupted ntfs3 image can hit a NULL function pointer call in
generic_perform_write() after toggling system.ntfs_attrib and then
overwriting system.dos_attrib on the same file.
BUG: kernel NULL pointer dereference, address: 0000000000000000
\#PF: supervisor instruction fetch in kernel mode
\#P... | ```diff
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
index 9eeac0ab2b71..7e5118247660 100644
--- a/fs/ntfs3/xattr.c
+++ b/fs/ntfs3/xattr.c
@@ -867,7 +867,9 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler,
if (!strcmp(name, SYSTEM_DOS_ATTRIB)) {
if (sizeof(u8) != size)
goto out;
- ... |
d62cf685d12e95cc0a4122c43cd9f0eb8bba0b4c | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: hold ni_lock across readdir metadata walk | Problem Details:
[BUG]
KASAN reports a slab-use-after-free during getdents(2):
BUG: KASAN: slab-use-after-free in ntfs_read_mft fs/ntfs3/inode.c:79 [inline]
BUG: KASAN: slab-use-after-free in ntfs_iget5+0x59b/0x3450 fs/ntfs3/inode.c:541
Read of size 2 at addr ffff88800b7a5a4e by task syz.0.1061/2354
Call Trace:
__du... | ```diff
diff --git a/fs/ntfs3/dir.c b/fs/ntfs3/dir.c
index d99ab086ef6f..a052ba9250e7 100644
--- a/fs/ntfs3/dir.c
+++ b/fs/ntfs3/dir.c
@@ -489,10 +489,17 @@ static int ntfs_readdir(struct file *file, struct dir_context *ctx)
goto out;
}
+ /*
+ * Keep directory metadata stable for the whole walk. Loading subrec... |
bb11485a87fbb2254b62cfed630b699d50e57da8 | Analyze and fix the following issue in the Linux kernel code: fs/ntfs3: add bounds check to run_get_highest_vcn() | Problem Details:
run_get_highest_vcn() parses a packed NTFS mapping-pairs buffer without
any length bound, relying solely on a 0x00 terminator to stop. A
crafted $LogFile UpdateMappingPairs record whose embedded attribute
contains mapping-pairs runs without a terminator causes the function to
read past the slab alloca... | ```diff
diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c
index acfa18b84401..0d1be4da3e4f 100644
--- a/fs/ntfs3/fslog.c
+++ b/fs/ntfs3/fslog.c
@@ -3368,7 +3368,10 @@ move_data:
memmove(Add2Ptr(attr, aoff), data, dlen);
if (run_get_highest_vcn(le64_to_cpu(attr->nres.svcn),
- attr_run(attr), &t64)) {
+ at... |
42546fc642e929de07459ff839a9f43a653ffb4e | Analyze and fix the following issue in the Linux kernel code: KVM: s390: Lock pte when making page secure | Problem Details:
Make sure _kvm_s390_pv_make_secure() takes the pte lock for the given
address when attempting to make the page secure.
One of the steps in making the page secure is freezing the folio using
folio_ref_freeze(), which temporarily sets the reference count to 0.
Any attempt to get such a folio while froze... | ```diff
diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c
index c2dafd812a3b..4b865e75351c 100644
--- a/arch/s390/kvm/pv.c
+++ b/arch/s390/kvm/pv.c
@@ -17,6 +17,7 @@
#include <linux/pagewalk.h>
#include <linux/sched/mm.h>
#include <linux/mmu_notifier.h>
+#include <asm/gmap_helpers.h>
#include "kvm-s390.h"
#incl... |
9a1dfbbd3506c4f7159feab5ef27434e80256fa5 | Analyze and fix the following issue in the Linux kernel code: KVM: s390: Fix fault-in code | Problem Details:
Fix the fault-in code so that it does not return success if a
concurrent unmap event invalidated the fault-in process between the
best-effort lockless check and the proper check with lock.
The new behaviour is to retry, like the best-effort lockless check
already did.
This prevents the fault-in handl... | ```diff
diff --git a/arch/s390/kvm/faultin.c b/arch/s390/kvm/faultin.c
index ddf0ca71f374..cf542b0a7e8e 100644
--- a/arch/s390/kvm/faultin.c
+++ b/arch/s390/kvm/faultin.c
@@ -36,7 +36,8 @@ int kvm_s390_faultin_gfn(struct kvm_vcpu *vcpu, struct kvm *kvm, struct guest_fa
struct kvm_s390_mmu_cache *mc = NULL;
struct k... |
6af5563e827913d3e14dbf12eefd5af4aa592739 | Analyze and fix the following issue in the Linux kernel code: KVM: s390: vsie: Fix rmap handling in _do_shadow_crste() | Problem Details:
Fix _do_shadow_crste() to also apply a mask on the reverse address, to
prevent spurious entries from being created, like already done in
gmap_protect_rmap().
Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260602142356.16945... | ```diff
diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
index 4f8d5592c9a9..20e28b183c1a 100644
--- a/arch/s390/kvm/gaccess.c
+++ b/arch/s390/kvm/gaccess.c
@@ -1466,15 +1466,17 @@ static int _do_shadow_crste(struct gmap *sg, gpa_t raddr, union crste *host, uni
struct guest_fault *f, bool p)
{
... |
ca42c16638d5570c44842ff68a772c62e6dd0124 | Analyze and fix the following issue in the Linux kernel code: KVM: s390: Fix guest / virtual address confusion in _essa_clear_cbrl() | Problem Details:
Until now, gmap_helper_zap_one_page() was being called with the guest
absolute address, but it expects a userspace virtual address.
This meant that in the best case the requested pages were not being
discarded, and in the worst case that the wrong pages were being
discarded.
Fix this by converting th... | ```diff
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index cc0553da14cb..447ec7ed423d 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -1188,6 +1188,7 @@ static void _essa_clear_cbrl(struct kvm_vcpu *vcpu, unsigned long *cbrl, int len
union crste *crstep;
union pgste pgste;
union pte *p... |
89fa757931dc0bcd64ef22b28d1d5ad00c5d02f4 | Analyze and fix the following issue in the Linux kernel code: KVM: s390: Avoid potentially sleeping while atomic when zapping pages | Problem Details:
Factor out try_get_locked_pte(), which behaves similarly to
get_locked_pte(), but does not attempt to allocate missing tables and
performs a spin_trylock() instead of blocking.
The new function is also exported, since it will be used in other
patches.
If intermediate entries are missing, there can be... | ```diff
diff --git a/arch/s390/include/asm/gmap_helpers.h b/arch/s390/include/asm/gmap_helpers.h
index 2d3ae421077e..d2b616604a46 100644
--- a/arch/s390/include/asm/gmap_helpers.h
+++ b/arch/s390/include/asm/gmap_helpers.h
@@ -12,5 +12,6 @@ void gmap_helper_zap_one_page(struct mm_struct *mm, unsigned long vmaddr);
voi... |
d1adc098ce08893c92fce3db63f7bb750fbb4c30 | Analyze and fix the following issue in the Linux kernel code: KVM: s390: Fix _gmap_crstep_xchg_atomic() | Problem Details:
The previous incorrect behaviour cleared the vsie_notif bit without
returning false, which allowed shadow crstes to be installed without
the vsie_notif bit.
Return false and do not perform the operation if an unshadow event has
been triggered, but still attempt to clear the vsie_notif bit from the
exi... | ```diff
diff --git a/arch/s390/kvm/gmap.h b/arch/s390/kvm/gmap.h
index 742e42a31744..5374f21aaf8d 100644
--- a/arch/s390/kvm/gmap.h
+++ b/arch/s390/kvm/gmap.h
@@ -273,11 +273,14 @@ static inline bool __must_check _gmap_crstep_xchg_atomic(struct gmap *gmap, unio
gmap_unmap_prefix(gmap, gfn, gfn + align);
}
if (cr... |
29e8751c1dd278262fb4cd234e8909287d4189d4 | Analyze and fix the following issue in the Linux kernel code: KVM: s390: Fix _gmap_unmap_crste() | Problem Details:
In _gmap_unmap_crste(), the crste to be unmapped is zapped calling
gmap_crstep_xchg_atomic() exactly once, and expecting it to succeed.
This is a reasonable sanity check, since kvm->mmu_lock is being held in
write mode, and thus no races should be possible.
An upcoming patch will change the behaviour ... | ```diff
diff --git a/arch/s390/kvm/gmap.c b/arch/s390/kvm/gmap.c
index 957126ab991c..52d55ddea8d4 100644
--- a/arch/s390/kvm/gmap.c
+++ b/arch/s390/kvm/gmap.c
@@ -395,15 +395,28 @@ static long _gmap_unmap_crste(union crste *crstep, gfn_t gfn, gfn_t next, struct
struct gmap_unmap_priv *priv = walk->priv;
struct foli... |
3f2d03ecf22b09da1d92ba06e1ba6e20d16060e9 | Analyze and fix the following issue in the Linux kernel code: iio: adc: ad4080: fix AD4880 chip ID | Problem Details:
The AD4880 chip ID was incorrectly set to 0x0750. According to the
datasheet, the product ID registers read 0x00 (PRODUCT_ID_H) and 0x59
(PRODUCT_ID_L), giving a combined chip ID of 0x0059. Fix the value to
match the actual hardware.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed... | ```diff
diff --git a/drivers/iio/adc/ad4080.c b/drivers/iio/adc/ad4080.c
index 764d49eca9e0..8d2953341b15 100644
--- a/drivers/iio/adc/ad4080.c
+++ b/drivers/iio/adc/ad4080.c
@@ -135,7 +135,7 @@
#define AD4086_CHIP_ID 0x0056
#define AD4087_CHIP_ID 0x0057
#define AD4088_CHIP_ID 0x0058
-#define AD4880_C... |
6a579050f8300adb794f09a5d1f4ff435d43ced5 | Analyze and fix the following issue in the Linux kernel code: printk: fix typos in comments | Problem Details:
Fix spelling/grammatical errors in printk.c and nbcon.c:
- "precation" -> "precautionary"
- "othrewise" -> "otherwise"
- "An usable" -> "A usable"
- "made a progress" -> "made progress"
- "preemtible" -> "preemptible"
- "mechasism" -> "mechanism"
- "ownerhip" -> "ownership"
Signed-off-by: Naveen Kumar... | ```diff
diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
index d7044a7a214b..4b03b019cd5e 100644
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
@@ -1487,7 +1487,7 @@ bool nbcon_allow_unsafe_takeover(void)
* or write_thread().
*
* When false, the write_thread() callback is used and would be
- ... |
6636e16e60e9f6ac09bf2faf88bce0c5cde7d83c | Analyze and fix the following issue in the Linux kernel code: block, bfq: release cgroup stats with bfq_group | Problem Details:
BFQ cgroup stats contain percpu counters embedded in struct bfq_group,
but the old free path destroys them from bfq_pd_free(), which is tied
to blkg policy-data teardown.
That is not the same lifetime as struct bfq_group. BFQ pins bfq_group
while bfq_queue entities refer to it, so bfq_pd_free() can dr... | ```diff
diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index ac83b0668764..37ab70930c8d 100644
--- a/block/bfq-cgroup.c
+++ b/block/bfq-cgroup.c
@@ -300,6 +300,25 @@ static struct bfq_group *bfqg_parent(struct bfq_group *bfqg)
return pblkg ? blkg_to_bfqg(pblkg) : NULL;
}
+static void bfqg_stats_exit(struct b... |
00e06cb773fd81d4f2806a6ee69d1aef8f6dd5ca | Analyze and fix the following issue in the Linux kernel code: mm: mm_init: use div64_ul() instead of do_div() | Problem Details:
Fixes Coccinelle/coccicheck warning reported by do_div.cocci.
Compared to do_div(), div64_ul() does not implicitly cast the divisor and
does not unnecessarily calculate the remainder.
There are no functional changes. The benefit is purely a semantic cleanup
that better communicates the intent of the ... | ```diff
diff --git a/mm/mm_init.c b/mm/mm_init.c
index f9f8e1af921c..4e0909a721d2 100644
--- a/mm/mm_init.c
+++ b/mm/mm_init.c
@@ -2412,7 +2412,7 @@ void *__init alloc_large_system_hash(const char *tablename,
/* limit allocation size to 1/16 total memory by default */
if (max == 0) {
max = ((unsigned long long)n... |
fda8355f13ea3c0f9499acdeff3024995b474948 | Analyze and fix the following issue in the Linux kernel code: driver core: Use system_percpu_wq instead of system_wq | Problem Details:
Commit 1137838865bf ("driver core: Use mod_delayed_work to prevent lost
deferred probe work") added a use of system_wq, which is deprecated in
favor of system_percpu_wq added by commit 128ea9f6ccfb ("workqueue: Add
system_percpu_wq and system_dfl_wq"). An upcoming warning in the
workqueue tree flags th... | ```diff
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index a8ca2092905e..60c005223844 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -324,7 +324,7 @@ void deferred_probe_extend_timeout(void)
* start a new one.
*/
if (delayed_work_pending(&deferred_probe_timeout_work) &&
- mod_delayed_work(s... |
0967074f6830718fd2597404ef119bddd0dbfd00 | Analyze and fix the following issue in the Linux kernel code: nvme: fix FDP fdpcidx bounds check | Problem Details:
The fdpcidx bounds check sets n = NUMFDPC + 1 but used > instead of >=,
incorrectly accepting fdp_idx when it equals n (i.e. NUMFDPC + 1).
Fixes: 30b5f20bb2dd ("nvme: register fdp parameters with the block layer")
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
Reviewed-by: Christoph Hellwig <hch@l... | ```diff
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index f69e3115d8cf..ea837b94d3e5 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2261,7 +2261,7 @@ static int nvme_query_fdp_granularity(struct nvme_ctrl *ctrl,
}
n = le16_to_cpu(h->numfdpc) + 1;
- if (fdp_idx > n) {... |
6c0cf89f36ac0c0fd8687a4ccdce2efb23a9c663 | Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: limit injected antenna index in ieee80211_parse_tx_radiotap | Problem Details:
When parsing the radiotap header of an injected frame,
ieee80211_parse_tx_radiotap() uses the IEEE80211_RADIOTAP_ANTENNA value
directly as a shift count:
info->control.antennas |= BIT(*iterator.this_arg);
*iterator.this_arg is an 8-bit value taken straight from the frame
supplied by userspace, so BI... | ```diff
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index b487d2330f25..ea7f63e1fc17 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2181,7 +2181,9 @@ bool ieee80211_parse_tx_radiotap(struct sk_buff *skb,
case IEEE80211_RADIOTAP_ANTENNA:
/* this can appear multiple times, keep a bitmap */
- ... |
4cd92957e8f8cc4ebfe8a5d4203c14c592fde6b1 | Analyze and fix the following issue in the Linux kernel code: wifi: nl80211: reject oversized EMA RNR lists | Problem Details:
nl80211_parse_rnr_elems() stores the parsed element count in a
u8-backed cfg80211_rnr_elems::cnt field and uses that count to size
the flexible array allocation.
Reject nested NL80211_ATTR_EMA_RNR_ELEMS input once the count reaches
255, before incrementing it again. This keeps the parser aligned with
... | ```diff
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 7db9cd433801..dac2e8643c49 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -6366,6 +6366,9 @@ nl80211_parse_rnr_elems(struct wiphy *wiphy, struct nlattr *attrs,
if (ret)
return ERR_PTR(ret);
+ if (num_elems >= 255)
... |
8757fd9500cf2fd9b27451cb6eb7e28003c3d202 | Analyze and fix the following issue in the Linux kernel code: nvme-tcp: Use WQ_PERCPU explicitly if wq_unbound is false. | Problem Details:
Since commit 21c05ca88a54 ("workqueue: Add warnings and ensure
one among WQ_PERCPU or WQ_UNBOUND is present"), we must explicitly
set WQ_PERCPU or WQ_UNBOUND when creating workqueue.
nvme_tcp_init_module() sets WQ_UNBOUND when the module param
wq_unbound is set, but otherwise, WQ_PERCPU is missing, tr... | ```diff
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 0552aa8a1150..6241e71130c4 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -3053,6 +3053,8 @@ static int __init nvme_tcp_init_module(void)
if (wq_unbound)
wq_flags |= WQ_UNBOUND;
+ else
+ wq_flags |= WQ_PERCPU;
... |
53cd102a7a56079b11b897835bd9b94c14e6322c | Analyze and fix the following issue in the Linux kernel code: nvmet: fix pre-auth out-of-bounds heap read in Discovery Get Log Page | Problem Details:
nvmet_execute_disc_get_log_page() validates only the dword alignment
of the host-supplied Log Page Offset (lpo). The 64-bit offset is then
added to a small kzalloc'd buffer that holds the discovery log page
and the result is passed straight to nvmet_copy_to_sgl(), which
memcpy()s data_len bytes out to... | ```diff
diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c
index e9b35549e254..114869d16a1f 100644
--- a/drivers/nvme/target/discovery.c
+++ b/drivers/nvme/target/discovery.c
@@ -166,6 +166,7 @@ static void nvmet_execute_disc_get_log_page(struct nvmet_req *req)
u64 offset = nvmet_get_log_p... |
6d99479799c69c3cb588fcda19c81d8f61d64ecd | Analyze and fix the following issue in the Linux kernel code: rseq: Fix using an uninitialized stack variable in rseq_exit_user_update() | Problem Details:
There is an bug in which an uninitialized stack variable is used in
rseq_exit_user_update() as reported by syzbot:
BUG: KMSAN: kernel-infoleak in rseq_set_ids_get_csaddr include/linux/rseq_entry.h:502 [inline]
The local variable:
struct rseq_ids ids = {
.cpu_id = task_cpu(t),
.mm_cid = task_m... | ```diff
diff --git a/include/linux/rseq_entry.h b/include/linux/rseq_entry.h
index 63bc72086e75..ed9da6e41a2a 100644
--- a/include/linux/rseq_entry.h
+++ b/include/linux/rseq_entry.h
@@ -635,10 +635,11 @@ static __always_inline bool rseq_exit_user_update(struct pt_regs *regs, struct t
return true;
}
+ int cpu = ... |
63c1a12bc0e09af7dee919c4fb4a300a719d5125 | Analyze and fix the following issue in the Linux kernel code: sched: restore timer_slack_ns when resetting RT policy on fork | Problem Details:
Commit ed4fb6d7ef68 ("hrtimer: Use and report correct timerslack values
for realtime tasks") sets timer_slack_ns to 0 for RT tasks in
__setscheduler_params(). However, when an RT task with SCHED_RESET_ON_FORK
creates child threads, the children inherit timer_slack_ns=0 from the
parent. sched_fork() res... | ```diff
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5a317f62a516..2cfe8932d5db 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4826,6 +4826,7 @@ int sched_fork(u64 clone_flags, struct task_struct *p)
p->policy = SCHED_NORMAL;
p->static_prio = NICE_TO_PRIO(0);
p->rt_priority =... |
85358f0c6d590318539e657b0b3090871211193f | Analyze and fix the following issue in the Linux kernel code: MAINTAINERS: Fix spelling mistake in Peter's name | Problem Details:
Fix a typo in Peter's name which was added by commit 113d0a6b3954
("MAINTAINERS: Add Peter explicitly to the psi section").
Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260530160842.29089-1-zenghui.yu@lin... | ```diff
diff --git a/MAINTAINERS b/MAINTAINERS
index 882214b0e7db..e4ee0844dc0c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -21329,7 +21329,7 @@ F: include/uapi/linux/pps_gen.h
PRESSURE STALL INFORMATION (PSI)
M: Johannes Weiner <hannes@cmpxchg.org>
M: Suren Baghdasaryan <surenb@google.com>
-R: Peter Ziljstra <pet... |
bdaf235913e1f31453c6e0e109d797269f9f0a37 | Analyze and fix the following issue in the Linux kernel code: locking: mutex: Fix proxy-exec potentially deactivating tasks marked TASK_RUNNING | Problem Details:
Vineeth found came up with a test driver that could trip up
workqueue stalls. After fixing one issue this test found,
Vineeth reported the test was still failing.
Greatly simplified, a task that tries to take a mutex already
owned by another task that is sleeping, can hit a edge case in
the mutex_lock... | ```diff
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index 09534628dc01..a93d4c6bee1a 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -763,6 +763,7 @@ __mutex_lock_common(struct mutex *lock, unsigned int state, unsigned int subclas
raw_spin_lock_irqsave(&lock->wait_lock, flags);
... |
88bac2c1a72b8f4f71e9845699aa872df04e5850 | Analyze and fix the following issue in the Linux kernel code: nvme-multipath: set BIO_REMAPPED on bios remapped to per-path namespace disks | Problem Details:
When nvme_ns_head_submit_bio() remaps a bio from the multipath head to a
per-path namespace, bio_set_dev() clears BIO_REMAPPED. The remapped bio
is then resubmitted through submit_bio_noacct() which calls
bio_check_eod() because BIO_REMAPPED is not set.
This races with nvme_ns_remove() which zeroes t... | ```diff
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index d6c51f59ff25..bd9e8d5a2713 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -521,6 +521,12 @@ static void nvme_ns_head_submit_bio(struct bio *bio)
ns = nvme_find_path(head);
if (likely(ns)) {
... |
eb48730bb827d1550401a5d391903f9d90b493c8 | Analyze and fix the following issue in the Linux kernel code: xfrm: iptfs: fix use-after-free on first_skb in __input_process_payload | Problem Details:
__input_process_payload() stores first_skb into xtfs->ra_newskb under
drop_lock when starting partial reassembly, then unlocks and breaks out
of the processing loop. The post-loop check reads xtfs->ra_newskb
without the lock to decide whether first_skb is still owned:
if (first_skb && first_iplen ... | ```diff
diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c
index 62ba828632f1..aea63a000d1d 100644
--- a/net/xfrm/xfrm_iptfs.c
+++ b/net/xfrm/xfrm_iptfs.c
@@ -954,6 +954,7 @@ static bool __input_process_payload(struct xfrm_state *x, u32 data,
u32 first_iplen, iphlen, iplen, remaining, tail;
u32 capturelen;
... |
4cf06977bdb6a037e2717b4117f3fd636f6e9641 | Analyze and fix the following issue in the Linux kernel code: nvme-multipath: require exact iopolicy names for module parameter | Problem Details:
The iopolicy module parameter uses strncmp prefix matching, so values
like "numax" are accepted as "numa". The per-subsystem sysfs attribute
already requires an exact match via sysfs_streq(). Parse both through
a shared helper so invalid values are rejected consistently.
Reviewed-by: Christoph Hellw... | ```diff
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index e00e2842df30..d6c51f59ff25 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -73,19 +73,29 @@ static const char *nvme_iopolicy_names[] = {
static int iopolicy = NVME_IOPOLICY_NUMA;
+static int n... |
0fd2b00b2d3d05e3eaa13342b3dfb0fa85c226ae | Analyze and fix the following issue in the Linux kernel code: USB: serial: io_ti: fix heap overflow in build_i2c_fw_hdr() | Problem Details:
build_i2c_fw_hdr() allocates a fixed-size buffer of
(16*1024 - 512) + sizeof(struct ti_i2c_firmware_rec) bytes, then
copies le16_to_cpu(img_header->Length) bytes into it without
validating that Length fits within the available space after the
firmware record header.
img_header->Length is a __le16 from... | ```diff
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 6e0d4c38911b..d48819d785ef 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -844,6 +844,11 @@ static int build_i2c_fw_hdr(u8 *header, const struct firmware *fw)
/* Pointer to fw_down memory image */
img_hea... |
183c1076eca43bbb3e7bdf597456f91d81c73e74 | Analyze and fix the following issue in the Linux kernel code: USB: serial: io_ti: fix heap overflow in get_manuf_info() | Problem Details:
get_manuf_info() reads le16_to_cpu(rom_desc->Size) bytes from the
device I2C EEPROM into a buffer allocated with kmalloc_obj(), which
is sizeof(struct edge_ti_manuf_descriptor) = 10 bytes.
The Size field comes from the device and is only validated (in
check_i2c_image()) to make sure the descriptor fit... | ```diff
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index cb55370e036f..6e0d4c38911b 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -773,6 +773,12 @@ static int get_manuf_info(struct edgeport_serial *serial, u8 *buffer)
}
/* Read the descriptor data */
+ if (l... |
a4659be0bc7cb1856ffb15b67f903229ae8891ec | Analyze and fix the following issue in the Linux kernel code: ext2: fix ignored return value of generic_write_sync() | Problem Details:
Fix ext2_dio_write_iter() to propagate the error returned by
generic_write_sync() instead of silently discarding it, which could
cause write(2) to return success to userspace on O_SYNC/O_DSYNC files
even when the sync failed.
The correct pattern, already used in ext2_dax_write_iter() in the same
file ... | ```diff
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index fa0a9750cbd8..8dca9ec4cacd 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -161,12 +161,15 @@ static ssize_t ext2_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
endbyte = pos + status - 1;
ret2 = filemap_write_and_wait_range(inode->i_mappin... |
69fe699afe1afcb730164b86c228483c2da05f94 | Analyze and fix the following issue in the Linux kernel code: iommu/amd: Don't split flush for amd_iommu_domain_flush_all() | Problem Details:
We have observed multiple full invalidations occurring during device
detach when we are done using the vfio-device.
blocked_domain_attach_device()
-> detach_device()
-> amd_iommu_domain_flush_all()
-> amd_iommu_domain_flush_pages(..., CMD_INV_IOMMU_ALL_PAGES_ADDRESS)
while (size !=... | ```diff
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index f1333071da10..0c042668b32d 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -1770,7 +1770,8 @@ void amd_iommu_domain_flush_pages(struct protection_domain *domain,
{
lockdep_assert_held(&domain->lock);
- if (li... |
8d4346ecd4950ae08cc76a6de327c264e846758c | Analyze and fix the following issue in the Linux kernel code: iommu/rockchip: disable fetch dte time limit | Problem Details:
Disable the Bit 31 of the AUTO_GATING iommu register, as it causes
hangups with the RGA3 (Raster Graphics Acceleration 3) peripheral.
The RGA3 register description of the TRM already states that the bit
must be set to 1. The vendor kernel sets the bit unconditionally to
1 to fix VOP (Video Output Proce... | ```diff
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c
index 0013cf196c57..87ae036d6414 100644
--- a/drivers/iommu/rockchip-iommu.c
+++ b/drivers/iommu/rockchip-iommu.c
@@ -76,6 +76,8 @@
#define SPAGE_ORDER 12
#define SPAGE_SIZE (1 << SPAGE_ORDER)
+#define DISABLE_FETCH_DTE_TIME_LIMIT ... |
426e5846eba75feaf1c9c6c119cb153610192da1 | Analyze and fix the following issue in the Linux kernel code: HID: Input: Add battery list cleanup with devm action | Problem Details:
The batteries list (hdev->batteries) is not cleaned up during
hidinput_disconnect(), but struct hid_battery entries are allocated
with devm_kzalloc.
When a driver is unbound (e.g. during devicereprobe), devm frees those
entries while their list_head nodesremain dangling in hdev->batteries,
which persis... | ```diff
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index d73cfa2e73d3..c7b8c4ff7a33 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -519,6 +519,13 @@ static struct hid_battery *hidinput_find_battery(struct hid_device *dev,
return NULL;
}
+static void hidinput_cleanup_batte... |
317d5146fb399ad1e87b310ee7d018fe648d40ba | Analyze and fix the following issue in the Linux kernel code: NFS: write_completion: dereference loop-local req, not hdr->req | Problem Details:
5d3869a41f36 ("NFS: fix writeback in presence of errors") introduced
a dereference of hdr->req->wb_lock_context in nfs_write_completion's
per-request loop. hdr->req is set once at nfs_pgheader_init() time
and is not refcount-protected for the lifetime of the loop; when hdr
aggregates requests from mul... | ```diff
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 3134bb17f3e3..d7c399763ad9 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -927,7 +927,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
}
if (nfs_write_need_commit(hdr)) {
struct nfs_open_context *ctx =
- hdr->req->wb_lock_con... |
ae0383e5a9a4b12d68c76c4769857def4665deff | Analyze and fix the following issue in the Linux kernel code: drm/imx: Fix three kernel-doc warnings in dcss-scaler.c | Problem Details:
Fix the following W=1 kerneldoc warnings by adding the missing parameter
descriptions for @phase0_identity and @nn_interpolation in
dcss_scaler_filter_design() and @phase0_identity in
dcss_scaler_gaussian_filter()
Warning: drivers/gpu/drm/imx/dcss/dcss-scaler.c:173 function parameter 'phase0_identity'... | ```diff
diff --git a/drivers/gpu/drm/imx/dcss/dcss-scaler.c b/drivers/gpu/drm/imx/dcss/dcss-scaler.c
index 32c3f46b21da..5c7f8d952ec1 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-scaler.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-scaler.c
@@ -166,6 +166,7 @@ static int exp_approx_q(int x)
* dcss_scaler_gaussian_filter() - Ge... |
caaf6ccaec2744aa7ec82f78b05b316d9a8d1857 | Analyze and fix the following issue in the Linux kernel code: arm64: dts: amlogic: t7: Fix missing required reset property | Problem Details:
CHECK_DTBS shows missing reset required property in T7 DTBS.
A new CHECK_DTBS with this patch does not show this anymore.
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
Link: https://patch.msgid.link/20260331-fix-aml-t7-null-reset-v1-2-eb95b625234c@aliel.fr
Signed-off-by: Neil Armstrong <ne... | ```diff
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
index fc23f409fe1d..62f6b9baad28 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
+++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
@@ -717,6 +717,7 @@
<&clkc_periphs CLKID_SD_EMMC_A>,
<&... |
8c45bf9ae4efcecd2f91bc3e6f567280721fd0fd | Analyze and fix the following issue in the Linux kernel code: arm64: dts: amlogic: t7: khadas-vim4: Add power regulators | Problem Details:
Add voltage regulator nodes describing the VIM4 power tree,
required by peripheral nodes such as the SD card controller.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Ronald Claveau <linux-kernel-dev@aliel.fr>
Link: https://patch.msgid.link/20260326-add-emmc-t7-vim4-v5-6-d3f18... | ```diff
diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts
index f4c953034be3..003b3bcdaf2b 100644
--- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts
+++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.d... |
a37c75d7b5bb7f3344b0e639b313ac5ace6244ff | Analyze and fix the following issue in the Linux kernel code: clk: spacemit: k3: Add PCIe DBI clock | Problem Details:
Add PCIe DBI (Data Bus Interface) clock which was missing, This will
support PCIe driver to explicitly request and enable all clocks that
needed.
Link: https://patch.msgid.link/20260511-06-pci-clk-fix-v2-4-c9a5e563bab3@kernel.org
Signed-off-by: Yixun Lan <dlan@kernel.org> | ```diff
diff --git a/drivers/clk/spacemit/ccu-k3.c b/drivers/clk/spacemit/ccu-k3.c
index 8f0b743046ab..196d32194125 100644
--- a/drivers/clk/spacemit/ccu-k3.c
+++ b/drivers/clk/spacemit/ccu-k3.c
@@ -949,14 +949,19 @@ CCU_MUX_GATE_DEFINE(edp1_pxclk, edp1_pclk_parents, APMU_LCD_EDP_CTRL, 18, 1, BIT
CCU_GATE_DEFINE(pci... |
7a2db70a3196717bfb01415b6dde1f90d4291ab1 | Analyze and fix the following issue in the Linux kernel code: dt-bindings: soc: spacemit: k3: Add PCIe DBI clock IDs | Problem Details:
Add clock IDs of PCIe DBI (Data Bus Interface) clock.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20260511-06-pci-clk-fix-v2-3-c9a5e563bab3@kernel.org
Signed-off-by: Yixun Lan <dlan@kernel.org> | ```diff
diff --git a/include/dt-bindings/clock/spacemit,k3-clocks.h b/include/dt-bindings/clock/spacemit,k3-clocks.h
index b22336f3ae40..dfae52547cda 100644
--- a/include/dt-bindings/clock/spacemit,k3-clocks.h
+++ b/include/dt-bindings/clock/spacemit,k3-clocks.h
@@ -380,6 +380,11 @@
#define CLK_APMU_ISIM_VCLK1 86... |
2f20c859a82a291483a8b3f01cbfbb1642782a14 | Analyze and fix the following issue in the Linux kernel code: clk: spacemit: k3: Fix PCIe clock register offset | Problem Details:
The offset of PCIe Clock CTRL register for port B and C controller was
wrongly swapped, correct it here.
Fixes: 091d19cc2401 ("clk: spacemit: k3: extract common header")
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://patch.msgid.link/20260511-06-pci-clk-fix-v2-2-c9a5e563bab3@kernel.... | ```diff
diff --git a/include/soc/spacemit/k3-syscon.h b/include/soc/spacemit/k3-syscon.h
index 0299bea065a0..a68255dd641f 100644
--- a/include/soc/spacemit/k3-syscon.h
+++ b/include/soc/spacemit/k3-syscon.h
@@ -168,8 +168,8 @@
#define APMU_CPU_C2_CLK_CTRL 0x394
#define APMU_CPU_C3_CLK_CTRL 0x208
#define APMU_PCIE_... |
d8a4cef90b1a4ae9196a5bfba683eb9a0c75acdc | Analyze and fix the following issue in the Linux kernel code: clk: spacemit: k3: Switch to pll2_d6 as parent for PCIe clock | Problem Details:
According to SpacemiT updated docs, the PCIe master and slave clock's
parent is the pll2_d6 clock, so fix it.
Fixes: e371a77255b8 ("clk: spacemit: k3: add the clock tree")
Link: https://patch.msgid.link/20260511-06-pci-clk-fix-v2-1-c9a5e563bab3@kernel.org
Signed-off-by: Yixun Lan <dlan@kernel.org> | ```diff
diff --git a/drivers/clk/spacemit/ccu-k3.c b/drivers/clk/spacemit/ccu-k3.c
index e98afd59f05c..8f0b743046ab 100644
--- a/drivers/clk/spacemit/ccu-k3.c
+++ b/drivers/clk/spacemit/ccu-k3.c
@@ -947,16 +947,16 @@ static const struct clk_parent_data edp1_pclk_parents[] = {
};
CCU_MUX_GATE_DEFINE(edp1_pxclk, edp1_p... |
457cf3d00dab71b7e74603b6ee96e13c51a8fd3d | Analyze and fix the following issue in the Linux kernel code: powerpc: Fix indentation and replace typedef with struct name | Problem Details:
Indent several struct members using tabs instead of spaces.
Replace the typedef alias AOUTHDR with an explicit struct name to
silence a checkpatch warning.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20... | ```diff
diff --git a/arch/powerpc/boot/hack-coff.c b/arch/powerpc/boot/hack-coff.c
index a010e124ac4b..6bf0c94302f5 100644
--- a/arch/powerpc/boot/hack-coff.c
+++ b/arch/powerpc/boot/hack-coff.c
@@ -31,7 +31,7 @@ main(int ac, char **av)
int i, nsect;
int aoutsz;
struct external_filehdr fhdr;
- AOUTHDR... |
a5779442addf487b8093b12e7acdb16a5aab2f11 | Analyze and fix the following issue in the Linux kernel code: MAINTAINERS: powerpc: update VMX AES entries | Problem Details:
Commit 7cf2082e74ce ("lib/crypto: powerpc/aes: Migrate POWER8 optimized
code into library") removed arch/powerpc/crypto/aes.c and moved
arch/powerpc/crypto/aesp8-ppc.pl to lib/crypto/powerpc/.
However, the "IBM Power VMX Cryptographic instructions" entry still
references the removed file and no longer... | ```diff
diff --git a/MAINTAINERS b/MAINTAINERS
index c2c6d79275c6..ab024c62c4ee 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12346,13 +12346,13 @@ L: linux-crypto@vger.kernel.org
S: Supported
F: arch/powerpc/crypto/Kconfig
F: arch/powerpc/crypto/Makefile
-F: arch/powerpc/crypto/aes.c
F: arch/powerpc/crypto/aes_cb... |
0521dbbc5710aca3b3d189747781761732289623 | Analyze and fix the following issue in the Linux kernel code: powerpc/xive: Add warning if target CPU not found | Problem Details:
Add a warn_once to warn if the CPU target is not found. This could help
to find about any such usecase.
This is a very rare case, which either means mask was empty or
atomic update failed for all online CPUs. So it is worth printing that
path for potential fix.
Signed-off-by: Shrikanth Hegde <sshegde... | ```diff
diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index c120be73d149..dadd1f46ec93 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -564,6 +564,7 @@ static int xive_find_target_in_mask(const struct cpumask *mask,
return cpu;
}
+ W... |
b3580dd1c68cec23d44a39c439e18b4686c13480 | Analyze and fix the following issue in the Linux kernel code: powerpc/fadump: Add timeout to RTAS busy-wait loops | Problem Details:
The ibm,configure-kernel-dump RTAS call sites in
rtas_fadump_register(), rtas_fadump_unregister(), and
rtas_fadump_invalidate() polled indefinitely while firmware returned
a busy status. A misbehaving or hung firmware could stall these paths
forever, blocking fadump registration at boot or preventing c... | ```diff
diff --git a/arch/powerpc/platforms/pseries/rtas-fadump.c b/arch/powerpc/platforms/pseries/rtas-fadump.c
index eceb3289383e..3bb4ac2ab6cc 100644
--- a/arch/powerpc/platforms/pseries/rtas-fadump.c
+++ b/arch/powerpc/platforms/pseries/rtas-fadump.c
@@ -179,9 +179,42 @@ static u64 rtas_fadump_get_bootmem_min(void)... |
fb176425837693f50c5c9fc8db6fbb04af22bd0a | Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Add buffer overflow check in MS get_info_ioctl | Problem Details:
Add validation that the info size returned from the metric stream info
query is not exceeded when checked against the allocated buffer size.
If the firmware returns a size larger than the buffer, reject the
operation with -EOVERFLOW instead of proceeding with an incorrect
buffer copy.
Fixes: cdfad4db7... | ```diff
diff --git a/drivers/accel/ivpu/ivpu_ms.c b/drivers/accel/ivpu/ivpu_ms.c
index be43851f5f32..cd176e77b9a0 100644
--- a/drivers/accel/ivpu/ivpu_ms.c
+++ b/drivers/accel/ivpu/ivpu_ms.c
@@ -291,6 +291,13 @@ int ivpu_ms_get_info_ioctl(struct drm_device *dev, void *data, struct drm_file *
if (ret)
goto unlock;
... |
dd1311bcf0e62f0c515115f46a3813370f4a4bb1 | Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Add bounds checks for firmware log indices | Problem Details:
Add validation that read and write indices in the firmware log buffer
are within valid bounds (< data_size) before using them. If
out-of-bounds indices are encountered (from firmware), clamp them to
safe values instead of proceeding with invalid offsets.
This prevents potential out-of-bounds buffer ac... | ```diff
diff --git a/drivers/accel/ivpu/ivpu_fw_log.c b/drivers/accel/ivpu/ivpu_fw_log.c
index 337c906b0210..275baf844b56 100644
--- a/drivers/accel/ivpu/ivpu_fw_log.c
+++ b/drivers/accel/ivpu/ivpu_fw_log.c
@@ -98,6 +98,11 @@ static void fw_log_print_buffer(struct vpu_tracing_buffer_header *log, const cha
u32 log_sta... |
1d0b597facdd3c0239c88e8797c1014e1ea0ef15 | Analyze and fix the following issue in the Linux kernel code: accel/ivpu: Add bounds check for firmware runtime memory | Problem Details:
Validate that the firmware runtime memory specified in the image
header is properly aligned and sized to hold the firmware image.
This prevents errors during memory allocation and image transfer.
Fixes: 2007e210b6a1 ("accel/ivpu: Split FW runtime and global memory buffers")
Cc: stable@vger.kernel.org ... | ```diff
diff --git a/drivers/accel/ivpu/ivpu_fw.c b/drivers/accel/ivpu/ivpu_fw.c
index 107f8ad31050..33c50779c06b 100644
--- a/drivers/accel/ivpu/ivpu_fw.c
+++ b/drivers/accel/ivpu/ivpu_fw.c
@@ -259,6 +259,22 @@ static int ivpu_fw_parse(struct ivpu_device *vdev)
return -EINVAL;
}
+ if (!PAGE_ALIGNED(runtime_addr... |
9588076fb21992a5d14efeb99134ebf034c7b84f | Analyze and fix the following issue in the Linux kernel code: tools/testing/memblock: fix stale NUMA reservation tests | Problem Details:
memblock allocations now reserve memory with MEMBLOCK_RSRV_KERN and,
on NUMA configurations, record the requested node on the reserved
region. Several memblock simulator NUMA tests still expected merges
that only worked before those reservation semantics changed, so the
suite aborted even though the al... | ```diff
diff --git a/tools/testing/memblock/README b/tools/testing/memblock/README
index 7ca437d81806..b435f48d8a70 100644
--- a/tools/testing/memblock/README
+++ b/tools/testing/memblock/README
@@ -104,10 +104,7 @@ called at the beginning of each test.
Known issues
============
-1. Requesting a specific NUMA node ... |
3a3fc1dfd6a958615ebaab8fb251e89fc2b3f2f2 | Analyze and fix the following issue in the Linux kernel code: mm/fake-numa: fix under-allocation detection in uniform split | Problem Details:
When splitting NUMA node uniformly, split_nodes_size_interleave_uniform()
returns the next absolute node ID, not the number of nodes created.
The existing under-allocation detection logic compares next absolute node
ID (ret) and request count (n), which only works when nid starts at 0.
For example, o... | ```diff
diff --git a/mm/numa_emulation.c b/mm/numa_emulation.c
index 703c8fa05048..55f26b22bb0b 100644
--- a/mm/numa_emulation.c
+++ b/mm/numa_emulation.c
@@ -214,7 +214,7 @@ static u64 uniform_size(u64 max_addr, u64 base, u64 hole, int nr_nodes)
* Sets up fake nodes of `size' interleaved over physical nodes ranging ... |
ec07a2f1d337dd5a816431724a876026296369a8 | Analyze and fix the following issue in the Linux kernel code: powerpc: dts: Add missing model properties | Problem Details:
These are the remaining PowerPC devicetrees that do not have a /model
property, even though it is required by the devicetree specification.
Fix them by simply copying the compatible string.
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: ht... | ```diff
diff --git a/arch/powerpc/boot/dts/mpc8308_p1m.dts b/arch/powerpc/boot/dts/mpc8308_p1m.dts
index 41f917f97dab..5af945e1743c 100644
--- a/arch/powerpc/boot/dts/mpc8308_p1m.dts
+++ b/arch/powerpc/boot/dts/mpc8308_p1m.dts
@@ -9,6 +9,7 @@
/ {
compatible = "denx,mpc8308_p1m";
+ model = "denx,mpc8308_p1m";
#ad... |
b93c55b4932dd7e32dca8cf34a3443cc87a02906 | Analyze and fix the following issue in the Linux kernel code: bpf: fix UAF by restoring RCU-delayed inode freeing in bpffs | Problem Details:
commit 4f375ade6aa9 ("bpf: Avoid RCU context warning when unpinning
htab with internal structs") moved inode cleanup from ->free_inode()
into ->destroy_inode() to avoid sleeping in RCU context when calling
bpf_any_put(). However this removed the RCU delay on freeing the
inode itself and the cached syml... | ```diff
diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c
index 25c06a011825..188c774a469c 100644
--- a/kernel/bpf/inode.c
+++ b/kernel/bpf/inode.c
@@ -766,10 +766,18 @@ static void bpf_destroy_inode(struct inode *inode)
{
enum bpf_type type;
- if (S_ISLNK(inode->i_mode))
- kfree(inode->i_link);
if (!bpf_ino... |
3522b21fd7e1863d0734537737bd59f1b90d0190 | Analyze and fix the following issue in the Linux kernel code: devlink: Release nested relation on devlink free | Problem Details:
devlink relation state is normally released from devl_unregister(), which
calls devlink_rel_put(). This misses devlink instances that get a nested
relation before registration and then fail probe before devl_register() is
reached.
That flow can happen for SFs. The child devlink gets linked to its
pare... | ```diff
diff --git a/net/devlink/core.c b/net/devlink/core.c
index eeb6a71f5f56..fe9f6a0a67d5 100644
--- a/net/devlink/core.c
+++ b/net/devlink/core.c
@@ -518,6 +518,8 @@ void devlink_free(struct devlink *devlink)
{
ASSERT_DEVLINK_NOT_REGISTERED(devlink);
+ devlink_rel_put(devlink);
+
WARN_ON(!list_empty(&devlin... |
3b09ff54114566864eea59020f6b69c5bb325b9d | Analyze and fix the following issue in the Linux kernel code: net: qrtr: fix node refcount leak on ctrl packet alloc failure | Problem Details:
qrtr_send_resume_tx() calls qrtr_node_lookup() which takes a
reference on the returned node. If the subsequent call to
qrtr_alloc_ctrl_packet() fails due to memory allocation failure, the
function returns -ENOMEM without calling qrtr_node_release() to
release the node reference.
Add qrtr_node_release(... | ```diff
diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c
index 7cec6a7859b0..c9f892427f7c 100644
--- a/net/qrtr/af_qrtr.c
+++ b/net/qrtr/af_qrtr.c
@@ -1009,8 +1009,10 @@ static int qrtr_send_resume_tx(struct qrtr_cb *cb)
return -EINVAL;
skb = qrtr_alloc_ctrl_packet(&pkt, GFP_KERNEL);
- if (!skb)
+ if (!skb) ... |
a213a8950414c684999dcf03edeea6c46ede172e | Analyze and fix the following issue in the Linux kernel code: l2tp: pppol2tp: hold reference to session in pppol2tp_ioctl() | Problem Details:
pppol2tp_ioctl() read sock->sk->sk_user_data directly without any
locks or reference counting. If a controllable sleep was induced during
copy_from_user() (e.g. via a userfaultfd page fault sleep), a concurrent
socket close could trigger pppol2tp_session_close() asynchronously. This
frees the l2tp_se... | ```diff
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 99d6582f41de..e0b1915be1a6 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -1045,64 +1045,76 @@ static int pppol2tp_ioctl(struct socket *sock, unsigned int cmd,
{
struct pppol2tp_ioc_stats stats;
struct l2tp_session *session;
+ int ... |
9c89f975e66922f346d92d60c9d51d07274a7f3b | Analyze and fix the following issue in the Linux kernel code: net: txgbe: fix phylink leak on AML init failure | Problem Details:
Destroy the phylink instance when fixed-link setup fails.
Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Jiawen Wu <jiawenwu@trustnetic.com>
Link: https://patch.msgid.link/20260528013258.129146-1-zhaochenguang@kylino... | ```diff
diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
index da1d3976ed33..72712cee1ab8 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c
@@ -517,6 +517,7 @@ int txgbe_phylink_init_aml(struct txg... |
996ea50ee9575f94b42dca86f7713d2123ef811e | Analyze and fix the following issue in the Linux kernel code: net: fec_mpc52xx_phy: Add missing MODULE_DESCRIPTION() | Problem Details:
Fixes error during modpost:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/net/ethernet/freescale/fec_mpc52xx_phy.o
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://patch.msgid.link/20260527025139.10188-1-rosenp@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org> | ```diff
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
index d48a1c4d0431..e25111bcbf16 100644
--- a/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
+++ b/drivers/net/ethernet/freescale/fec_mpc52xx_phy.c
@@ -150,4 +150,5 @@ struct platform_driver mpc52x... |
2a58899d11009bffc7b4b32a571858f381121837 | Analyze and fix the following issue in the Linux kernel code: 6lowpan: fix off-by-one in multicast context address compression | Problem Details:
The second memcpy in lowpan_iphc_mcast_ctx_addr_compress() uses
&data[1] as destination and &ipaddr->s6_addr[11] as source, but
both should be offset by one: &data[2] and &ipaddr->s6_addr[12]
respectively.
This off-by-one has two consequences:
1. data[1] is overwritten with s6_addr[11], corrupting the... | ```diff
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
index e116d308a8df..37eaff3f7b69 100644
--- a/net/6lowpan/iphc.c
+++ b/net/6lowpan/iphc.c
@@ -1086,12 +1086,12 @@ static u8 lowpan_iphc_mcast_ctx_addr_compress(u8 **hc_ptr,
const struct lowpan_iphc_ctx *ctx,
const struct in6_addr *ipad... |
2483ae0a56231a915c706411421c6c002a2bf83e | Analyze and fix the following issue in the Linux kernel code: scsi: ufs: Fix wrong value printed in unexpected UPIU response case | Problem Details:
In ufshcd_transfer_rsp_status(), the default case of the inner switch
statement prints the UPIU response code when an unexpected response is
received. However, the code was printing 'result' variable which is
always 0 at that point, making the error message useless for debugging.
Fix this by printing ... | ```diff
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 9b6cb6b569bc..3441e874eacc 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -5716,7 +5716,7 @@ static inline int ufshcd_transfer_rsp_status(struct ufs_hba *hba,
default:
dev_err(hba->dev,
"Unexpected re... |
4cf752f6b99ab63506cde5a611d4219e97adbd84 | Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Fix NULL pointer dereference in scsi_cmd_priv() calls | Problem Details:
ufshcd_tag_to_cmd() may return NULL if no command is associated with the
given tag. However, several callers dereference the returned cmd pointer
via scsi_cmd_priv() without checking for NULL first, leading to a
potential NULL pointer dereference.
Fix this by adding NULL checks for cmd before calling ... | ```diff
diff --git a/drivers/ufs/core/ufs-mcq.c b/drivers/ufs/core/ufs-mcq.c
index c1b1d67a1ddc..13b60a2d06db 100644
--- a/drivers/ufs/core/ufs-mcq.c
+++ b/drivers/ufs/core/ufs-mcq.c
@@ -637,7 +637,7 @@ static bool ufshcd_mcq_sqe_search(struct ufs_hba *hba,
struct ufs_hw_queue *hwq, int task_tag)
{
struct scs... |
c39a9a02bc5d841c116dc03c264eb9ceecde806e | Analyze and fix the following issue in the Linux kernel code: scsi: megaraid_mbox: Avoid double kfree() | Problem Details:
Smatch found a double-free after my recent change:
drivers/scsi/megaraid/megaraid_mbox.c:3474 megaraid_cmm_register()
error: double free of 'adp' (line 3468)
Since the object is no longer allocated in megaraid_cmm_register(),
remove the kfree() as well.
Fixes: c1f7275b613b ("scsi: megaraid_mbox: R... | ```diff
diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c
index 60db48dc8f3a..e572665903d2 100644
--- a/drivers/scsi/megaraid/megaraid_mm.c
+++ b/drivers/scsi/megaraid/megaraid_mm.c
@@ -998,8 +998,6 @@ memalloc_error:
dma_pool_destroy(adapter->pthru_dma_pool);
- kfree(adapter)... |
1b6f03b7ae9ee27054c55bb55a69d05555a78516 | Analyze and fix the following issue in the Linux kernel code: scsi: pm8001: Fix error code in non_fatal_log_show() | Problem Details:
The non_fatal_log_show() function is supposed to return negative error
codes on failure. But because the error codes are saved in a u32 and
then cast to signed long, they end up being high positive values instead
of negative. Remove the intermediary u32 variable to fix this bug.
Fixes: dba2cc03b9db ... | ```diff
diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
index bb38b2d63acb..a27f3287748e 100644
--- a/drivers/scsi/pm8001/pm8001_ctl.c
+++ b/drivers/scsi/pm8001/pm8001_ctl.c
@@ -588,10 +588,7 @@ static DEVICE_ATTR(fatal_log, S_IRUGO, pm8001_ctl_fatal_log_show, NULL);
static ssize_t non... |
06a34d9c1f47b923bb554de25406a5251b047379 | Analyze and fix the following issue in the Linux kernel code: scsi: ufs: core: Skip link param validation when lanes_per_direction is unset | Problem Details:
ufshcd_validate_link_params(), added by commit e72323f3b09f ("scsi: ufs:
core: Configure only active lanes during link"), is called
unconditionally from ufshcd_link_startup() and fails link startup with
-ENOLINK when the connected lane count read from the device differs from
hba->lanes_per_direction.
... | ```diff
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index c1a0a79e386d..1061e20786fa 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -5200,6 +5200,16 @@ static int ufshcd_validate_link_params(struct ufs_hba *hba)
{
int ret, val;
+ /*
+ * lanes_per_direction is only... |
be8fcd4a8217a916344c88a4b1b84f5736dda17e | Analyze and fix the following issue in the Linux kernel code: scsi: sas: Skip opt_sectors when DMA reports no real optimization hint | Problem Details:
sas_host_setup() unconditionally sets shost->opt_sectors from
dma_opt_mapping_size().
When the IOMMU is disabled or in passthrough mode and no DMA ops provide
an opt_mapping_size callback, dma_opt_mapping_size() returns
min(dma_max_mapping_size(), SIZE_MAX) which equals
dma_max_mapping_size() — a hard... | ```diff
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index d8f2377b017f..d689b9ed08a6 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/err.h>
+#include <l... |
38498c0ebacd54dbaac3513a548a13f1a8455c4e | Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Adjust verifier_map_ptr for the map's excl field | Problem Details:
Adding the u32 excl field at offset 32 of struct bpf_map right after the
sha[SHA256_DIGEST_SIZE] hash shifts the ops pointer from offset 32 to 40.
Therefore, fix up the test case.
# LDLIBS=-static PKG_CONFIG='pkg-config --static' ./vmtest.sh -- ./test_progs -t verifier_map_ptr
[...]
#637/1 ver... | ```diff
diff --git a/tools/testing/selftests/bpf/progs/verifier_map_ptr.c b/tools/testing/selftests/bpf/progs/verifier_map_ptr.c
index e2767d27d8aa..d8e822d1a8ba 100644
--- a/tools/testing/selftests/bpf/progs/verifier_map_ptr.c
+++ b/tools/testing/selftests/bpf/progs/verifier_map_ptr.c
@@ -70,13 +70,15 @@ __naked void ... |
60214435b365ecdd40b2f96d4e54564b5c927645 | Analyze and fix the following issue in the Linux kernel code: libbpf: Skip max_entries override on signed loaders | Problem Details:
bpf_gen__map_create() lets the host-supplied loader ctx override a
map's max_entries at runtime (map_desc[idx].max_entries, when non-zero).
This is how the light skeleton sizes maps to the target machine, but
it happens after emit_signature_match() and is covered by neither the
signed loader instructio... | ```diff
diff --git a/tools/lib/bpf/gen_loader.c b/tools/lib/bpf/gen_loader.c
index a5d9c7a5261b..66e13566bc31 100644
--- a/tools/lib/bpf/gen_loader.c
+++ b/tools/lib/bpf/gen_loader.c
@@ -546,13 +546,22 @@ void bpf_gen__map_create(struct bpf_gen *gen,
default:
break;
}
- /* conditionally update max_entries */
- i... |
61e084152328867fe2279cc790573aae39959cd5 | Analyze and fix the following issue in the Linux kernel code: libbpf: Skip initial_value override on signed loaders | Problem Details:
bpf_gen__map_update_elem() emits code that, when the host-supplied
loader ctx provides a non-NULL map_desc[idx].initial_value, overwrites
the blob value with bytes read from the host (bpf_copy_from_user /
bpf_probe_read_kernel) before the BPF_MAP_UPDATE_ELEM that populates
the program's .data/.rodata/.... | ```diff
diff --git a/tools/lib/bpf/gen_loader.c b/tools/lib/bpf/gen_loader.c
index 66a02039da8c..a5d9c7a5261b 100644
--- a/tools/lib/bpf/gen_loader.c
+++ b/tools/lib/bpf/gen_loader.c
@@ -1187,27 +1187,36 @@ void bpf_gen__map_update_elem(struct bpf_gen *gen, int map_idx, void *pvalue,
value = add_data(gen, pvalue, val... |
0fb6c9ed6493b4af01be8bb0a384574eba7df636 | Analyze and fix the following issue in the Linux kernel code: libbpf: Reject non-exclusive metadata maps in the signed loader | Problem Details:
The loader verifies map->sha against the metadata hash in its
instructions. map->sha is calculated when BPF_OBJ_GET_INFO_BY_FD is
called on the frozen map.
While the map is frozen, the /signed loader/ must also ensure the map
is exclusive, as, without exclusivity (which a hostile host could just
omit ... | ```diff
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index c0510d223685..8599b451dd7a 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -296,6 +296,7 @@ struct bpf_map_owner {
struct bpf_map {
u8 sha[SHA256_DIGEST_SIZE];
+ u32 excl;
const struct bpf_map_ops *ops;
struct bpf_map *inner_map... |
9a3c3c49c333760c8944dadacbe114c1884546ef | Analyze and fix the following issue in the Linux kernel code: bpf: Reject exclusive maps as inner maps in map-in-map | Problem Details:
An exclusive map (created with excl_prog_hash) is bound to a single
program by hash: check_map_prog_compatibility() refuses to load any
program whose digest does not match map->excl_prog_sha. That check
only runs for maps a program references directly, i.e. its used_maps.
A map reached at runtime throu... | ```diff
diff --git a/kernel/bpf/map_in_map.c b/kernel/bpf/map_in_map.c
index 645bd30bc9a9..d2cbab4bdf64 100644
--- a/kernel/bpf/map_in_map.c
+++ b/kernel/bpf/map_in_map.c
@@ -20,7 +20,8 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)
/* Does not support >1 level map-in-map */
if (inner_map->inner_map_meta)... |
2eee6fe8ac2cd21e931c009d475e5a8407d42d76 | Analyze and fix the following issue in the Linux kernel code: bpf: Fix dynptr ref counting to scan all call frames | Problem Details:
When checking whether a referenced dynptr can be overwritten,
destroy_if_dynptr_stack_slot only counted sibling dynptrs in the
current call frame. If a clone sharing the same virtual ref parent
existed in a different frame (e.g., passed to a subprog), it would
not be counted, causing the verifier to in... | ```diff
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index caa455fad877..5d8f2656dbfd 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -786,10 +786,29 @@ static void mark_reg_invalid(const struct bpf_verifier_env *env, struct bpf_reg_
__mark_reg_unknown(env, reg);
}
+static int dynp... |
8c292e89bd831c8a13e92f3429ef66bbe0b83677 | Analyze and fix the following issue in the Linux kernel code: scsi: Revert "scsi: Fix sas_user_scan() to handle wildcard and multi-channel scans" | Problem Details:
This reverts commit 37c4e72b0651e7697eb338cd1fb09feef472cc1a.
Said commit causes excessive resource usage and even system freeze with
some controllers, e.g. smartpqi and hisi_sas. The justification provided
by the patch authors [1] was supporting a special mode of the mpi3mr and
mpt3sas, so-called "Tr... | ```diff
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 7e60e3a4bca6..e27da038603a 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1921,7 +1921,7 @@ int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
return 0;
}
-EXPORT_SYMBOL(scsi_scan_host_s... |
57db1307afb1f83d45f5ff53b93f8d040100d13e | Analyze and fix the following issue in the Linux kernel code: scsi: smartpqi: Use shost_to_hba() in pqi_scan_finished() | Problem Details:
shost_to_hba() is used everywhere except to obtain pqi_ctrl_info from
shosti, except in pqi_scan_finished(), where shost_priv() is used. This
causes one pointer dereference to be missed, as shost->hostdata is a
pointer in smartpqi. Fix it.
Fixes: 6c223761eb54 ("smartpqi: initial commit of Microsemi s... | ```diff
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index b4ed991976d0..65ff50982978 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2642,7 +2642,7 @@ static int pqi_scan_finished(struct Scsi_Host *shost,
{
struct pqi_c... |
4a1b1ac2744694a2ecd66a84bdb1445f4ef24bee | Analyze and fix the following issue in the Linux kernel code: RDMA/core: Validate the passed in fops for ib_get_ucaps() | Problem Details:
Sashiko pointed out it is not safe to rely only on the devt because
char/block alias so if the user finds a block device with the same dev_t
it can masquerade as a ucap cdev fd.
Test the f_ops to only accept authentic cdevs.
Link: https://patch.msgid.link/r/0-v1-fd9482545e37+1e25-ib_ucaps_fd_ops_jgg@... | ```diff
diff --git a/drivers/infiniband/core/ucaps.c b/drivers/infiniband/core/ucaps.c
index 948093260dbd..5155ff0e538e 100644
--- a/drivers/infiniband/core/ucaps.c
+++ b/drivers/infiniband/core/ucaps.c
@@ -82,14 +82,12 @@ static int get_ucap_from_devt(dev_t devt, u64 *idx_mask)
static int get_devt_from_fd(unsigned ... |
5057e1aca011e51ef51498c940ef96f3d3e8a305 | Analyze and fix the following issue in the Linux kernel code: net/sched: act_api: use RCU with deferred freeing for action lifecycle | Problem Details:
When NEWTFILTER and DELFILTER are run concurrently it is possible to create a
race with an associated action.
Let's illustrate with CPU0 running NEWTFILTER and CPU1 running DELFILTER:
0: mutex_lock() <-- holds the idr lock
0: rcu_read_lock()
0: p = idr_find(idr, index) <-- action p is valid (RCU p... | ```diff
diff --git a/include/net/act_api.h b/include/net/act_api.h
index d11b79107930..fd2967ee08f7 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -45,6 +45,7 @@ struct tc_action {
struct tc_cookie __rcu *user_cookie;
struct tcf_chain __rcu *goto_chain;
u32 tcfa_flags;
+ struct rcu_head ... |
4490516d2109e105daf732681435c5c075b5d61b | Analyze and fix the following issue in the Linux kernel code: tcp_bbr: fix SPDX-License-Identifier to be GPL-2.0 OR BSD-3-Clause | Problem Details:
Since TCP BBR congestion control was introduced in
commit 0f8782ea1497 ("tcp_bbr: add BBR congestion control")
it has always been offered as "Dual BSD/GPL":
MODULE_LICENSE("Dual BSD/GPL");
A GPL-2.0-only SPDX header was erroneously added in the recent
commit 2ed4b46b4fc7 ("net: Add SPDX ids to some... | ```diff
diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c
index aec7805b1d37..82378a2bfd1e 100644
--- a/net/ipv4/tcp_bbr.c
+++ b/net/ipv4/tcp_bbr.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0
+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/* Bottleneck Bandwidth and RTT (BBR) congestion control
*
... |
cd1a8d788763bb6c0af3c53fbbd9abb555e18953 | Analyze and fix the following issue in the Linux kernel code: dax/bus: Upgrade resource conflict message to dev_err() in alloc_dax_region() | Problem Details:
The dax_region resource conflict in alloc_dax_region() indicates a
serious configuration problem — two subsystems (e.g. dax_hmem and
dax_cxl) are attempting to register overlapping address ranges. This is
not a transient or debug-level condition; it represents a genuine
resource conflict that an admini... | ```diff
diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index ccfe65004888..b809e1a264af 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -670,7 +670,7 @@ struct dax_region *alloc_dax_region(struct device *parent, int region_id,
rc = request_resource(&dax_regions, &dax_region->res);
if (rc) {
- dev_d... |
1a6b6442a982d0ca5fb6a1a39b6f6dfd760eda57 | Analyze and fix the following issue in the Linux kernel code: nvdimm/btt: Free arenas on btt_init() error paths | Problem Details:
The arenas allocated by discover_arenas() or create_arenas() are not
freed on some error paths in btt_init(). This leaks memory when BTT
initialization fails.
Call free_arenas() from the affected error paths to release the
allocations.
[ as: commit message and log edits ]
Fixes: 5212e11fde4d ("nd_bt... | ```diff
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index e0b6a85a8124..7e1112960d7f 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -1592,7 +1592,7 @@ static struct btt *btt_init(struct nd_btt *nd_btt, unsigned long long rawsize,
if (btt->init_state != INIT_READY && nd_region->ro) {
d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.