lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 19 Dec 2014 12:07:57 +0100 From: Jiri Benc <jbenc@...hat.com> To: Govindarajulu Varadarajan <_govind@....com> Cc: Jay Vosburgh <jay.vosburgh@...onical.com>, Eric Dumazet <eric.dumazet@...il.com>, davem@...emloft.net, netdev@...r.kernel.org, ssujith@...co.com, benve@...co.com, Stefan Assmann <sassmann@...hat.com> Subject: Re: [PATCH net] enic: fix rx skb checksum On Fri, 19 Dec 2014 16:22:34 +0530 (IST), Govindarajulu Varadarajan wrote: > Hardware returns 0xffff for non tcp/udp packets. That explains that I saw that with ICMP packets. > For tcp/udp packet it returns > pseudo checksum. Not the _whole_ pkt checksum. I see. I didn't get this from your patch, although you wrote it there, sorry. And I didn't dig that deep while debugging, I was satisfied with seeing 0xffff for the packets that caused problems :-) > Dec 18 11:13:18 a163 kernel: enic: saddr=96d8690a, daddr=a3ba6a0a, length=40, proto=6 > Dec 18 11:13:18 a163 kernel: enic: hw_checksum = c457, pseudo_checksum_32=3a930115, pseudo_checksum_fold=c457 > > Dec 18 11:13:18 a163 kernel: enic: saddr=a37410a, daddr=a3ba6a0a, length=32, proto=6 > Dec 18 11:13:18 a163 kernel: enic: hw_checksum = 80f9, pseudo_checksum_32=adf1d114, pseudo_checksum_fold=80f9 > > Dec 18 11:13:18 a163 kernel: enic: saddr=a37410a, daddr=a3ba6a0a, length=32, proto=6 > Dec 18 11:13:18 a163 kernel: enic: hw_checksum = 80f9, pseudo_checksum_32=adf1d114, pseudo_checksum_fold=80f9 > > Clearly hw is returning folded pseudo checksum. Indeed. > > I have no idea whether the hardware verified the checksum for the > > 0xffff case and is just not returning the checksum or whether such > > packets come completely unverified. > > Yes, hardware verifies the checksum and sets tcp_udp_csum_ok flag to 1. > If pkt verification fails or pkt is not tcp/udp, tcp_udp_csum_ok is 0. And we > send the pkt to stack with CHECKSUM_NONE. Thanks for the confirmation. > Driver should use CHECKSUM_COMPLETE only if it can produce _whole_ pkt checksum. > as described in include/linux/skbuff.h:75 Sure. I just misunderstood what the hardware provides. > I am trying to fix "Do not set CHECKSUM_COMPLETE, when driver does not have > checksum of whole pkt." > > Is my understanding correct? With the information you've just written (thanks for your patience), I think your patch is correct. Thanks a lot! Jiri -- Jiri Benc -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists