linux/sound/firewire
Geert Uytterhoeven 9f65df9c58 ALSA: firewire-tascam: Fix integer overflow in midi_port_work()
As snd_fw_async_midi_port.consume_bytes is unsigned int, and
NSEC_PER_SEC is 1000000000L, the second multiplication in

    port->consume_bytes * 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 port->consume_bytes <= 16777.

Fixes: 531f471834 ("ALSA: firewire-lib/firewire-tascam: localize async midi port")
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-3-geert+renesas@glider.be
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-12 14:57:38 +01:00
..
bebob ALSA: bebob: potential info leak in hwdep_read() 2020-10-07 17:33:52 +02:00
dice Merge branch 'for-linus' into for-next 2020-01-20 11:44:51 +01:00
digi00x ALSA: firewire-digi00x: exclude Avid Adrenaline from detection 2020-08-23 10:01:03 +02:00
fireface ALSA: fireface: Fix integer overflow in transmit_midi_msg() 2021-01-12 14:57:29 +01:00
fireworks ALSA: firewire: Clean up a locking issue in copy_resp_to_buf() 2020-11-13 18:37:22 +01:00
motu ALSA: firewire-motu: wait for notification when changing clock configuration for protocol v3 2020-06-15 15:59:19 +02:00
oxfw ALSA: oxfw: fix for Stanton SCS.1d 2020-01-13 10:42:27 +01:00
tascam ALSA: firewire-tascam: Fix integer overflow in midi_port_work() 2021-01-12 14:57:38 +01:00
Kconfig ALSA: firewire-motu: fulfill missing entries in Kconfig 2020-05-11 09:12:06 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
amdtp-am824.c ALSA: firewire-lib: fix invalid assignment to union data for directional parameter 2020-05-08 09:42:21 +02:00
amdtp-am824.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
amdtp-stream-trace.h ALSA: firewire-lib: fix 'function sizeof not defined' error of tracepoints format 2020-05-03 09:24:44 +02:00
amdtp-stream.c ALSA: firewire: Replace tasklet with work 2020-09-11 18:22:54 +02:00
amdtp-stream.h ALSA: firewire: fix comparison to bool warning 2020-11-10 09:06:10 +01:00
cmp.c ALSA: firewire: fix kernel-doc 2020-07-07 12:09:32 +02:00
cmp.h ALSA: firewire-lib: split allocation of isochronous resources from establishment of connection 2019-06-17 08:18:36 +02:00
fcp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345 2019-06-05 17:37:08 +02:00
fcp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
isight.c ALSA: firewire: Drop superfluous ioctl PCM ops 2019-12-11 07:25:27 +01:00
iso-resources.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345 2019-06-05 17:37:08 +02:00
iso-resources.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lib.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345 2019-06-05 17:37:08 +02:00
lib.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
packets-buffer.c ALSA: firewire: fix a memory leak bug 2019-08-08 11:12:26 +02:00
packets-buffer.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00