1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-01 08:27:59 +00:00
freebsd/sys/amd64/vmm
Pierre Pronchery d19fa9c1b7 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 51fda658ba ("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
2024-10-02 12:58:45 -04:00
..
amd Remove stray whitespaces from sys/amd64/ 2024-09-21 07:05:46 -06:00
intel Remove stray whitespaces from sys/amd64/ 2024-09-21 07:05:46 -06:00
io Remove stray whitespaces from sys/amd64/ 2024-09-21 07:05:46 -06:00
vmm_dev_machdep.c vmm: Harmonize compat ioctl definitions 2024-08-28 19:12:32 +00:00
vmm_host.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
vmm_host.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmm_instruction_emul.c Remove stray whitespaces from sys/amd64/ 2024-09-21 07:05:46 -06:00
vmm_ioport.c bhyve: initialize register value 2024-09-27 08:59:36 -04:00
vmm_ioport.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmm_lapic.c vmm: Move vmm_ktr.h to a common directory 2024-08-26 18:41:05 +00:00
vmm_lapic.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmm_mem.c Remove stray whitespaces from sys/amd64/ 2024-09-21 07:05:46 -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-06 10:38:34 -05:00
vmm_stat.h vmm: Move duplicated stats code into a generic file 2024-08-26 18:41:14 +00:00
vmm_util.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
vmm_util.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmm.c vmm: avoid potential KASSERT kernel panic in vm_handle_db 2024-10-02 12:58:45 -04:00
x86.c vmm: Move vmm_ktr.h to a common directory 2024-08-26 18:41:05 +00:00
x86.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00