All of lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+09b349b3066c2e0b1e96@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] [syzbot] [nfs?] KMSAN: kernel-infoleak in sys_name_to_handle_at (4)
Date: Thu, 18 Jan 2024 08:45:48 -0800	[thread overview]
Message-ID: <0000000000007ed418060f3b1822@google.com> (raw)
In-Reply-To: <000000000000e3d83a060ee5285a@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: [syzbot] [nfs?] KMSAN: kernel-infoleak in sys_name_to_handle_at (4)
Author: n.zhandarovich@fintech.ru

Try using kzalloc() instead of kmalloc() in do_sys_name_to_handle()

#syz test: https://github.com/google/kmsan.git master

---
 fs/fhandle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fhandle.c b/fs/fhandle.c
index 18b3ba8dc8ea..57a12614addf 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -36,7 +36,7 @@ static long do_sys_name_to_handle(const struct path *path,
 	if (f_handle.handle_bytes > MAX_HANDLE_SZ)
 		return -EINVAL;
 
-	handle = kmalloc(sizeof(struct file_handle) + f_handle.handle_bytes,
+	handle = kzalloc(sizeof(struct file_handle) + f_handle.handle_bytes,
 			 GFP_KERNEL);
 	if (!handle)
 		return -ENOMEM;
-- 
2.25.1


      parent reply	other threads:[~2024-01-18 16:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-14 10:14 [syzbot] [nfs?] KMSAN: kernel-infoleak in sys_name_to_handle_at (4) syzbot
2024-01-16 15:07 ` Chuck Lever III
2024-01-16 17:21   ` Amir Goldstein
2024-01-18 16:45 ` syzbot [this message]

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=0000000000007ed418060f3b1822@google.com \
    --to=syzbot+09b349b3066c2e0b1e96@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.