Bluetooth: Prevent buffer overflow in l2cap config request
commit9bb38ae0b3a03b774dd026bf1c7758d2d107f464
authorDan Rosenberg <drosenberg@vsecurity.com>
Fri, 24 Jun 2011 12:38:05 +0000 (24 08:38 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Nov 2011 20:32:51 +0000 (7 12:32 -0800)
treebb60330b4b6a6ceb77f6e75f06002e1b6d7d52fb
parentdbb6e675314ddf4f1011a080e2fee0012134f83f
Bluetooth: Prevent buffer overflow in l2cap config request

commit 7ac28817536797fd40e9646452183606f9e17f71 upstream.

A remote user can provide a small value for the command size field in
the command header of an l2cap configuration request, resulting in an
integer underflow when subtracting the size of the configuration request
header.  This results in copying a very large amount of data via
memcpy() and destroying the kernel heap.  Check for underflow.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/bluetooth/l2cap.c