Re: [PATCH] icmp: Fixed bug in raw sockets causing incorrect ICMP SNMP counter values

2015-10-11 Thread Ben Cox
Forgive me for possibly being a little stupid here (This is my first patch to Linux so I am slightly over my head) Is this issue not addressed above the file where the following check is done? if (iphlen > length) goto error_free; On Sun, Oct 11, 2015 at 11:10 PM, Eric Dumazet

Re: [PATCH] icmp: Fixed bug in raw sockets causing incorrect ICMP SNMP counter values

2015-10-11 Thread Eric Dumazet
On Sun, 2015-10-11 at 15:43 -0700, Eric Dumazet wrote: > But your code reads 21th byte. BTW, nice catch ! Your patch only need a small addition. Thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo

Re: [PATCH] icmp: Fixed bug in raw sockets causing incorrect ICMP SNMP counter values

2015-10-11 Thread Eric Dumazet
On Sun, 2015-10-11 at 23:17 +0100, Ben Cox wrote: > Forgive me for possibly being a little stupid here (This is my first > patch to Linux so I am slightly over my head) > > Is this issue not addressed above the file where the following check is done? > > if (iphlen > length) > goto

Re: [PATCH] icmp: Fixed bug in raw sockets causing incorrect ICMP SNMP counter values

2015-10-11 Thread Eric Dumazet
On Sun, 2015-10-11 at 15:44 -0700, Eric Dumazet wrote: > On Sun, 2015-10-11 at 15:43 -0700, Eric Dumazet wrote: > > > But your code reads 21th byte. > > BTW, nice catch ! Maybe the following one. 1) We properly set transport header 2) We use icmp_hdr() helper. diff --git a/net/ipv4/raw.c

Re: [PATCH] icmp: Fixed bug in raw sockets causing incorrect ICMP SNMP counter values

2015-10-11 Thread Ben Cox
Nice! That works in my head at least, Sorry about not seeing that fairly glaring memory issue there. Are you sure " skb->transport_header += iphlen; " won't have a knock on affect when it's given to NF_HOOK ( as in, would a potential userspace program get something it does not expect anymore ) ?

[PATCH] icmp: Fixed bug in raw sockets causing incorrect ICMP SNMP counter values

2015-10-11 Thread Ben Cartwright-Cox
Sending ICMP packets with raw sockets ends up in the SNMP counters logging the type as the first byte of the IPv4 header rather than the ICMP header (in nearly all cases this is seen as "OutType69". This is fixed by adding the IP Header Length to the casting into a icmphdr struct. Signed-off-by:

Re: [PATCH] icmp: Fixed bug in raw sockets causing incorrect ICMP SNMP counter values

2015-10-11 Thread Eric Dumazet
On Sun, 2015-10-11 at 20:55 +, Ben Cartwright-Cox wrote: > Sending ICMP packets with raw sockets ends up in the SNMP counters > logging the type as the first byte of the IPv4 header rather than > the ICMP header (in nearly all cases this is seen as "OutType69". > This is fixed by adding the IP

Re: [PATCH] icmp: Fixed bug in raw sockets causing incorrect ICMP SNMP counter values

2015-10-11 Thread Eric Dumazet
Please do not top-post on netdev and/or lkml On Mon, 2015-10-12 at 00:14 +0100, Ben Cox wrote: > Nice! > > That works in my head at least, Sorry about not seeing that fairly > glaring memory issue there. No problem, this is why we review patches ;) > > Are you sure " skb->transport_header +=