| 465 | } |
| 466 | |
| 467 | static int |
| 468 | aslr_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 | |
| 491 | static int |
| 492 | aslr_status(struct thread *td, struct proc *p, int *data) |
no outgoing calls
no test coverage detected