提交 d5774b93 编写于 作者: J Jiri Pirko 提交者: David S. Miller

flow_dissector: Fix GRE header error path

Now, when an unexpected element in the GRE header appears, we break so
the l4 ports are processed. But since the ports are processed
unconditionally, there will be certainly random values dissected. Fix
this by just bailing out in such situations.
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4a5d6c8b
......@@ -479,18 +479,18 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
/* Only look inside GRE without routing */
if (hdr->flags & GRE_ROUTING)
break;
goto out_good;
/* Only look inside GRE for version 0 and 1 */
gre_ver = ntohs(hdr->flags & GRE_VERSION);
if (gre_ver > 1)
break;
goto out_good;
proto = hdr->protocol;
if (gre_ver) {
/* Version1 must be PPTP, and check the flags */
if (!(proto == GRE_PROTO_PPP && (hdr->flags & GRE_KEY)))
break;
goto out_good;
}
offset += sizeof(struct gre_base_hdr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册