]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Bluetooth: Check L2CAP option sizes returned from l2cap_get_conf_opt
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 18 Jan 2019 11:56:20 +0000 (12:56 +0100)
committerBrian Maly <brian.maly@oracle.com>
Tue, 28 May 2019 19:43:33 +0000 (15:43 -0400)
commit5a3dabbecf465f5e3e91d2f25c4823b8f5f526c9
tree0e72bd9ebf90503a91903100ced64f6fade0c744
parente8afb60babbda32899825833498b9a6363a67a11
Bluetooth: Check L2CAP option sizes returned from l2cap_get_conf_opt

When doing option parsing for standard type values of 1, 2 or 4 octets,
the value is converted directly into a variable instead of a pointer. To
avoid being tricked into being a pointer, check that for these option
types that sizes actually match. In L2CAP every option is fixed size and
thus it is prudent anyway to ensure that the remote side sends us the
right option size along with option paramters.

If the option size is not matching the option type, then that option is
silently ignored. It is a protocol violation and instead of trying to
give the remote attacker any further hints just pretend that option is
not present and proceed with the default values. Implementation
following the specification and its qualification procedures will always
use the correct size and thus not being impacted here.

To keep the code readable and consistent accross all options, a few
cosmetic changes were also required.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Orabug: 29526426
CVE: CVE-2019-3459
(cherry picked from commit af3d5d1c87664a4f150fcf3534c6567cb19909b0)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
net/bluetooth/l2cap_core.c