From nobody Wed Nov 24 16:54:40 2021 X-Original-To: dev-commits-src-main@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 1052A18ABD49 for ; Wed, 24 Nov 2021 16:54:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 4HznDS6S23z4d8T for ; Wed, 24 Nov 2021 16:54:48 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f46.google.com with SMTP id j3so5428748wrp.1 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=GMO7/lgmUIGpYY9yDr+8OHq85mtlirfJrXVDIPMCl3qXh/xJkFRYOQuCsG9SmqnRiT aaqlMVSkIsmM82g/nCuCr8nlY8XQq4T9yizhCrP/0spoA6hx/1B9avdJJ9EqJj5eEpWJ KYmy9HCZnR71RLlPDYkq++UzgexpPu0Giu7O5axnmcKsdeMvlaP76bR71ZmnWjZWUKX7 s9FR/ZbCiieAlcEWDT0msFXXQAubwdNbc4EP1AFEGGFBh8Z3ou/vGC6wokSUCJkS+KDL 3RoA8ZEiIZrPSwYJ7dOmonTWPXruFjFDMiKXZX1vrMO/5Wq7qYZKq94JfPvvrxtLLOBG Rw3A== X-Gm-Message-State: AOAM531E8He3+87QOa+02jpdhLIzLm7w0BHxPRtdvAO1bQ7r5dr30lRV i98YSuqMKO9EH2w2RlGVk8zi5Q== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4HznDS6S23z4d8T 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