| 489 | } |
| 490 | |
| 491 | static int |
| 492 | aslr_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 | |
| 523 | static int |
| 524 | stackgap_ctl(struct thread *td, struct proc *p, int state) |
no test coverage detected