[Help Welcome] KVM Development - staying the course

Please see KVM: Difference between revisions - Whonix

1 Like

@Patrick where do I add the kvm kernel command?

1 Like

security-misc/40_kernel_hardening.cfg at master Ā· Kicksecure/security-misc Ā· GitHub

1 Like
1 Like

Merged.

1 Like

Uploaded newer images to our server. How long before they appear on download.whonix.org?

Symlink was missing. This is now fixed.

In future should be after 1-2 minutes.

1 Like

We can probably disable hugepages entirely with the vm.nr_hugepages=0 sysctl rather than using the kvm.nx_huge_pages mitigation.

2 Likes

Alright go for it.

1 Like

Whatā€™s the rationale / advantage of this?

iTLB multihit ā€” The Linux Kernel documentation mentions only kvm.nx_huge_pages but not vm.nr_hugepages=0. It should be the same in theory but I havenā€™t seen vm.nr_hugepages=0 mentioned in context of, search term:

"iTLB multihit" "vm.nr_hugepages"
1 Like

Hugepages have more security issues (see Whonix for KVM). The kvm.nx_huge_pages mitigation only fixes a specific issue by marking certain memory pages as non-executable. vm.nr_hugepages=0 disables hugepages altogether, preventing all of its issues.

https://www.kernel.org/doc/Documentation/admin-guide/mm/hugetlbpage.rst

/proc/sys/vm/nr_hugepages indicates the current number of ā€œpersistentā€ huge pages in the kernelā€™s huge page pool. ā€œPersistentā€ huge pages will be returned to the huge page pool when freed by a task. A user with root privileges can dynamically allocate more or free some persistent huge pages by increasing or decreasing the value of nr_hugepages.

The default should be 0 anyway but this isnā€™t guaranteed on other distros.

The sysctl isnā€™t specific to that issue but hugepages in general.

1 Like

Speaking of KVM spectre mitigations, thereā€™s more work planned ahead for safe HT use

1 Like

That would lessen the risk but I donā€™t think HT should ever be enabled as itā€™s still going to be full of vulnerabilities.

1 Like

Indeed. Good to know there is more active work in this space though. IIUC it can provide stronger guest-host separation than currently available.

1 Like

Could you please check this commit wonā€™t break KVM?

sudo apt install xserver-xorg-video-vmware

Apt tells me it is already installed and the newest version and nothing is broken.

1 Like

Inside VM already installed?

Yep and Iā€™m sure I didnā€™t manually put it there :slight_smile:

1 Like

Could you please check that Whonix ā„¢ for KVM does use / does not use sudo whenever appropriate?

It uses sudo virsh start
but also non-sudo virsh -c qemu:///system net-autostart default
which is not obvious to me.

background: āš“ T914 Whonix Host Live - enable KVM readonly mode - virt-xml vm-name --edit --disk readonly=on

Thereā€™s no way this command works without sudo while the latter does. Going by principle of least privilege in the guide, I only use sudo for commands that wonā€™t work without it.

1 Like