Bluetooth: Properly check L2CAP config option output buffer length
authorBen Seri <ben@armis.com>
Sat, 9 Sep 2017 21:15:59 +0000 (23:15 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 10 Sep 2017 00:56:05 +0000 (17:56 -0700)
commite860d2c904d1a9f38a24eb44c9f34b8f915a6ea3
treeec7c665df89fb1e72b735a7ac326d2ded6eeaaa2
parent4dfc2788033d30dfccfd4268e06dd73ce2c654ed
Bluetooth: Properly check L2CAP config option output buffer length

Validate the output buffer length for L2CAP config requests and responses
to avoid overflowing the stack buffer used for building the option blocks.

Cc: stable@vger.kernel.org
Signed-off-by: Ben Seri <ben@armis.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
net/bluetooth/l2cap_core.c