[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6972b3f6.a70a0220.35de72.0001.GAE@google.com>
Date: Thu, 22 Jan 2026 15:34:14 -0800
From: syzbot <syzbot+d80abb5b890d39261e72@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Forwarded: [PATCH] hfsplus: add debug printk to show partial reads in hfs_brec_read
For archival purposes, forwarding an incoming command email to
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com.
***
Subject: [PATCH] hfsplus: add debug printk to show partial reads in hfs_brec_read
Author: kartikey406@...il.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
Debug patch to demonstrate how hfs_brec_read() can read less data than
requested when filesystem is corrupted, leaving uninitialized data in
the destination buffer.
NOT-FOR-MERGE: debug only
Link: https://syzkaller.appspot.com/bug?extid=d80abb5b890d39261e72
Signed-off-by: Deepanshu Kartikey <kartikey406@...il.com>
---
fs/hfsplus/bfind.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/fs/hfsplus/bfind.c b/fs/hfsplus/bfind.c
index 336d654861c5..9b89dce00ee9 100644
--- a/fs/hfsplus/bfind.c
+++ b/fs/hfsplus/bfind.c
@@ -217,9 +217,19 @@ int hfs_brec_read(struct hfs_find_data *fd, void *rec, u32 rec_len)
res = hfs_brec_find(fd, hfs_find_rec_by_key);
if (res)
return res;
- if (fd->entrylength > rec_len)
+ printk(KERN_ALERT "HFSPLUS_BREC_READ: rec_len=%u, fd->entrylength=%u\n",rec_len, fd->entrylength);
+ if (fd->entrylength > rec_len) {
+ printk(KERN_ALERT "HFSPLUS_BREC_READ: ERROR - entrylength > rec_len\n");
return -EINVAL;
+ }
+
+ if (fd->entrylength < rec_len) {
+ printk(KERN_ALERT "HFSPLUS_BREC_READ: WARNING - entrylength (%u) < rec_len (%u) - PARTIAL READ!\n",fd->entrylength, rec_len);
+ }
+
hfs_bnode_read(fd->bnode, rec, fd->entryoffset, fd->entrylength);
+
+ printk(KERN_ALERT "HFSPLUS_BREC_READ: Successfully read %u bytes (expected %u)\n",fd->entrylength, rec_len);
return 0;
}
--
2.43.0
Powered by blists - more mailing lists