struct net_bridge_port *p = skb->dev->br_port;
struct ip_arphdr *ah = (struct ip_arphdr *)arp_hdr(skb);
+ if (!pskb_may_pull(skb, sizeof *ah))
+ return 0;
+
if ((ah->ar_op != htons(ARPOP_REQUEST))
|| ah->ar_hln != ETH_ALEN
|| ah->ar_pro != htons(ETH_P_IP)
else if (skb->protocol != htons(ETH_P_IP))
return 0;
+ if (!pskb_may_pull(skb, sizeof *iph))
+ goto ipv4_error;
+
iph = ip_hdr(skb);
if (iph->ihl < 5 || iph->version != 4)
goto ipv4_error;