HomeFreeBSD

xen: Prevent buffer overflow in privcmd ioctl

Description

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: bf7313e3b79 ("xen: implement the privcmd user-space device")
Submitted by: Elliott Mitchell <ehem+freebsd@m5p.com>
Reviewed by: royger

Details

Provenance
Dan Carpenter <dan.carpenter@oracle.com>Authored on Apr 4 2019, 3:12 PM
roygerCommitted on May 6 2022, 7:31 AM
Parents
rG0fdf5bc531fb: Remove extraneous devclass argument from DRIVER_MODULE_ORDERED6.
Branches
Unknown
Tags
Unknown

Event Timeline