opnsense-src/sys/amd64
Pierre Pronchery f8db6fb90e vmm: avoid potential KASSERT kernel panic in vm_handle_db
If the guest VM emits the exit code VM_EXITCODE_DB the kernel will
execute the function named vm_handle_db.

If the value of rsp is not page aligned and if rsp+sizeof(uint64_t)
spans across two pages, the function vm_copy_setup will need two structs
vm_copyinfo to prepare the copy operation.

For instance is rsp value is 0xFFC, two vm_copyinfo objects are needed:

* address=0xFFC, len=4
* address=0x1000, len=4

The vulnerability was addressed by commit 51fda658baa ("vmm: Properly
handle writes spanning across two pages in vm_handle_db").  Still,
replace the KASSERT with an error return as a more defensive approach.

Reported by:    Synacktiv
Reviewed by	markj, emaste
Security:       HYP-09
Sponsored by:   The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46133

(cherry picked from commit d19fa9c1b72bc52e51524abcc59ad844012ec365)
2024-10-06 11:01:24 -04:00
..
acpica x86: AMD Zen2: Zenbleed chicken bit mitigation 2023-10-10 09:34:31 -04:00
amd64 amd64/mp_machdep.c: style 2024-10-05 10:08:53 +03:00
conf conf: Add usbhid and hidbus to GENERIC* kernel configs 2024-07-29 18:36:42 +02:00
ia32 syscalls: fix missing SIGSYS for several ENOSYS errors 2023-10-09 06:24:31 +03:00
include amd64: add variables indicating INVLPGB works 2024-08-28 03:26:34 +03:00
linux amd64/linux*: mark brandlists as static 2024-02-14 05:42:40 +02:00
linux32 Abstract UIO allocation and deallocation. 2024-03-08 23:27:20 -05:00
pci x86: Adjust base addr for PCI MCFG regions 2024-01-18 15:24:35 -08:00
sgx sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vmm vmm: avoid potential KASSERT kernel panic in vm_handle_db 2024-10-06 11:01:24 -04:00
Makefile sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00