New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qemu in sys-net-dm crashes in libc.so with some PCI Ethernet devices, pv mode and hvm with another Ethernet device works fine #3233

Closed
qubesuser opened this Issue Oct 27, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@qubesuser

qubesuser commented Oct 27, 2017

Qubes OS version:

R4.0-rc2

Steps to reproduce the behavior:

  1. Install Qubes
  2. ??? (it apparently worked at first, but then stopped working after doing a bunch of work on the system, none of which seems an obvious culprit)
  3. Try to start sys-net with a PCI Ethernet devices assigned (as hvm)

Expected behavior:

It starts.

Actual behavior:

It fails to start.

If the PCI devices are removed or virt_mode is set to pv, then it works properly.

Also, it seems it only happens for one of two of my Ethernet devices.

Hotplugging them also triggers the issue after rescanning the PCI bus with echo 1 > /sys/bus/pci/rescan

Connecting to sys-net-dm with xl console -t pv gives the following output (I just included the final lines), that seems to indicate qemu crashing in libc (haven't investigated which code is it, by guess would be a null pointer passed to memcpy/memset):

+ [ -f /tmp/qmp/res/a45b7ced-eef4-4ac3-b73c-d0cb25a9033e ]
+ cat /tmp/qmp/res/a45b7ced-eef4-4ac3-b73c-d0cb25a9033e
+ rm /tmp/qmp/res/a45b7ced-eef4-4ac3-b73c-d0cb25a9033e
+ slot_func=6,0
+ cut -d , -f 1
+ printf %s 6,0
+ slot=6
+ cut -d , -f 2
+ printf %s 6,0
+ func=0
+ vdevfn=48
+ printf 0x%02x 48
+ xenstore-write device-model/1/parameter 0x30
+ xenstore-write device-model/1/state pci-inserted
+ true
+ xenstore-watch -n 2 device-model/1/command
device-model/1/command
traps: qemu[44] general protection ip:7ff491476ef5 sp:7ff48f5a88e0 error:0 in libc-2.24.so[7ff4913f6000+1bd000]
u2mfn_release, priv=          (null)

+ setsid cttyhack sh
#
# pcifront pci-0: Rescanning PCI Frontend Bus 0000:00
pcifront pci-0: Rescanning PCI Frontend Bus 0000:00

@andrewdavidwong andrewdavidwong added this to the Release 4.0 milestone Oct 28, 2017

@qubesuser qubesuser changed the title from qemu in sys-net-dm crashes in libc.so, pv mode works fine to qemu in sys-net-dm crashes in libc.so with 2 PCI Ethernet devices, pv mode and hvm with 1 Ethernet device works fine Oct 28, 2017

@qubesuser qubesuser changed the title from qemu in sys-net-dm crashes in libc.so with 2 PCI Ethernet devices, pv mode and hvm with 1 Ethernet device works fine to qemu in sys-net-dm crashes in libc.so with some PCI Ethernet devices, pv mode and hvm with another Ethernet device works fine Oct 28, 2017

@HW42 HW42 referenced this issue in QubesOS/qubes-vmm-xen-stubdom-linux Oct 31, 2017

Merged

qemu: Add fix for out-of-bounds write in pass-through device init #7

@HW42

This comment has been minimized.

Show comment
Hide comment

HW42 commented Oct 31, 2017

(Very likely) fixed by QubesOS/qubes-vmm-xen-stubdom-linux#7.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Nov 18, 2017

Member

@qubesuser can you confirm it's fixed with current stubdom?

Member

marmarek commented Nov 18, 2017

@qubesuser can you confirm it's fixed with current stubdom?

@marmarek marmarek closed this Dec 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment