git: 4b2694fbcf2a - stable/14 - user stack randomization: only enable by default for 64bit processes

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Tue, 31 Oct 2023 00:46:17 UTC
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=4b2694fbcf2a63e31ab33645d9291f3264eb06f6

commit 4b2694fbcf2a63e31ab33645d9291f3264eb06f6
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-10-24 21:44:06 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-10-31 00:46:10 +0000

    user stack randomization: only enable by default for 64bit processes
    
    (cherry picked from commit 1798b44fda382c473c9fc7762e162613a39dc23c)
---
 sys/kern/imgact_elf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index e01bccc93cb0..4ebd08082545 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -200,7 +200,7 @@ SYSCTL_INT(ASLR_NODE_OID, OID_AUTO, honor_sbrk, CTLFLAG_RW,
     &__elfN(aslr_honor_sbrk), 0,
     __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) ": assume sbrk is used");
 
-static int __elfN(aslr_stack) = 1;
+static int __elfN(aslr_stack) = __ELF_WORD_SIZE == 64;
 SYSCTL_INT(ASLR_NODE_OID, OID_AUTO, stack, CTLFLAG_RWTUN,
     &__elfN(aslr_stack), 0,
     __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE))