]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commit
net: __skb_flow_dissect() must cap its return value
authorEric Dumazet <edumazet@google.com>
Thu, 10 Nov 2016 00:04:46 +0000 (16:04 -0800)
committerIshan Mittal <imittal@nvidia.com>
Fri, 6 Jan 2017 10:18:11 +0000 (15:48 +0530)
commit3df970ca763b0731295e6ba66ad29a63be99f0e8
tree321681eb5557783a64504e06dc782d1ffffebc71
parent5de5583da52bc0af0ba4c5fcd71b52c29bd72db7
net: __skb_flow_dissect() must cap its return value

[ Upstream commit 34fad54c2537f7c99d07375e50cb30aa3c23bd83 ]

After Tom patch, thoff field could point past the end of the buffer,
this could fool some callers.

If an skb was provided, skb->len should be the upper limit.
If not, hlen is supposed to be the upper limit.

Fixes: a6e544b0a88b ("flow_dissector: Jump to exit code in __skb_flow_dissect")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Yibin Yang <yibyang@cisco.com
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/flow_dissector.c