Commit f3eef46f authored by Zubin Mithra's avatar Zubin Mithra Committed by Takashi Iwai
Browse files

ALSA: pcm: fix divide error in snd_pcm_lib_ioctl

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: a9960e6a

 ("ALSA: pcm: fix fifo_size frame calculation")
Signed-off-by: default avatarZubin Mithra <zsm@chromium.org>
Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210827153735.789452-1-zsm@chromium.org

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 93ab3eaf
...@@ -1746,7 +1746,7 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream, ...@@ -1746,7 +1746,7 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream,
channels = params_channels(params); channels = params_channels(params);
frame_size = snd_pcm_format_size(format, channels); frame_size = snd_pcm_format_size(format, channels);
if (frame_size > 0) if (frame_size > 0)
params->fifo_size /= (unsigned)frame_size; params->fifo_size /= frame_size;
} }
return 0; return 0;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment