diff options
author | Alexander Duyck <aduyck@mirantis.com> | 2016-02-24 09:29:51 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-24 13:58:04 -0500 |
commit | 224516b3a798a0563346748744f8cd19feaf09be (patch) | |
tree | 619b14a96a1071c10e222f0795e635bf1405b502 /net/core | |
parent | 43d2ccb3c122a47524019d1831a54f07f7fcb978 (diff) |
flow_dissector: Correctly handle parsing FCoE
The flow dissector bits handling FCoE didn't bother to actually validate
that the space there was enough for the FCoE header. So we need to update
things so that if there is room we add the header and report a good result,
otherwise we do not add the header, and report the bad result.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Acked-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/flow_dissector.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 8bd745f72734..6288153d7f36 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -340,8 +340,11 @@ mpls: } case htons(ETH_P_FCOE): - key_control->thoff = (u16)(nhoff + FCOE_HEADER_LEN); - /* fall through */ + if ((hlen - nhoff) < FCOE_HEADER_LEN) + goto out_bad; + + nhoff += FCOE_HEADER_LEN; + goto out_good; default: goto out_bad; } |