[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6974bf21.a00a0220.33ccc7.0009.GAE@google.com>
Date: Sat, 24 Jan 2026 04:46:25 -0800
From: syzbot <syzbot+df28076a30d726933015@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Forwarded: [PATCH] iommufd: Initialize batch->kind in batch_clear()
For archival purposes, forwarding an incoming command email to
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com.
***
Subject: [PATCH] iommufd: Initialize batch->kind in batch_clear()
Author: kartikey406@...il.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
KMSAN reported an uninitialized value when batch_add_pfn_num() reads
batch->kind. This occurs because batch_clear() does not initialize
the kind field, leaving it with garbage data when a struct pfn_batch
is declared on the stack.
When batch_add_pfn_num() checks "if (batch->kind != kind)", it reads
this uninitialized value, triggering KMSAN warnings.
Initialize batch->kind to zero in batch_clear() to ensure the field
always starts in a known state.
Reported-by: syzbot+df28076a30d726933015@...kaller.appspotmail.com
Signed-off-by: Deepanshu Kartikey <kartikey406@...il.com>
---
drivers/iommu/iommufd/pages.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iommu/iommufd/pages.c b/drivers/iommu/iommufd/pages.c
index dbe51ecb9a20..f606148920fa 100644
--- a/drivers/iommu/iommufd/pages.c
+++ b/drivers/iommu/iommufd/pages.c
@@ -289,6 +289,7 @@ static void batch_clear(struct pfn_batch *batch)
batch->end = 0;
batch->pfns[0] = 0;
batch->npfns[0] = 0;
+ batch->kind = 0;
}
/*
--
2.43.0
Powered by blists - more mailing lists