]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/cam/cam_periph.c
vmapbuf: don't smuggle address or length in buf
authorBrooks Davis <brooks@FreeBSD.org>
Wed, 21 Oct 2020 16:00:15 +0000 (16:00 +0000)
committerBrooks Davis <brooks@FreeBSD.org>
Wed, 21 Oct 2020 16:00:15 +0000 (16:00 +0000)
commit44ca4575ea0602c037be51beb89e1a1ad34ee649
tree3512d6f4207869377c7e84188834dfa79e806d10
parent7ec2f6bce5d28e6662c29e63f6ab6b7ef57d98b2
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