File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 4040 * Mapped file (mmap) interface to VM
4141 */
4242
43- #include <sys/cdefs.h>
4443#include "opt_hwpmc_hooks.h"
4544#include "opt_vm.h"
4645
46+ #define EXTERR_CATEGORY EXTERR_CAT_MMAP
4747#include <sys/param.h>
4848#include <sys/systm.h>
4949#include <sys/capsicum.h>
50+ #include <sys/exterrvar.h>
5051#include <sys/kernel.h>
5152#include <sys/lock.h>
5253#include <sys/mutex.h>
@@ -190,12 +191,16 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp)
190191 pos = mrp -> mr_pos ;
191192 check_fp_fn = mrp -> mr_check_fp_fn ;
192193
193- if ((prot & ~(_PROT_ALL | PROT_MAX (_PROT_ALL ))) != 0 )
194+ if ((prot & ~(_PROT_ALL | PROT_MAX (_PROT_ALL ))) != 0 ) {
195+ SET_ERROR0 (EINVAL , "unknown PROT bits" );
194196 return (EINVAL );
197+ }
195198 max_prot = PROT_MAX_EXTRACT (prot );
196199 prot = PROT_EXTRACT (prot );
197- if (max_prot != 0 && (max_prot & prot ) != prot )
200+ if (max_prot != 0 && (max_prot & prot ) != prot ) {
201+ SET_ERROR0 (ENOTSUP , "prot is not subset of max_prot" );
198202 return (ENOTSUP );
203+ }
199204
200205 p = td -> td_proc ;
201206
You can’t perform that action at this time.
0 commit comments