eth_type_trans tries to pull data with the length of the ethernet header from the skb. We only ensured that enough data for the first ethernet header and the batman header is available in non-paged memory of the skb and not for the ethernet after the batman header.
eth_type_trans would fail sometimes with drivers which don't ensure that all there data is perfectly linearised.
Reported-by: thorkill lesniak@sra.uni-hannover.de Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de --- batman-adv/soft-interface.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/batman-adv/soft-interface.c b/batman-adv/soft-interface.c index e93a99f..e89ede1 100644 --- a/batman-adv/soft-interface.c +++ b/batman-adv/soft-interface.c @@ -494,6 +494,8 @@ void interface_rx(struct net_device *soft_iface, }
/* skb->dev & skb->pkt_type are set here */ + if (unlikely(!pskb_may_pull(skb, ETH_HLEN))) + goto dropped; skb->protocol = eth_type_trans(skb, soft_iface);
/* should not be neccesary anymore as we use skb_pull_rcsum()