Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F95300174
D20795.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20795.id.diff
View Options
Index: head/sys/vm/vm_mmap.c
===================================================================
--- head/sys/vm/vm_mmap.c
+++ head/sys/vm/vm_mmap.c
@@ -187,6 +187,7 @@
{
struct vmspace *vms;
struct file *fp;
+ struct proc *p;
vm_offset_t addr;
vm_size_t pageoff, size;
vm_prot_t cap_maxprot;
@@ -199,6 +200,9 @@
prot = PROT_EXTRACT(prot);
if (max_prot != 0 && (max_prot & prot) != prot)
return (EINVAL);
+
+ p = td->td_proc;
+
/*
* Always honor PROT_MAX if set. If not, default to all
* permissions unless we're implying maximum permissions.
@@ -209,7 +213,7 @@
max_prot = (imply_prot_max && prot != PROT_NONE) ?
prot : _PROT_ALL;
- vms = td->td_proc->p_vmspace;
+ vms = p->p_vmspace;
fp = NULL;
AUDIT_ARG_FD(fd);
addr = addr0;
@@ -229,7 +233,7 @@
* pos.
*/
if (!SV_CURPROC_FLAG(SV_AOUT)) {
- if ((len == 0 && curproc->p_osrel >= P_OSREL_MAP_ANON) ||
+ if ((len == 0 && p->p_osrel >= P_OSREL_MAP_ANON) ||
((flags & MAP_ANON) != 0 && (fd != -1 || pos != 0)))
return (EINVAL);
} else {
@@ -375,7 +379,7 @@
if (error != 0)
goto done;
if ((flags & (MAP_SHARED | MAP_PRIVATE)) == 0 &&
- td->td_proc->p_osrel >= P_OSREL_MAP_FSTRICT) {
+ p->p_osrel >= P_OSREL_MAP_FSTRICT) {
error = EINVAL;
goto done;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 21, 5:15 AM (1 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12349888
Default Alt Text
D20795.id.diff (1 KB)
Attached To
Mode
D20795: Control implicit PROT_MAX() using proccontrol(1) and the FreeBSD note feature bit.
Attached
Detach File
Event Timeline
Log In to Comment