vm: use new capsicum helpers
This commit is contained in:
parent
32a86c44ee
commit
3379d2f926
@ -389,15 +389,15 @@ kern_mmap_fpcheck(struct thread *td, uintptr_t addr0, size_t len, int prot,
|
|||||||
* rights, but also return the maximum rights to be combined
|
* rights, but also return the maximum rights to be combined
|
||||||
* with maxprot later.
|
* with maxprot later.
|
||||||
*/
|
*/
|
||||||
cap_rights_init(&rights, CAP_MMAP);
|
cap_rights_init_one(&rights, CAP_MMAP);
|
||||||
if (prot & PROT_READ)
|
if (prot & PROT_READ)
|
||||||
cap_rights_set(&rights, CAP_MMAP_R);
|
cap_rights_set_one(&rights, CAP_MMAP_R);
|
||||||
if ((flags & MAP_SHARED) != 0) {
|
if ((flags & MAP_SHARED) != 0) {
|
||||||
if (prot & PROT_WRITE)
|
if (prot & PROT_WRITE)
|
||||||
cap_rights_set(&rights, CAP_MMAP_W);
|
cap_rights_set_one(&rights, CAP_MMAP_W);
|
||||||
}
|
}
|
||||||
if (prot & PROT_EXEC)
|
if (prot & PROT_EXEC)
|
||||||
cap_rights_set(&rights, CAP_MMAP_X);
|
cap_rights_set_one(&rights, CAP_MMAP_X);
|
||||||
error = fget_mmap(td, fd, &rights, &cap_maxprot, &fp);
|
error = fget_mmap(td, fd, &rights, &cap_maxprot, &fp);
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user