freebsd-dev/sys/i386
Dan Carpenter e99c0c8b79 xen: Prevent buffer overflow in privcmd ioctl
The "call" variable comes from the user in privcmd_ioctl_hypercall().
It's an offset into the hypercall_page[] which has (PAGE_SIZE / 32)
elements.  We need to put an upper bound on it to prevent an out of
bounds access.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>

Obtained from: Linux
Linux commit: 42d8644bd77dd2d747e004e367cb0c895a606f39
Fixes: bf7313e3b7 ("xen: implement the privcmd user-space device")
Submitted by: Elliott Mitchell <ehem+freebsd@m5p.com>
Reviewed by: royger
2022-05-06 09:31:32 +02:00
..
acpica x86: duplicate acpi_wakeup.c per i386 and amd64 2021-09-14 00:23:14 +03:00
bios smapi: Use devclass_find to lookup smapi devclass in unload handler. 2022-05-05 16:35:40 -07:00
conf FB_INSTALL_CDEV: Remove this option and related code. 2022-04-21 10:29:14 -07:00
i386 Remove dead code. 2022-04-26 19:40:59 +03:00
include xen: Prevent buffer overflow in privcmd ioctl 2022-05-06 09:31:32 +02:00
linux linux(4): Implement recvmmsg_time64 syscall. 2022-05-04 13:06:53 +03:00
pci i386: clean up empty lines in .c and .h files 2020-09-01 21:19:39 +00:00
Makefile Remove iBCS2, part2: general kernel 2018-12-19 21:57:58 +00:00