VirtualBox

Opened 2 years ago

Closed 19 months ago

#20993 closed defect (duplicate)

PXE UNDI driver transmit seems to be mapping existing transmit buffer instead of making a copy

Reported by: henryptung Owned by:
Component: network Version: VirtualBox 6.1.34
Keywords: Cc:
Guest type: other Host type: other

Description

To be fair, haven't dug that far into VirtualBox code (don't really use SVN, and don't have an easy web interface to search the code for what I'm looking for) but, the most recent code I could find on GitHub for VBox seems to suggest it's mapping the supplied transmit buffer and not copying it before return: https://github.com/TedHartDavis/VBoxMirror/blob/3d7f37ab5b248566e1dc17df8ee495628bb007e5/src/VBox/Devices/EFI/FirmwareNew/OptionRomPkg/UndiRuntimeDxe/Decode.c#L1214, https://github.com/TedHartDavis/VBoxMirror/blob/3d7f37ab5b248566e1dc17df8ee495628bb007e5/src/VBox/Devices/EFI/Firmware/OptionRomPkg/UndiRuntimeDxe/E100b.c#L1100

Given that, I'm currently the following behavior running GRUB in VirtualBox and it sending DNS:

  1. GRUB (2.06) allocates a single, fixed scratch-space buffer for sending packets via PXE UNDI; this buffer is reused for every packet send. (See https://github.com/rhboot/grub2/blob/ef36b3c93d27bdfc7a68469be33bd8be95630e6a/grub-core/net/drivers/i386/pc/pxe.c#L259)
  2. When running in VirtualBox, I can get GRUB to send DNS requests manually with the net_nslookup command.
  3. When GRUB is in prefer-ipv4 mode (default), it tries to send one A DNS request followed by an IPv6 AAAA request.
  4. Looking in Wireshark, I can see it just sending two AAAA requests instead (seems like the AAAA query contents are somehow clobbering the A query), separated by about 0.2ms.
  5. When I set debug=dns in GRUB, the delay of debug-print-to-console seems to introduce enough delay that I see separate A and AAAA requests in Wireshark (now separated by about 1ms).

The best explanation I have for these observations is that VirtualBox's UNDI/PXE implementation is not mixing well with GRUB's extreme transmit buffer reuse, and causing a sufficiently quick sequence of transmits to clobber previous packets' contents.

I'm not that familiar with PXE or UNDI API requirements, but it seems like the driver should not return without at least making a copy of the data buffer, even if it doesn't transmit the packet immediately? In any case, would hope someone can take a look at the spec and determine whether this is actually a bug on VirtualBox's side or GRUB's.

Thanks in advance!

Change History (1)

comment:1 by aeichner, 19 months ago

Resolution: duplicate
Status: newclosed

Duplicate of #20994.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use