Opened 4 years ago
Closed 4 years ago
#19930 closed defect (fixed)
Host-only networking virtual device inserts incorrect UDP checksum (checksum offloading) in rare case
Reported by: | Pierre L | Owned by: | |
---|---|---|---|
Component: | network/hostif | Version: | VirtualBox 6.1.10 |
Keywords: | checksum offloading | Cc: | |
Guest type: | all | Host type: | all |
Description
When using host-only networking with a transmitting guest OS that offloads the Internet checksum to hardware, in a certain rare case the inserted checksum is incorrect, such that it is discarded by the destination OS.
Instructions to reproduce:
- send the attached packet (unfilledchecksum.pcap) through host-only networking, making sure the sending guest OS takes advantage of checksum offloading
expected behavior:
- the packet is received by the other guest OS with checksum value 0xFFFF
observed behavior:
- the packet is received by the other guest OS with checksum value 0x0000 as seen in illegalchecksum.pcap. As a result, packet is dropped by that other guest OS (Linux) and never reaches the destination socket.
Notes: as the UDP checksum scope includes the IP header, you will need to use the same source and destination addresses, among other data. The correct checksum value comes from Wireshark, and is consistent with this sentence in RFC 768: "If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic)"; as of revision 86228 of DevE1000.cpp, this does not appear to be observed. While this issue was uncovered with UDP, TCP would appear to have the same issue, though I have not similarly checked its standards documents. For what it's worth, both guest OS are Linux, and at no point were raw sockets used, only regular datagram sockets in the AF_INET6 domain. Seen with Version 6.1.12 r139181 (Qt5.6.2). I do not have the development environment in place to include a patch.
Attachments (3)
Change History (5)
by , 4 years ago
Attachment: | Validation - main-2020-10-01-12-39-16.log added |
---|
by , 4 years ago
Attachment: | illegalchecksum.pcap added |
---|
packet capture (one packet) where the incorrect data appears
comment:1 by , 4 years ago
Indeed, e1000 code did not handle zero UDP checksum case correctly. The fix will be included into the next maintenance release. Please note, that this issue applies to UDP only where zero checksum means that no checksum was inserted, TCP does not consider zero checksum to be a special case.
VirtualBox log of the sending VM