HomeFreeBSD

Don't access a user buffer directly from the kernel.

Description

Don't access a user buffer directly from the kernel.

The handle_string callback for the ENCIOC_SETSTRING ioctl was passing
a user pointer to memcpy(). Fix by using copyin() instead.

For ENCIOC_GETSTRING ioctls, the handler was storing the user pointer
in a CCB's data_ptr field where it was indirected by other code. Fix
this by allocating a temporary buffer (which ENCIOC_SETSTRING already
did) and copying the result out to the user buffer after the CCB has
been processed.

Reviewed by: kib
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24487

Details

Provenance
jhbAuthored on
Reviewer
kib
Differential Revision
D24487: Don't access a user buffer directly from the kernel.
Parents
rS360170: Retire two unused background fsck sysctls.
Branches
Unknown
Tags
Unknown