summaryrefslogtreecommitdiff
path: root/sound/usb/usx2y/usbus428ctldefs.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-05-17 16:15:38 +0300
committerTakashi Iwai <tiwai@suse.de>2021-05-17 17:04:10 +0300
commit4e268db74770b454b877ab5260f1868a457d212c (patch)
treed739e23399bb1edb4774a6b005ceaab388f33ded /sound/usb/usx2y/usbus428ctldefs.h
parenta829dd5b3840fd9a24608ed73eb21ba239ae5334 (diff)
downloadlinux-4e268db74770b454b877ab5260f1868a457d212c.tar.xz
ALSA: usx2y: Fix potential leaks of uninitialized memory
usx2y drivers may expose the allocated pages via mmap, but it performs zero-clear only for the struct size, not aligned with the page size. This leaves out some uninitialized trailing bytes. This patch fixes the clearance to cover all memory that are exposed to user-space. Link: https://lore.kernel.org/r/20210517131545.27252-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usx2y/usbus428ctldefs.h')
-rw-r--r--sound/usb/usx2y/usbus428ctldefs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/usb/usx2y/usbus428ctldefs.h b/sound/usb/usx2y/usbus428ctldefs.h
index 06b27d23d3c2..9ba15d974e63 100644
--- a/sound/usb/usx2y/usbus428ctldefs.h
+++ b/sound/usb/usx2y/usbus428ctldefs.h
@@ -89,3 +89,5 @@ struct us428ctls_sharedmem {
struct us428_p4out p4out[N_US428_P4OUT_BUFS];
int p4out_last, p4out_sent;
};
+
+#define US428_SHAREDMEM_PAGES PAGE_ALIGN(sizeof(struct us428ctls_sharedmem))