]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Rx, Check ip headers sanity
authorSaeed Mahameed <saeedm@mellanox.com>
Tue, 26 Mar 2019 05:10:59 +0000 (22:10 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 9 Apr 2019 19:33:51 +0000 (12:33 -0700)
commit43db17c39cfd001a7f5be4b3ebb6ed064c884aee
tree3e181419014c97448391486c2a08b3ee0764321e
parent972aed80157d437606dcdf84faff651f18c6ba29
net/mlx5e: Rx, Check ip headers sanity

In the two places is_last_ethertype_ip is being called, the caller will
be looking inside the ip header, to be safe, add ip{4,6} header sanity
check. And return true only on valid ip headers, i.e: the whole header
is contained in the linear part of the skb.

Note: Such situation is very rare and hard to reproduce, since mlx5e
allocates a large enough headroom to contain the largest header one can
imagine.

Fixes: 575c4738bc77 ("net/mlx5e: don't set CHECKSUM_COMPLETE on SCTP packets")
Reported-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c