* [PATCH] ALSA: rawmidi: fix infoleak in snd_rawmidi_ioctl_status_compat64
@ 2022-11-22 20:08 Xiaolong Huang
0 siblings, 0 replies; only message in thread
From: Xiaolong Huang @ 2022-11-22 20:08 UTC (permalink / raw)
To: perex, tiwai; +Cc: Xiaolong Huang, alsa-devel, linux-kernel
The compat_status is declared off of the stack, so it needs to
be zeroed out before copied back to userspace to prevent any
unintentional data leakage.
Signed-off-by: Xiaolong Huang <butterflyhuangxx@gmail.com>
---
sound/core/rawmidi_compat.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/core/rawmidi_compat.c b/sound/core/rawmidi_compat.c
index 68a93443583c..6afa68165b17 100644
--- a/sound/core/rawmidi_compat.c
+++ b/sound/core/rawmidi_compat.c
@@ -80,6 +80,7 @@ static int snd_rawmidi_ioctl_status_compat64(struct snd_rawmidi_file *rfile,
if (err < 0)
return err;
+ memset(&compat_status, 0, sizeof(compat_status));
compat_status = (struct compat_snd_rawmidi_status64) {
.stream = status.stream,
.tstamp_sec = status.tstamp_sec,
base-commit: eb7081409f94a9a8608593d0fb63a1aa3d6f95d8
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-22 20:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-22 20:08 [PATCH] ALSA: rawmidi: fix infoleak in snd_rawmidi_ioctl_status_compat64 Xiaolong Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).