mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+78eccfb8b3c9a85fc6c5@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
	perex@perex.cz, syzkaller-bugs@googlegroups.com, tiwai@suse.com
Subject: [PATCH] ALSA: line6: init buf to zero
Date: Wed, 24 Jul 2024 13:58:45 +0800	[thread overview]
Message-ID: <tencent_6ECFD36FE36EC96283A5C4587761F76F8605@qq.com> (raw)
In-Reply-To: <00000000000000949c061df288c5@google.com>

Syzbot report KMSAN uninit-value warnings.
When alloc buffer for midi_buffer->buf, init mem to 0.

Reported-and-tested-by: syzbot+78eccfb8b3c9a85fc6c5@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=78eccfb8b3c9a85fc6c5
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
 sound/usb/line6/midibuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/line6/midibuf.c b/sound/usb/line6/midibuf.c
index e7f830f7526c..1b699cb3b38d 100644
--- a/sound/usb/line6/midibuf.c
+++ b/sound/usb/line6/midibuf.c
@@ -48,7 +48,7 @@ void line6_midibuf_reset(struct midi_buffer *this)
 
 int line6_midibuf_init(struct midi_buffer *this, int size, int split)
 {
-	this->buf = kmalloc(size, GFP_KERNEL);
+	this->buf = kzalloc(size, GFP_KERNEL);
 
 	if (this->buf == NULL)
 		return -ENOMEM;
-- 
2.43.0


  parent reply	other threads:[~2024-07-24  6:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23 23:29 [syzbot] [sound?] KMSAN: uninit-value in line6_midibuf_read syzbot
2024-07-24  0:56 ` Edward Adam Davis
2024-07-24  1:37   ` syzbot
2024-07-24  5:58 ` Edward Adam Davis [this message]
2024-07-24  7:22   ` [PATCH] ALSA: line6: init buf to zero Takashi Iwai

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_6ECFD36FE36EC96283A5C4587761F76F8605@qq.com \
    --to=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=syzbot+78eccfb8b3c9a85fc6c5@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tiwai@suse.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®