Skip to content
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

Fix guest memory corruption caused by hvmloader #172

Closed
wants to merge 2 commits into from

Conversation

neowutran
Copy link
Contributor

The xen hvmloader is relocating memory and overwritting some part of guest memory.

It seem to be a known issue in xen since the behavior is documented in the source code, so idk if it should be reported to the xen project.

I tested this patch on my setup for a few days, saw no issues yet, and it fixed QubesOS/qubes-issues#4321

@marmarek
Copy link
Member

marmarek commented Dec 1, 2023

This should be sent to xen-devel mailing list first. Given the support status of qemu-traditional, it shouldn't be a controversial change.

@marmarek
Copy link
Member

marmarek commented Dec 2, 2023

openQArun

@qubesos-bot
Copy link

qubesos-bot commented Dec 2, 2023

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.2&build=2023120205-4.2&flavor=kernel

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.2&build=2023112922-4.2&flavor=kernel

  • system_tests_suspend@hw6

    • suspend: wait_serial (wait serial expected)
      # wait_serial expected: qr/p5~T5-\d+-/...

    • suspend: Failed (test died + timed out)
      # Test died: command 'true' timed out at /usr/lib/os-autoinst/autot...

  • system_tests_update@hw2

    • update2: Failed (test died)
      # Test died: command 'script -c 'qubes-vm-update --max-concurrency=...
  • system_tests_update@hw11

    • update2: Failed (test died)
      # Test died: command 'script -c 'qubes-vm-update --max-concurrency=...

Failed tests

4 failures
  • system_tests_suspend@hw6

    • suspend: wait_serial (wait serial expected)
      # wait_serial expected: qr/p5~T5-\d+-/...

    • suspend: Failed (test died + timed out)
      # Test died: command 'true' timed out at /usr/lib/os-autoinst/autot...

  • system_tests_update@hw2

    • update2: Failed (test died)
      # Test died: command 'script -c 'qubes-vm-update --max-concurrency=...
  • system_tests_update@hw11

    • update2: Failed (test died)
      # Test died: command 'script -c 'qubes-vm-update --max-concurrency=...

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/86627#dependencies

