]> git.karo-electronics.de Git - karo-tx-linux.git/commit
firewire: ohci: fix buffer overflow in AR split packet handling
authorClemens Ladisch <clemens@ladisch.de>
Mon, 25 Oct 2010 09:41:53 +0000 (11:41 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Dec 2010 21:32:47 +0000 (13:32 -0800)
commit3d898ce2dd9f0caede6369bd08a35b92dbffb67f
tree08de35613324e667a1a9ae7549ffc31394335cda
parentf188231a6befaf6e685aa5f150a8d6f1beb1c7d6
firewire: ohci: fix buffer overflow in AR split packet handling

commit 85f7ffd5d2b320f73912b15fe8cef34bae297daf upstream.

When the controller had to split a received asynchronous packet into two
buffers, the driver tries to reassemble it by copying both parts into
the first page.  However, if size + rest > PAGE_SIZE, i.e., if the yet
unhandled packets before the split packet, the split packet itself, and
any received packets after the split packet are together larger than one
page, then the memory after the first page would get overwritten.

To fix this, do not try to copy the data of all unhandled packets at
once, but copy the possibly needed data every time when handling
a packet.

This gets rid of most of the infamous crashes and data corruptions when
using firewire-net.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Tested-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/firewire/ohci.c