Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 224516b3 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller
Browse files

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: default avatarAlexander Duyck <aduyck@mirantis.com>
Acked-by: default avatarTom Herbert <tom@herbertland.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 43d2ccb3
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -340,8 +340,11 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
	}
	}


	case htons(ETH_P_FCOE):
	case htons(ETH_P_FCOE):
		key_control->thoff = (u16)(nhoff + FCOE_HEADER_LEN);
		if ((hlen - nhoff) < FCOE_HEADER_LEN)
		/* fall through */
			goto out_bad;

		nhoff += FCOE_HEADER_LEN;
		goto out_good;
	default:
	default:
		goto out_bad;
		goto out_bad;
	}
	}