linux-stable/sound/firewire
Geert Uytterhoeven 92f72f2c8e ALSA: fireface: Fix integer overflow in transmit_midi_msg()
commit e7c22eeaff upstream.

As snd_ff.rx_bytes[] is unsigned int, and NSEC_PER_SEC is 1000000000L,
the second multiplication in

    ff->rx_bytes[port] * 8 * NSEC_PER_SEC / 31250

always overflows on 32-bit platforms, truncating the result.  Fix this
by precalculating "NSEC_PER_SEC / 31250", which is an integer constant.

Note that this assumes ff->rx_bytes[port] <= 16777.

Fixes: 1917429578 ("ALSA: fireface: add transaction support")
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210111130251.361335-2-geert+renesas@glider.be
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-23 15:48:45 +01:00
..
bebob ALSA: bebob: potential info leak in hwdep_read() 2020-10-29 09:06:59 +01:00
dice
digi00x
fireface ALSA: fireface: Fix integer overflow in transmit_midi_msg() 2021-01-23 15:48:45 +01:00
fireworks
motu
oxfw
tascam ALSA: firewire-tascam: Fix integer overflow in midi_port_work() 2021-01-23 15:48:45 +01:00
amdtp-am824.c
amdtp-am824.h
amdtp-stream-trace.h
amdtp-stream.c
amdtp-stream.h
cmp.c
cmp.h
fcp.c
fcp.h
isight.c
iso-resources.c
iso-resources.h
Kconfig
lib.c
lib.h
Makefile
packets-buffer.c
packets-buffer.h