Skip to content

Commit f3eef46

Browse files
Zubin Mithratiwai
authored andcommitted
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: a9960e6 ("ALSA: pcm: fix fifo_size frame calculation") Signed-off-by: Zubin Mithra <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 93ab3ea commit f3eef46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/core/pcm_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ static int snd_pcm_lib_ioctl_fifo_size(struct snd_pcm_substream *substream,
17461746
channels = params_channels(params);
17471747
frame_size = snd_pcm_format_size(format, channels);
17481748
if (frame_size > 0)
1749-
params->fifo_size /= (unsigned)frame_size;
1749+
params->fifo_size /= frame_size;
17501750
}
17511751
return 0;
17521752
}

0 commit comments

Comments
 (0)