26 fixed
  • system_tests_basic_vm_qrexec_gui@hw6

    • TC_20_AudioVM_Pulse_whonix-workstation-17: test_223_audio_play_hvm (failure)
      AssertionError: too short audio, expected 10s, got 9.28231292517006...
  • system_tests_basic_vm_qrexec_gui@hw7

    • TC_00_Basic: test_040_qdb_watch (failure)
      AssertionError: libvirt event impl drain timeout
  • system_tests_basic_vm_qrexec_gui@hw2

    • TC_20_AudioVM_Pulse_debian-12-xfce: test_223_audio_play_hvm (failure)
      AssertionError: too short audio, expected 10s, got 5.29385487528344...

    • TC_20_AudioVM_Pulse_fedora-38-xfce: test_223_audio_play_hvm (failure)
      AssertionError: too short audio, expected 10s, got 5.28641723356009...

  • system_tests_basic_vm_qrexec_gui@hw11

  • system_tests_suspend@hw11

    • suspend: wait_serial (wait serial expected)
      # wait_serial expected: qr/p5~T5-\d+-/...

    • suspend: Failed (test died + timed out)
      # Test died: command 'true' timed out at /usr/lib/os-autoinst/autot...

  • system_tests_guivm_gui_interactive

    • guivm_manager: unnamed test (unknown)
    • guivm_manager: Failed (test died)
      # Test died: no candidate needle with tag(s) 'menu-qubes-tools' mat...
  • system_tests_network_updates

    • TC_00_Dom0Upgrade_debian-12-xfce: test_001_update_check (failure)
      self.assertFalse(self.app.domains[... AssertionError: '1' is not false

    • TC_00_Dom0Upgrade_fedora-38-xfce: test_001_update_check (failure)
      self.assertFalse(self.app.domains[... AssertionError: '1' is not false

  • system_tests_suspend

    • suspend: wait_serial (wait serial expected)
      # wait_serial expected: qr/p5~T5-\d+-/...

    • suspend: Failed (test died + timed out)
      # Test died: command 'true' timed out at /usr/lib/os-autoinst/autot...

Unstable tests

  • system_tests_basic_vm_qrexec_gui@hw1

    TC_20_AudioVM_Pulse_debian-12-xfce/test_220_audio_play_pulseaudio (1/5 times with errors)
    • job 86091 AssertionError: Command 'paplay --format=float32le --rate=44100 --c...
    TC_20_NonAudio_whonix-gateway-17/test_300_bug_1028_gui_memory_pinning (2/5 times with errors)
    • job 85314 AssertionError: Dom0 window doesn't match VM window content, saved ...
    • job 86091 AssertionError: Dom0 window doesn't match VM window content, saved ...
  • system_tests_basic_vm_qrexec_gui@hw6

    TC_20_AudioVM_Pulse_debian-12-xfce/test_220_audio_play_pulseaudio (1/5 times with errors)
    • job 86091 AssertionError: Command 'paplay --format=float32le --rate=44100 --c...
    TC_20_NonAudio_whonix-gateway-17/test_300_bug_1028_gui_memory_pinning (2/5 times with errors)
    • job 85314 AssertionError: Dom0 window doesn't match VM window content, saved ...
    • job 86091 AssertionError: Dom0 window doesn't match VM window content, saved ...
  • system_tests_basic_vm_qrexec_gui@hw10

    TC_20_AudioVM_Pulse_debian-12-xfce/test_220_audio_play_pulseaudio (1/5 times with errors)
    • job 86091 AssertionError: Command 'paplay --format=float32le --rate=44100 --c...
    TC_20_NonAudio_whonix-gateway-17/test_300_bug_1028_gui_memory_pinning (2/5 times with errors)
    • job 85314 AssertionError: Dom0 window doesn't match VM window content, saved ...
    • job 86091 AssertionError: Dom0 window doesn't match VM window content, saved ...
  • system_tests_basic_vm_qrexec_gui@hw7

    TC_20_AudioVM_Pulse_debian-12-xfce/test_220_audio_play_pulseaudio (1/5 times with errors)
    • job 86091 AssertionError: Command 'paplay --format=float32le --rate=44100 --c...
    TC_20_NonAudio_whonix-gateway-17/test_300_bug_1028_gui_memory_pinning (2/5 times with errors)
    • job 85314 AssertionError: Dom0 window doesn't match VM window content, saved ...
    • job 86091 AssertionError: Dom0 window doesn't match VM window content, saved ...
  • system_tests_basic_vm_qrexec_gui@hw2

    TC_20_AudioVM_Pulse_debian-12-xfce/test_220_audio_play_pulseaudio (1/5 times with errors)
    • job 86091 AssertionError: Command 'paplay --format=float32le --rate=44100 --c...
    TC_20_NonAudio_whonix-gateway-17/test_300_bug_1028_gui_memory_pinning (2/5 times with errors)
    • job 85314 AssertionError: Dom0 window doesn't match VM window content, saved ...
    • job 86091 AssertionError: Dom0 window doesn't match VM window content, saved ...
  • system_tests_basic_vm_qrexec_gui@hw11

    TC_20_AudioVM_Pulse_debian-12-xfce/test_220_audio_play_pulseaudio (1/5 times with errors)
    • job 86091 AssertionError: Command 'paplay --format=float32le --rate=44100 --c...
    TC_20_NonAudio_whonix-gateway-17/test_300_bug_1028_gui_memory_pinning (2/5 times with errors)
    • job 85314 AssertionError: Dom0 window doesn't match VM window content, saved ...
    • job 86091 AssertionError: Dom0 window doesn't match VM window content, saved ...

@neowutran
Copy link
Contributor Author

for the moment I got no answer ( https://lists.xenproject.org/archives/html/xen-devel/2023-12/msg00133.html )
will check next week if I can rewrite it in a more interesting way

@Garbage4F
Copy link

Anyway I can help test this? I think this is related to this issue with R4.2

@neowutran
Copy link
Contributor Author

https://lists.xenproject.org/archives/html/xen-devel/2023-12/msg01499.html

( @Garbage4F , I do not think that both issues are related. You could try to use "nvidia-open" driver instead of "nvidia", that is what I use on R4.2 for GPU passthrough )

@marmarek
Copy link
Member

marmarek commented Jan 5, 2024

Since #175 is merged, this one is not needed anymore.

@marmarek marmarek closed this Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants