diff options
author | Mark Johnston <markj@FreeBSD.org> | 2022-01-17 16:42:46 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2022-01-17 21:11:54 +0000 |
commit | 758d98debec43ff83b8a1ed9a3d3a8441b83b3cc (patch) | |
tree | 7624090de352fe1be113ba1abc344975f27038b4 /sys/kern/imgact_elf.c | |
parent | 706f4a81a81250a326ea25914e7effe1768f1a37 (diff) | |
download | src-758d98debec43ff83b8a1ed9a3d3a8441b83b3cc.tar.gz src-758d98debec43ff83b8a1ed9a3d3a8441b83b3cc.zip |
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r-- | sys/kern/imgact_elf.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 8852b47681f3..c3d19064f6e5 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2757,22 +2757,3 @@ __elfN(untrans_prot)(vm_prot_t prot) flags |= PF_W; return (flags); } - -vm_size_t -__elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base) -{ - uintptr_t range, rbase, gap; - int pct; - - pct = __elfN(aslr_stack_gap); - if (pct == 0) - return (0); - if (pct > 50) - pct = 50; - range = imgp->eff_stack_sz * pct / 100; - arc4rand(&rbase, sizeof(rbase), 0); - gap = rbase % range; - gap &= ~(sizeof(u_long) - 1); - *stack_base -= gap; - return (gap); -} |