From: Gianfranco Trad <gianf.trad@gmail.com>
To: syzbot <syzbot+d395b0c369e492a17530@syzkaller.appspotmail.com>,
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [hfs?] KMSAN: uninit-value in __hfs_ext_cache_extent (2)
Date: Tue, 22 Oct 2024 19:05:39 +0200 [thread overview]
Message-ID: <aa391b1b-ab60-443e-80b2-06698707f8d8@gmail.com> (raw)
In-Reply-To: <6717ca24.050a0220.10f4f4.0150.GAE@google.com>
[-- Attachment #1: Type: text/plain, Size: 74 bytes --]
#syz test
// test if KMSAN bug was truly fixed and only BUG() happens now
[-- Attachment #2: 0001-hfs-zero-initialize-ptr-handle-no-root-and-comment-B.patch --]
[-- Type: text/x-patch, Size: 1758 bytes --]
From 006092e8500107e41704cc4c13268a8d3a91deb6 Mon Sep 17 00:00:00 2001
From: Gianfranco Trad <gianf.trad@gmail.com>
Date: Tue, 22 Oct 2024 19:01:55 +0200
Subject: [PATCH] hfs: zero-initialize ptr, handle no root and comment BUG()
Signed-off-by: Gianfranco Trad <gianf.trad@gmail.com>
---
fs/hfs/bfind.c | 2 +-
fs/hfs/extent.c | 2 ++
fs/hfs/inode.c | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/hfs/bfind.c b/fs/hfs/bfind.c
index ef9498a6e88a..c74d864bc29e 100644
--- a/fs/hfs/bfind.c
+++ b/fs/hfs/bfind.c
@@ -18,7 +18,7 @@ int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd)
fd->tree = tree;
fd->bnode = NULL;
- ptr = kmalloc(tree->max_key_len * 2 + 4, GFP_KERNEL);
+ ptr = kzalloc(tree->max_key_len * 2 + 4, GFP_KERNEL);
if (!ptr)
return -ENOMEM;
fd->search_key = ptr;
diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c
index 4a0ce131e233..14fd0a7bca14 100644
--- a/fs/hfs/extent.c
+++ b/fs/hfs/extent.c
@@ -160,6 +160,8 @@ static inline int __hfs_ext_read_extent(struct hfs_find_data *fd, struct hfs_ext
if (fd->key->ext.FNum != fd->search_key->ext.FNum ||
fd->key->ext.FkType != fd->search_key->ext.FkType)
return -ENOENT;
+ if (!fd->tree->root && res == -ENOENT)
+ return -ENOENT;
if (fd->entrylength != sizeof(hfs_extent_rec))
return -EIO;
hfs_bnode_read(fd->bnode, extent, fd->entryoffset, sizeof(hfs_extent_rec));
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index a81ce7a740b9..a3bc43dbbe14 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -441,7 +441,7 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc)
hfs_btree_write(HFS_SB(inode->i_sb)->cat_tree);
return 0;
default:
- BUG();
+ //BUG();
return -EIO;
}
}
--
2.43.0
next prev parent reply other threads:[~2024-10-22 17:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3b0be684-0b50-4151-a275-0751715d1be8@gmail.com>
2024-10-22 15:52 ` syzbot
2024-10-22 17:05 ` Gianfranco Trad [this message]
2024-10-22 17:31 ` syzbot
[not found] <d703694c-a0a7-480b-bafa-c8703306d2f5@gmail.com>
2024-11-13 0:26 ` syzbot
[not found] <9be1baa3-d2f4-4e20-9f13-c6c12f0813dc@gmail.com>
2024-11-11 21:10 ` syzbot
[not found] <CAN=OONzCeRjbK6TbqenTyjYSpPh4f1-5UmrzeYcW2anq80P_EA@mail.gmail.com>
2024-11-06 6:52 ` syzbot
[not found] <CAN=OONw=P_=3i7RSj67ZqW++8wcrmzuE-oN_fwjS7aR1t_B94g@mail.gmail.com>
2024-11-06 3:57 ` syzbot
[not found] <CAN=OONwWNfETusinz2A7yGG2OFtS8Nnn8z9FhUTpPuugHKnMkw@mail.gmail.com>
2024-11-05 21:12 ` syzbot
[not found] <CAN=OONzfDPeFZ-BnRd53psEUgv2-wLFxq299SLLK9UqG_iZ4NA@mail.gmail.com>
2024-11-05 10:25 ` syzbot
[not found] <CAHiZj8j_3jKyqB=_KB9ctK_hYu_gS6nn0VtDokTrnJ=4P9OGWw@mail.gmail.com>
2024-10-02 7:34 ` syzbot
[not found] <CAHiZj8gaK1pvOZzxndtb8KTCMoj=UczhHv6_f6ogbMtOU7HdPQ@mail.gmail.com>
2024-10-01 22:35 ` syzbot
2024-10-01 9:27 syzbot
2024-10-10 13:41 ` Qianqiang Liu
2024-10-10 14:16 ` syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa391b1b-ab60-443e-80b2-06698707f8d8@gmail.com \
--to=gianf.trad@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+d395b0c369e492a17530@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®