Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Feb 2022 17:34:13 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        bob prohaska <fbsd@www.zefox.net>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: Troubles building world on stable/13 [How to set just the compiler to avoid ASLR being enabled for it]
Message-ID:  <0E1C03AD-7600-4680-A27A-985E6DC64B0C@yahoo.com>
In-Reply-To: <51D494E4-6D8D-49C7-8F0C-FD53311264A5@yahoo.com>
References:  <20220124165449.GA39982@www.zefox.net> <5FAC2B2C-7740-435E-A183-FB3EF1FCE7F9@yahoo.com> <20220202223208.GA78110@www.zefox.net> <70550346-BC53-458F-B01B-68559E5C9847@yahoo.com> <20220203015149.GA78722@www.zefox.net> <8A85F917-F4E8-4382-B777-15AF7401E616@yahoo.com> <D93232D9-BCBF-4C65-B984-D95CB12ADFCD@yahoo.com> <C3D8ABCB-C7CC-4D88-B648-7C31C5BCC96E@yahoo.com> <20220204214403.GA85107@www.zefox.net> <B5FD0DF9-283E-49F1-BF73-2D8675B3E72E@yahoo.com> <20220205000800.GA85644@www.zefox.net> <51D494E4-6D8D-49C7-8F0C-FD53311264A5@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
The following shows how to examine and control the compiler's ASLR
status (notation shown presumes first cd'ing to where the c++ file
is):

# elfctl c++
File 'c++' features:
noaslr          'Disable ASLR' is unset.
noprotmax       'Disable implicit PROT_MAX' is unset.
nostackgap      'Disable stack gap' is unset.
wxneeded        'Requires W+X mappings' is unset.
la48            'amd64: Limit user VA to 48bit' is unset.
noaslrstkgap    'Disable ASLR stack gap' is unset.

# elfctl -e +noaslr c++

# elfctl c++
File 'c++' features:
noaslr          'Disable ASLR' is set.
noprotmax       'Disable implicit PROT_MAX' is unset.
nostackgap      'Disable stack gap' is unset.
wxneeded        'Requires W+X mappings' is unset.
la48            'amd64: Limit user VA to 48bit' is unset.
noaslrstkgap    'Disable ASLR stack gap' is unset.

(noaslrstkgap may be fairly specific to the vintage of
main [so: 14] that I'm at and so might not show up.)

Being tied to the file, this survives reboots.

This should avoid needing the system wide disable
that I'd previously listed. In other words: no need
for:

# sysctl kern.elf64.aslr.enable=0

(which would not survive a reboot).

===
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0E1C03AD-7600-4680-A27A-985E6DC64B0C>