Bluetooth: Prevent buffer overflow in l2cap config request
authorDan Rosenberg <drosenberg@vsecurity.com>
Fri, 24 Jun 2011 12:38:05 +0000 (08:38 -0400)
committerJaikumar Ganesh <jaikumar@google.com>
Mon, 18 Jul 2011 19:28:02 +0000 (12:28 -0700)
commit1752e5327a01247d605515dbba86ad32a493db93
tree151d9c18e62535905763bcdb2f680156ddc835a2
parentcacfcdeb500046c3e5cc4d39824b3d5ddf8e4728
Bluetooth: Prevent buffer overflow in l2cap config request

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>
Cc: stable <stable@kernel.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/l2cap_core.c