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

Function aslr_status

freebsd/kern/kern_procctl.c:491–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491static int
492aslr_status(struct thread *td, struct proc *p, int *data)
493{
494 struct vmspace *vm;
495 int d;
496
497 switch (p->p_flag2 & (P2_ASLR_ENABLE | P2_ASLR_DISABLE)) {
498 case 0:
499 d = PROC_ASLR_NOFORCE;
500 break;
501 case P2_ASLR_ENABLE:
502 d = PROC_ASLR_FORCE_ENABLE;
503 break;
504 case P2_ASLR_DISABLE:
505 d = PROC_ASLR_FORCE_DISABLE;
506 break;
507 }
508 if ((p->p_flag & P_WEXIT) == 0) {
509 _PHOLD(p);
510 PROC_UNLOCK(p);
511 vm = vmspace_acquire_ref(p);
512 if (vm != NULL && (vm->vm_map.flags & MAP_ASLR) != 0) {
513 d |= PROC_ASLR_ACTIVE;
514 vmspace_free(vm);
515 }
516 PROC_LOCK(p);
517 _PRELE(p);
518 }
519 *data = d;
520 return (0);
521}
522
523static int
524stackgap_ctl(struct thread *td, struct proc *p, int state)

Callers 1

kern_procctl_singleFunction · 0.85

Calls 2

vmspace_acquire_refFunction · 0.85
vmspace_freeFunction · 0.85

Tested by

no test coverage detected