opnsense-src/sys/amd64/vmm
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
..
amd vmm(4): Fix a typo in a kernel message 2024-04-28 07:20:46 +02:00
intel vmm: Expose more registers to VM_GET_REGISTER 2024-03-08 23:28:39 -05:00
io sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vmm.c vmm: avoid potential KASSERT kernel panic in vm_handle_db 2024-10-06 11:01:24 -04:00
vmm_dev.c vmm: Fix handling of errors from subyte() 2024-01-01 19:30:00 -05:00
vmm_host.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vmm_host.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmm_instruction_emul.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vmm_ioport.c bhyve: initialize register value 2024-09-30 08:11:15 -04:00
vmm_ioport.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmm_ktr.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmm_lapic.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vmm_lapic.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmm_mem.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vmm_mem.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmm_snapshot.c vmm: Fix compiling error with BHYVE_SNAPSHOT 2024-02-20 09:21:14 -05:00
vmm_stat.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vmm_stat.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmm_util.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vmm_util.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
x86.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
x86.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00