diff options
author | Zubin Mithra <zsm@chromium.org> | 2021-08-27 08:37:35 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-12 08:56:40 +0200 |
commit | 417b11d3255c58cc2c33a74cf588d42a8cefbf95 (patch) | |
tree | 0555246a79cebf7bfa2def6edbcb0ab6b91f5347 | |
parent | cf28619cd9c60ee72a65ec4d4452aa9fe703b760 (diff) | |
download | linux-stable-417b11d3255c58cc2c33a74cf588d42a8cefbf95.tar.gz linux-stable-417b11d3255c58cc2c33a74cf588d42a8cefbf95.tar.bz2 linux-stable-417b11d3255c58cc2c33a74cf588d42a8cefbf95.zip |
ALSA: pcm: fix divide error in snd_pcm_lib_ioctl
commit f3eef46f0518a2b32ca1244015820c35a22cfe4a upstream.
Syzkaller reported a divide error in snd_pcm_lib_ioctl. fifo_size
is of type snd_pcm_uframes_t(unsigned long). If frame_size
is 0x100000000, the error occurs.
Fixes: a9960e6a293e ("ALSA: pcm: fix fifo_size frame calculation")
Signed-off-by: Zubin Mithra <zsm@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210827153735.789452-1-zsm@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | sound/core/pcm_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 1662573a4030..fd300c3addde 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -1736,7 +1736,7 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream, channels = params_channels(params); frame_size = snd_pcm_format_size(format, channels); if (frame_size > 0) - params->fifo_size /= (unsigned)frame_size; + params->fifo_size /= frame_size; } return 0; } |