mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+efde959319469ff8d4d7@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [hfs?] KMSAN: uninit-value in copy_name
Date: Tue, 21 May 2024 08:40:32 +0800	[thread overview]
Message-ID: <tencent_CAB0DDA2192E4FE30DA8A5990DFD923A5D07@qq.com> (raw)
In-Reply-To: <00000000000037162f0618b6fefb@google.com>

please test uiv in copy_name

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a5131c3fdf26

diff --git a/fs/hfsplus/unicode.c b/fs/hfsplus/unicode.c
index 73342c925a4b..8e97df12375d 100644
--- a/fs/hfsplus/unicode.c
+++ b/fs/hfsplus/unicode.c
@@ -234,6 +234,7 @@ int hfsplus_uni2asc(struct super_block *sb,
 		}
 done:
 		res = nls->uni2char(cc, op, len);
+		printk("res: %d, cc: %d, op:%p, len: %d, ustrlen: %d, %s\n", res, cc, op, len, ustrlen, __func__);
 		if (res < 0) {
 			if (res == -ENAMETOOLONG)
 				goto out;
diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c
index 9c9ff6b8c6f7..a02903a929a6 100644
--- a/fs/hfsplus/xattr.c
+++ b/fs/hfsplus/xattr.c
@@ -733,14 +733,16 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size)
 			goto end_listxattr;
 
 		xattr_name_len = NLS_MAX_CHARSET_SIZE * HFSPLUS_ATTR_MAX_STRLEN;
+		printk("1sb: %p, xnl: %d, %s\n", strbuf, xattr_name_len, __func__);
 		if (hfsplus_uni2asc(inode->i_sb,
 			(const struct hfsplus_unistr *)&fd.key->attr.key_name,
-					strbuf, &xattr_name_len)) {
+					strbuf, &xattr_name_len) || !xattr_name_len) {
 			pr_err("unicode conversion failed\n");
 			res = -EIO;
 			goto end_listxattr;
 		}
 
+		printk("3s:%d, buf:%p, res:%d, sb: %s, xnl: %d, %s\n", size, buffer, res, strbuf, xattr_name_len, __func__);
 		if (!buffer || !size) {
 			if (can_list(strbuf))
 				res += name_len(strbuf, xattr_name_len);


  reply	other threads:[~2024-05-21  0:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-18  9:21 syzbot
2024-05-21  0:40 ` Edward Adam Davis [this message]
2024-05-21  3:10   ` syzbot
2024-05-21  3:45 ` Edward Adam Davis
2024-05-21  4:21   ` syzbot
2024-05-21  5:21 ` [PATCH] hfsplus: fix " Edward Adam Davis
2024-07-04 13:36   ` Dmitry Vyukov
2024-07-05 13:46     ` Edward Adam Davis
2024-07-05 21:20   ` Kees Cook
2024-07-06  7:20     ` Christian Brauner
2024-07-08  6:52       ` Dmitry Vyukov
2024-07-08 19:20       ` Kees Cook

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=tencent_CAB0DDA2192E4FE30DA8A5990DFD923A5D07@qq.com \
    --to=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+efde959319469ff8d4d7@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®