linux/sound/firewire
Takashi Sakamoto 31ea49baa1 ALSA: firewire-lib: fix buffer-over-run when detecting packet discontinuity
When detecting packet discontinuity, handle_in_packet() returns minus value
and this value is assigned to unsigned int variable, then the variable has
huge value. As a result, the variable causes buffer-over-run in
handle_out_packet(). This brings invalid page request and system hangup.

This commit fixes the bug to add a new argument into handle_in_packet()
and the number of handled data blocks is assignd to it. The function
return value is just used to check error.

I also considered to change the type of local variable to 'int' in
in_stream_callback(). This idea is based on type-conversion in C standard,
while it may cause future problems when adding more works. Thus, I dropped
this idea.

Fixes: 6fc6b9ce41c6('ALSA: firewire-lib: pass the number of data blocks in incoming packets to outgoing packets')
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-05-27 17:44:42 +02:00
..
bebob ALSA: bebob: add Digidesign Mbox 2 Pro support 2015-05-24 17:31:11 +02:00
dice Revert "ALSA: dice: fix wrong offsets for Dice interface" 2015-03-10 15:26:25 +01:00
fireworks ALSA: firewire: Fix trivial typos in comments 2015-03-10 12:40:30 +01:00
oxfw ALSA: firewire-lib: add buffer-over-run protection at receiving more data blocks than expected 2015-05-23 09:13:18 +02:00
amdtp.c ALSA: firewire-lib: fix buffer-over-run when detecting packet discontinuity 2015-05-27 17:44:42 +02:00
amdtp.h ALSA: firewire-lib: add buffer-over-run protection at receiving more data blocks than expected 2015-05-23 09:13:18 +02:00
cmp.c ALSA: firewire-lib: fix kerneldoc errors 2014-11-18 18:10:23 +01:00
cmp.h ALSA: firewire-lib: Add a new function to check others' connection 2014-05-26 14:22:46 +02:00
fcp.c ALSA: firewire-lib: Remove a comment about restriction of asynchronous operation 2014-06-03 08:14:21 +02:00
fcp.h ALSA: firewire-lib: Add some AV/C general commands 2014-05-26 14:23:13 +02:00
isight.c ALSA: pcm: Add snd_pcm_stop_xrun() helper 2014-11-09 18:20:40 +01:00
iso-resources.c ALSA: firewire-lib: leave unit reference counting completely 2015-03-10 15:27:19 +01:00
iso-resources.h
Kconfig ALSA: bebob: add Digidesign Mbox 2 Pro support 2015-05-24 17:31:11 +02:00
lib.c ALSA: firewire: extend snd_fw_transaction() 2013-10-20 22:07:57 +02:00
lib.h ALSA: firewire: extend snd_fw_transaction() 2013-10-20 22:07:57 +02:00
Makefile ALSA: oxfw: Move to its own directory 2014-11-29 20:21:43 +01:00
packets-buffer.c sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed 2011-10-31 19:31:22 -04:00
packets-buffer.h
scs1x.c ALSA: firewire: Convert to snd_card_new() with a device pointer 2014-02-14 08:13:31 +01:00