Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 2021 16:54:40 +0000
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Slawa Olhovchenkov <slw@zxy.spb.ru>, Marcin Wojtas <mw@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: b014e0f15bc7 - main - Enable ASLR by default for 64-bit executables
Message-ID:  <56DAB1C2-C8EB-4A34-B9B6-A482A2BAC511@freebsd.org>
In-Reply-To: <30da11f2-d34b-d12e-836a-bf53949ed499@FreeBSD.org>
References:  <202111162226.1AGMQg00099240@gitrepo.freebsd.org> <20211124144112.GF77338@zxy.spb.ru> <30da11f2-d34b-d12e-836a-bf53949ed499@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 24 Nov 2021, at 16:23, John Baldwin <jhb@FreeBSD.org> wrote:
> On 11/24/21 6:41 AM, Slawa Olhovchenkov wrote:
>> On Tue, Nov 16, 2021 at 10:26:42PM +0000, Marcin Wojtas wrote:
>>>=20
>>>     Enable ASLR by default for 64-bit executables
>>>    =20
>> Now any core dumps will be useless?
>=20
> I believe core dumps should be fine.  We include the ELF auxv values =
in core
> dumps as a NT_PROCSTAT_AUXV note that GDB (and I presume LLDB) both =
look at
> to determine the location of the main executable (AT_BASE).  Once the =
dynamic
> section of the main executable is found, DT_DEBUG is used to find the =
linked
> list of shared libraries (including rtld itself) just as with PDEs.

And if it were broken, it would=E2=80=99ve been broken by switching to =
building
PIEs, not enabling ASLR. PIEs are linked with a base address of 0, so
even if the kernel has a deterministic address at which it maps such
executables (i.e. ASLR were disabled), it still needs to communicate
that to the debugger somehow. Well, unless you hard-code the address for
every architecture in the debugger, which is clearly a bad idea and not
done.

Jess




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56DAB1C2-C8EB-4A34-B9B6-A482A2BAC511>