android_kernel_google_msm/net
Pablo Neira Ayuso 0313d86853 netfilter: nfnetlink_queue: fix maximum packet length to userspace
The packets that we send via NFQUEUE are encapsulated in the NFQA_PAYLOAD
attribute. The length of the packet in userspace is obtained via
attr->nla_len field. This field contains the size of the Netlink
attribute header plus the packet length.

If the maximum packet length is specified, ie. 65535 bytes, and
packets in the range of (65531,65535] are sent to userspace, the
attr->nla_len overflows and it reports bogus lengths to the
application.

To fix this, this patch limits the maximum packet length to 65531
bytes. If larger packet length is specified, the packet that we
send to user-space is truncated to 65531 bytes.

To support 65535 bytes packets, we have to revisit the idea of
the 32-bits Netlink attribute length.

Reported-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Change-Id: Id4d70b0b3e4d7fc3422130cc2989473d545530e1
2018-12-07 22:04:24 +04:00
..
9p 9p: forgetting to cancel request on interrupted zero-copy RPC 2015-10-22 09:20:07 +08:00
802
8021q
appletalk
atm atm: deal with setting entry before mkip was called 2016-03-21 09:17:56 +08:00
ax25 net: add validation for the socket syscall protocol argument 2016-10-29 23:12:11 +08:00
batman-adv
bluetooth Bluetooth: cmtp: cmtp_add_connection() should verify that it's dealing with l2cap socket 2018-01-13 17:14:31 +03:00
bridge Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
caif
can can: add missing initialisations in CAN related skbuffs 2015-06-19 11:40:23 +08:00
ceph crush: fix a bug in tree bucket decode 2015-10-22 09:20:07 +08:00
core netfilter: ipv6: add IPv6 NAT support 2018-12-07 22:02:09 +04:00
dcb
dccp Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
decnet net: Loopback ifindex is constant now 2018-08-27 14:52:48 +00:00
dns_resolver
dsa
econet
ethernet
ieee802154
ipv4 net: Allow userns root to control ipv4 2018-12-07 22:04:24 +04:00
ipv6 net: Add missing LOOPBACK_IFINDEX change in ipv6/route.c 2018-12-07 22:04:24 +04:00
ipx ipx: call ipxitf_put() in ioctl error path 2018-02-16 20:15:04 -07:00
irda Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
iucv
key net: Fix RCU splat in af_key 2016-03-21 09:17:52 +08:00
l2tp Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
lapb
llc Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
mac80211 Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
netfilter netfilter: nfnetlink_queue: fix maximum packet length to userspace 2018-12-07 22:04:24 +04:00
netlabel
netlink Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
netrom
nfc
openvswitch net: make skb_gso_segment error handling more robust 2015-06-19 11:40:33 +08:00
packet Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
phonet
rds RDS: fix race condition when sending a message on unbound socket 2016-03-21 09:17:54 +08:00
rfkill Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
rose NET: ROSE: Don't dereference NULL neighbour pointer. 2015-09-18 09:20:47 +08:00
rxrpc Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
sched Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
sctp Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
sunrpc Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
tipc
unix Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
wanrouter
wimax
wireless cfg80211: Define nla_policy for NL80211_ATTR_LOCAL_MESH_POWER_MODE 2018-01-13 17:13:42 +03:00
x25
xfrm xfrm: policy: check policy direction value 2018-02-16 20:15:07 -07:00
activity_stats.c
compat.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
Kconfig
Makefile
nonet.c
socket.c Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1 2017-12-27 17:13:15 +03:00
sysctl_net.c