Skip to content

Commit

Permalink
flow dissector: correct size of storage for ARP
Browse files Browse the repository at this point in the history
The last argument to __skb_header_pointer() should be a buffer large
enough to store struct arphdr. This can be a pointer to a struct arphdr
structure. The code was previously using a pointer to a pointer to
struct arphdr.

By my counting the storage available both before and after is 8 bytes on
x86_64.

Fixes: 5573335 ("flow disector: ARP support")
Reported-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Simon Horman authored and David S. Miller committed Apr 3, 2017
1 parent 75514b6 commit ac6a372
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/flow_dissector.c
Original file line number Diff line number Diff line change
@@ -390,7 +390,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
unsigned char ar_tip[4];
} *arp_eth, _arp_eth;
const struct arphdr *arp;
struct arphdr *_arp;
struct arphdr _arp;

arp = __skb_header_pointer(skb, nhoff, sizeof(_arp), data,
hlen, &_arp);

0 comments on commit ac6a372

Please sign in to comment.