From nobody Sun Apr 27 22:32:50 2025 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 4Zm1YZ73mcz5vQNT; Sun, 27 Apr 2025 22:32:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zm1YZ4bVLz3tDx; Sun, 27 Apr 2025 22:32:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745793170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2PzyfVnBRuzKetj4kstM5QCZAAApbSm9yTYtwuf+TJw=; b=iJCz2aylTkJHFIKxyNkn52ISK9J5DaCZKKkunukoWk0LyiKYq0PSe+ks5DTsAqN7QJLFCT lcOFVi72NtjiWGuAuBlBCwYRVsmoCHD9p0P09LzY4yuxACSI7RYgDDr6tPdwrymKByWLZd d/jI7tkcWPKlTCVPsaWgsVU6H7zFEsPKmefujCJP/fiz5Kdh6G0yiRxX5/fwpJK9vRnKmK 8U+CU8fCMzAB8TmRX7xuG3VgfdjzaacVNVyNIzh/3dIOGSZWbr36DH+Q2sSi7sEIim9aIW 30DRNCBQEBqd0Lo0+7iDRkgIO25bdut1E3ysfZMnUbSaKkZda7b5RvKS1a6V4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745793170; a=rsa-sha256; cv=none; b=vE3ie4/TWpjFFLS9lQwL5kI3PKM0YofF+cbePgvRYXJ0GCr7B7l5xHZSah2TnxvBCtH5Dl DZYbCRjgVuUsqdSdszjwDBa9IJM8+euvQSZ5zlgQCwchhyoqydvaEfZoF4n7dOkJ9yV4Hm X8IwNSdNs17BzVP1dG44TFenT3vEl1YH7MuUoVlk7BxD1CvWKhyvXgCLMH5kFdCz58Sb3o 9rli9G0jSuGK/njEUoXeR4pVBJZSfkz4p63fNkWDhKkN7DYRygA/wP2plZ6TSYRXMfDvK8 Bd7n/YFAtx+Lp6gCO5EHjq1m1JZWs4PHz01bflpbRhbqH0ih4JtRKM4hKSeJoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745793170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2PzyfVnBRuzKetj4kstM5QCZAAApbSm9yTYtwuf+TJw=; b=iNeOV5BebOtu/+doqbierq89FzyTzsJ7WERbled1Pjod7imYLBFxbIfLA2yoQ44Ot15szL WZsdmiEww+t3lvZ4xaFzySLUWF7euhCzEIHAbyFC8mCspFO2dnX/vL96KuFvgq3P0GC+qP Zxf07hlDBL0jlVDqAfBK3U7JRxdGRQ3FJ+cu2Z0ZzQxddMB3SpjrYOrOjSTW9EXkWKXc2J mrbgoA6ze+HZtIPWDb8u4PoV+l7rMbHmT+kumnKWTaaJ7DIb3+nGtrWtjQqQBwQGtnPfED Y0CXnzwAZZLXlVacDV6uN0eG+vUum6clh3tG23Ko3mDrxWHscyI0Tlj1OKotuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Zm1YZ1lw0z1NDd; Sun, 27 Apr 2025 22:32:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53RMWolX069544; Sun, 27 Apr 2025 22:32:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53RMWo5i069541; Sun, 27 Apr 2025 22:32:50 GMT (envelope-from git) Date: Sun, 27 Apr 2025 22:32:50 GMT Message-Id: <202504272232.53RMWo5i069541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b989c1dd1e2e - main - elfctl: add knowledge about the la57 bit 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b989c1dd1e2edc8cf7597d276625b454b7b72e6d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b989c1dd1e2edc8cf7597d276625b454b7b72e6d commit b989c1dd1e2edc8cf7597d276625b454b7b72e6d Author: Konstantin Belousov AuthorDate: 2025-04-19 10:47:45 +0000 Commit: Konstantin Belousov CommitDate: 2025-04-27 22:31:59 +0000 elfctl: add knowledge about the la57 bit Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D49913 --- usr.bin/elfctl/elfctl.1 | 14 ++++++++++++++ usr.bin/elfctl/elfctl.c | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/usr.bin/elfctl/elfctl.1 b/usr.bin/elfctl/elfctl.1 index 5ba016b664a3..e72c6bcf250a 100644 --- a/usr.bin/elfctl/elfctl.1 +++ b/usr.bin/elfctl/elfctl.1 @@ -95,6 +95,20 @@ Features may also be specified as a single combined value: .Bd -literal -offset indent elfctl -e =0x5 file .Ed +.Sh NOTES +On amd64, on a machine with LA57 (5-level paging) mode supported and +enabled, if both +.Va la57 +and +.Va la48 +feature flags are specified, the +.Va la57 +feature has priority over +.Va la48 . +The +.Va vm.pmap.prefer_uva_la48 +sysctl MIB defines the default user address space size for binaries +which do not set either of these flags. .Sh SEE ALSO .Xr mitigations 7 .Sh HISTORY diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c index d9cb557bbad4..cacd30b44b2d 100644 --- a/usr.bin/elfctl/elfctl.c +++ b/usr.bin/elfctl/elfctl.c @@ -67,7 +67,10 @@ static struct ControlFeatures featurelist[] = { "Disable implicit PROT_MAX" }, { "nostackgap", NT_FREEBSD_FCTL_STKGAP_DISABLE, "Disable stack gap" }, { "wxneeded", NT_FREEBSD_FCTL_WXNEEDED, "Requires W+X mappings" }, - { "la48", NT_FREEBSD_FCTL_LA48, "amd64: Limit user VA to 48bit" }, + { "la48", NT_FREEBSD_FCTL_LA48, + "amd64: Limit user virtual addresses to 48 bits" }, + { "la57", NT_FREEBSD_FCTL_LA57, + "amd64: Allow the use of 57-bit virtual addresses when available" }, }; static struct option long_opts[] = {