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

Function aslr_ctl

freebsd/kern/kern_procctl.c:467–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465}
466
467static int
468aslr_ctl(struct thread *td, struct proc *p, int state)
469{
470
471 PROC_LOCK_ASSERT(p, MA_OWNED);
472
473 switch (state) {
474 case PROC_ASLR_FORCE_ENABLE:
475 p->p_flag2 &= ~P2_ASLR_DISABLE;
476 p->p_flag2 |= P2_ASLR_ENABLE;
477 break;
478 case PROC_ASLR_FORCE_DISABLE:
479 p->p_flag2 |= P2_ASLR_DISABLE;
480 p->p_flag2 &= ~P2_ASLR_ENABLE;
481 break;
482 case PROC_ASLR_NOFORCE:
483 p->p_flag2 &= ~(P2_ASLR_ENABLE | P2_ASLR_DISABLE);
484 break;
485 default:
486 return (EINVAL);
487 }
488 return (0);
489}
490
491static int
492aslr_status(struct thread *td, struct proc *p, int *data)

Callers 1

kern_procctl_singleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected