From nobody Wed Nov 24 16:54:40 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0E75318ABD48 for ; Wed, 24 Nov 2021 16:54:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HznDS6S05z4dBk for ; Wed, 24 Nov 2021 16:54:48 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f50.google.com with SMTP id u18so5369519wrg.5 for ; Wed, 24 Nov 2021 08:54:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=QMpAJ+c11QOXg3P3HQDcNER91D5N5J2U4VsCV1ANspM=; b=MtqKmCDQqQ8MJzqxACr1ajtjNQ1oiM9WkVoVr/l6njocyor8bxVWXou3A324S6O9h5 rGBaEJjGqK9bwXEmqxHN5wNXuxF0hG1dbMLl+clCkb1R9ZOP2JMrNNh0ixhJPWvdYUfm zDp8aw+gCt1no+xgywDtz1t8zlNk+hoGnmlT3HNr3aRBgHVfRHaIU6pbFiJYkXVeakzw XhHEN8zGndUsccVVdcCV0AL7zJUZuMZIbqn4Dea0q+Pn9SmGMuPodeHhoM+QO8ev5tTT a8X4PfBqiJOFGE0aLbMYjniUYhrBSjMoHZB+tmIrkW9BDR1OWqbmg/V3204weFyNtWVE C40g== X-Gm-Message-State: AOAM532X5iR90pO+m8cMBw03f/YJvXiUySPX/uDMKsUoLS+2by5qctFO ZmGMFPp1VQF9+M4FWX9uljjhlA== X-Google-Smtp-Source: ABdhPJzzmqDzuQEJ1BFOkeKesqnnkUcqhVJ+9Acg5fZkIXr+N10pKqA1VWrgW8EYJPbpUebCA6CasQ== X-Received: by 2002:a5d:50c6:: with SMTP id f6mr20972447wrt.131.1637772881931; Wed, 24 Nov 2021 08:54:41 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id m20sm6197271wmq.11.2021.11.24.08.54.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Nov 2021 08:54:41 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: b014e0f15bc7 - main - Enable ASLR by default for 64-bit executables From: Jessica Clarke In-Reply-To: <30da11f2-d34b-d12e-836a-bf53949ed499@FreeBSD.org> Date: Wed, 24 Nov 2021 16:54:40 +0000 Cc: Slawa Olhovchenkov , Marcin Wojtas , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <56DAB1C2-C8EB-4A34-B9B6-A482A2BAC511@freebsd.org> References: <202111162226.1AGMQg00099240@gitrepo.freebsd.org> <20211124144112.GF77338@zxy.spb.ru> <30da11f2-d34b-d12e-836a-bf53949ed499@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HznDS6S05z4dBk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 24 Nov 2021, at 16:23, John Baldwin 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