ALSA: seq: Fix snd_seq_expand_var_event() call to user-space
authorTakashi Iwai <tiwai@suse.de>
Tue, 5 Sep 2023 08:12:10 +0000 (10:12 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 5 Sep 2023 08:13:46 +0000 (10:13 +0200)
commit86496fd4a2fabb7c978fdaca2d4b718207a96d36
treee460ea9fbcdcdbc864fdce8a84cada363352191d
parentb1757fa30ef14f254f4719bf6f7d54a4c8207216
ALSA: seq: Fix snd_seq_expand_var_event() call to user-space

The recent fix to clear the padding bytes at
snd_seq_expand_var_event() broke the read to user-space with
in_kernel=0 parameter.  For user-space address, it has to use
clear_user() instead of memset().

Fixes: f80e6d60d677 ("ALSA: seq: Clear padded bytes at expanding events")
Reported-and-tested-by: Ash Holland <ash@sorrel.sh>
Closes: https://lore.kernel.org/r/8a555319-9f31-4ea2-878f-adc338bc40d4@sorrel.sh
Link: https://lore.kernel.org/r/20230905052631.18240-1-tiwai@suse.de
Link: https://lore.kernel.org/r/20230905081210.6731-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_memory.c