MCPcopy Create free account
hub / github.com/F-Stack/f-stack / protect_set

Function protect_set

freebsd/kern/kern_procctl.c:104–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104static int
105protect_set(struct thread *td, struct proc *p, int flags)
106{
107 int error, ret;
108
109 switch (PPROT_OP(flags)) {
110 case PPROT_SET:
111 case PPROT_CLEAR:
112 break;
113 default:
114 return (EINVAL);
115 }
116
117 if ((PPROT_FLAGS(flags) & ~(PPROT_DESCEND | PPROT_INHERIT)) != 0)
118 return (EINVAL);
119
120 error = priv_check(td, PRIV_VM_MADV_PROTECT);
121 if (error)
122 return (error);
123
124 if (flags & PPROT_DESCEND)
125 ret = protect_setchildren(td, p, flags);
126 else
127 ret = protect_setchild(td, p, flags);
128 if (ret == 0)
129 return (EPERM);
130 return (0);
131}
132
133static int
134reap_acquire(struct thread *td, struct proc *p)

Callers 1

kern_procctl_singleFunction · 0.85

Calls 3

protect_setchildrenFunction · 0.85
protect_setchildFunction · 0.85
priv_checkFunction · 0.70

Tested by

no test coverage detected