From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0396413CF93; Tue, 14 May 2024 11:40:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715686801; cv=none; b=GdG+TJSgbf+GGWRvqSgDHHlIhaieSgG9HY6G+IMYdqfjHgndEjC6ssAlHvzT3bhBHa9W8W7GVJ6b7L0p+nY8Cnt7mX2S5E6Fz4H2NnLgLusp7bLkMbiFFPl7sxshFK49RA7y06D+EjuDjROTfxJWjDn6VBQ5xRtD8O3Aajt+ziU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715686801; c=relaxed/simple; bh=qAjMEo/6jEjJgWbLBDSX+UFORDCwwq7rETOoH66/FeA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VULvg2evwo4ppN/RrPE6DxLNELa0mEJ8Q7jizVMeFpD2jjdpdJ9pvHrYC0fr4sq/G7mZLWNNd/Bcn50d4eWCDusAUPOYVawG5g8whUIaWckKzVblQ88bDfEcuDGqgCIrj4e+VK3iVlguju41wHw14gj6I/L+Guc8fSpnWgDRi7c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=E7lyG/cN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="E7lyG/cN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F16FC2BD10; Tue, 14 May 2024 11:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715686800; bh=qAjMEo/6jEjJgWbLBDSX+UFORDCwwq7rETOoH66/FeA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E7lyG/cNTipEXvTKY6UWzMdanWfAdtQVcJQtuYN6kIe1oiFUMMMJp3goQ489eBwtW uZ6PDWMDe2sRbM6tccKZc3iQT95qBgmOHWKDpcXpH5VXetPyD9VY7Mp9AojqB9BGIR /PqyxPRzoMLWaSJvuIaYcYMZLS7Y+tQRuUnOcED0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+7fb05ccf7b3d2f9617b3@syzkaller.appspotmail.com, Takashi Iwai , Sasha Levin Subject: [PATCH 4.19 27/63] ALSA: line6: Zero-initialize message buffers Date: Tue, 14 May 2024 12:19:48 +0200 Message-ID: <20240514100949.043118044@linuxfoundation.org> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240514100948.010148088@linuxfoundation.org> References: <20240514100948.010148088@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai [ Upstream commit c4e51e424e2c772ce1836912a8b0b87cd61bc9d5 ] For shutting up spurious KMSAN uninit-value warnings, just replace kmalloc() calls with kzalloc() for the buffers used for communications. There should be no real issue with the original code, but it's still better to cover. Reported-by: syzbot+7fb05ccf7b3d2f9617b3@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/00000000000084b18706150bcca5@google.com Message-ID: <20240402063628.26609-1-tiwai@suse.de> Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/usb/line6/driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c index 2399d500b8812..8970d4b3b42c3 100644 --- a/sound/usb/line6/driver.c +++ b/sound/usb/line6/driver.c @@ -216,7 +216,7 @@ int line6_send_raw_message_async(struct usb_line6 *line6, const char *buffer, struct urb *urb; /* create message: */ - msg = kmalloc(sizeof(struct message), GFP_ATOMIC); + msg = kzalloc(sizeof(struct message), GFP_ATOMIC); if (msg == NULL) return -ENOMEM; @@ -694,7 +694,7 @@ static int line6_init_cap_control(struct usb_line6 *line6) int ret; /* initialize USB buffers: */ - line6->buffer_listen = kmalloc(LINE6_BUFSIZE_LISTEN, GFP_KERNEL); + line6->buffer_listen = kzalloc(LINE6_BUFSIZE_LISTEN, GFP_KERNEL); if (!line6->buffer_listen) return -ENOMEM; @@ -703,7 +703,7 @@ static int line6_init_cap_control(struct usb_line6 *line6) return -ENOMEM; if (line6->properties->capabilities & LINE6_CAP_CONTROL_MIDI) { - line6->buffer_message = kmalloc(LINE6_MIDI_MESSAGE_MAXLEN, GFP_KERNEL); + line6->buffer_message = kzalloc(LINE6_MIDI_MESSAGE_MAXLEN, GFP_KERNEL); if (!line6->buffer_message) return -ENOMEM; -- 2.43.0