android_kernel_samsung_a7y1.../net
Marcel Holtmann 665a139065 Bluetooth: Check L2CAP option sizes returned from l2cap_get_conf_opt
commit af3d5d1c87664a4f150fcf3534c6567cb19909b0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 11:45:59 +02:00
..
6lowpan A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
9p A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
802 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
8021q A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
appletalk A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
atm A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ax25 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
batman-adv A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bluetooth Bluetooth: Check L2CAP option sizes returned from l2cap_get_conf_opt 2020-04-06 11:45:59 +02:00
bridge A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
caif A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
can A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ceph A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
core net : disable KNOX_NCM 2020-03-27 22:13:21 +05:30
dcb A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dccp tcp/dccp: drop SYN packets if accept queue is full 2020-04-06 11:16:42 +02:00
decnet A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dns_resolver A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dsa A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ethernet A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hsr A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ieee802154 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ipv4 tcp/dccp: drop SYN packets if accept queue is full 2020-04-06 11:16:42 +02:00
ipv6 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ipx A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
irda A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iucv A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
key A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
l2tp A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
l3mdev A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lapb A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
llc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mac80211 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mac802154 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mpls A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mptcp A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ncm A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netfilter net : disable KNOX_NCM 2020-03-27 22:13:21 +05:30
netlabel A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netlink A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netrom A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nfc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
openvswitch A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
packet A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
phonet A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rds A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rfkill A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rose A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rxrpc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sched A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sctp A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sunrpc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
switchdev A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tipc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
unix A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
vmw_vsock A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
wimax A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
wireless A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
x25 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xfrm A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
compat.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
socket.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sysctl_net.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30