]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/cam/cam_periph.c
vmapbuf: don't smuggle address or length in buf
authorbrooks <brooks@FreeBSD.org>
Wed, 21 Oct 2020 16:00:15 +0000 (16:00 +0000)
committerbrooks <brooks@FreeBSD.org>
Wed, 21 Oct 2020 16:00:15 +0000 (16:00 +0000)
commit7d8530e564a42fffcc2a3a907f53696b9fca2448
tree3512d6f4207869377c7e84188834dfa79e806d10
parent8483987d89b0e5fed50beaba46723a02a22d2662
vmapbuf: don't smuggle address or length in buf

Instead, add arguments to vmapbuf.  Since this argument is
always a pointer use a type of void * and cast to vm_offset_t in
vmapbuf.  (In CheriBSD we've altered vm_fault_quick_hold_pages to
take a pointer and check its bounds.)

In no other situtation does b_data contain a user pointer and vmapbuf
replaces b_data with the actual mapping.

Suggested by: jhb
Reviewed by: imp, jhb
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26784
sys/cam/cam_periph.c
sys/dev/nvme/nvme_ctrlr.c
sys/kern/vfs_bio.c
sys/sys/buf.h
sys/ufs/ffs/ffs_rawread.c