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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E292E51.4040802@inria.fr>
Date:	Fri, 22 Jul 2011 10:01:21 +0200
From:	Pierre Louis Aublin <pierre-louis.aublin@...ia.fr>
To:	netdev@...r.kernel.org
Subject: tcp/udp checksum on loopback interface

Hello everybody

I am interested in the reliability of TCP and UDP using the loopback 
interface.
I found that there is no checksum verification on the body of packets 
transmitted through the loopback interface : 
http://kerneltrap.org/mailarchive/linux-netdev/2007/10/2/327241
I ran a simple test using iperf and wireshark and I indeed found the 
validation of the checksum is disabled at packets reception.

At the reception, I guess the piece of code responsible for this 
behaviour is (line 1196 of net/ipv4/udp.c, in udp_recvmsg() for UDP) :
if (skb_csum_unnecessary(skb))
     err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), 
msg->msg_iov, len);
Is this the responsible piece of code? If yes, where does the 
CHECKSUM_UNNECESSARY flag is set?

However, I am not sure whether the checksum is computed on the whole 
packet at emission.
In __ip_append_data (net/ipv4/ip_output.c), I found the flag csummode is 
at the beginning at CHECKSUM_NONE.
Then, it is augmented using the dev->features flag of the network device 
(e.g. the loopback interface).
As the loopback interface has the NETIF_F_NO_CSUM flag, csummode stays 
at CHECKSUM_NONE and the checksum is not computed on the body of the 
message.
Can you confirm the checksum is computed only on the header of the 
packet when sending it through the loopback interface?

Finally, why this behaviour? Is it because you assume message can not 
get corrupted while staying on the same machine?

Thank you in advance
Pierre Louis Aublin
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