From nobody Fri Oct 06 20:44:54 2023 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 4S2L5g3PTTz4wWCH; Fri, 6 Oct 2023 20:44:55 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S2L5g1qCBz3ZDK; Fri, 6 Oct 2023 20:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696625095; 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=S3wF+RLTyyttD1tw6qnHZO9TWMizIruXYgQX7hcTY+0=; b=arvFQIabFmjjWZrctsfh8d9j/BLqdgXRZzL99OCbqzs/+A9OhKrKHC+8cO3NuymxuSjd5U 9qknthnC0tYET7c0GZO4gFz6Vi9jRGiSXJhBzTPtq6xjhAVnvz4imSIwCzdRlRt3dUEwyE 0KzcNpYkp9kaGj/4S+Cb1MszOFpGN0P6QuoORKT64ebifPE++qeW/a9ONVGtu49tcpzG0n VWAL008xxm6CrH0+WyMYpMjSY4Gb/VROrlWDFyUU6xL239CFYGM4lmN5qsKu4RftEstiqu K3Lgd/RBjlXwqbzuu1ZsxJvjwRsl1XlqVJ42DelsaBFa7PRRyyJEF+KOkF4LcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696625095; a=rsa-sha256; cv=none; b=sJTi+vUR9OTddzuX/89ROJX+9U/ap3uKKQ9b+BDNvHtwXyjSv6Q1cd+xqqnFE+YT7qb/tu 9pUL1rqb7m3StnyBi+7/fAPl7VuGPBx8HZcXCAv8XeBslGPZfAPZXjEaPGkXhGoDe28SYe oEHMkYYUGSp13C5jLRacqPY0dGH9UavYSqWP5I5UebHf812I40jC5qzIV9SRSVWHMOYYv8 37sq7XTnn8k8slpvNA5Rclr42Uykq6MkXmB5qQBmFFMcIqit2enp+3i0TrmoNfnGwu3dKa UTgQPt/1QMYPsNi5FpKzA+g/KNz+Fq3UF/du2K7OfnkuD/MSgJUkPraAozN5tw== 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=1696625095; 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=S3wF+RLTyyttD1tw6qnHZO9TWMizIruXYgQX7hcTY+0=; b=NvXIp7KsAMvcN4vZ6WSZnNJ207zo1dh7uTo2N93uqg6XOZBHa+NfSPxzJEzyU8rErAtFpL kbSXz62VQeA/kb8o8aC+jZPoMhNqRaJKjCxJFminYEISCZowIaQemIPdQPdROLCRyYGEM2 mJRzdSrs0aEkwj11xPqrqO2IaCOXqA7BhVEWHITbiXTibVNZ0UE08N8zST1lfGA6pz08V5 TOUD4iRtalJLGCm7oCNymtcGi3ng6Re14ZSG8674GJHiW3XprznA1IzaaO2Kloc+BO1rFe hvsVbX9AWhQgYaHXXKWsliIge/j3ta+6v4nCr0wkn2Ie8W/nrwKTYIZnxoOGtw== 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 4S2L5g0cSdz130h; Fri, 6 Oct 2023 20:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 396KisZZ025450; Fri, 6 Oct 2023 20:44:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 396KisdI025447; Fri, 6 Oct 2023 20:44:54 GMT (envelope-from git) Date: Fri, 6 Oct 2023 20:44:54 GMT Message-Id: <202310062044.396KisdI025447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: a2b289608d6b - main - mitigations.7: briefly explain RELRO 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2b289608d6b54b6e1ce85096560807e551bb5ac Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a2b289608d6b54b6e1ce85096560807e551bb5ac commit a2b289608d6b54b6e1ce85096560807e551bb5ac Author: Ed Maste AuthorDate: 2023-10-06 14:37:55 +0000 Commit: Ed Maste CommitDate: 2023-10-06 20:44:07 +0000 mitigations.7: briefly explain RELRO Reviewed by: bcr (earlier), kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42107 --- share/man/man7/mitigations.7 | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/share/man/man7/mitigations.7 b/share/man/man7/mitigations.7 index 8023f094d678..fed16d7b325f 100644 --- a/share/man/man7/mitigations.7 +++ b/share/man/man7/mitigations.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 5, 2023 +.Dd October 6, 2023 .Dt MITIGATIONS 7 .Os .Sh NAME @@ -50,10 +50,10 @@ Position Independent Executable (PIE) Write XOR Execute page protection policy .It .Dv PROT_MAX -".It -"Read-Only Relocation (RELRO) -.\".It -.\"Bind Now +.It +Relocation Read-Only (RELRO) +.It +Bind Now .\".It .\"Stack Smashing Protection (SSP) .\".It @@ -192,8 +192,25 @@ may be made writable by a future .Xr mprotect call, but may not be made executable. .\" -.\".Ss Read-Only Relocation (RELRO) -.\" +.Ss Relocation Read-Only (RELRO) +Relocation Read-Only (RELRO) is a mitigation tool that makes certain portions +of a program's address space that contain ELF metadata read-only, after +relocation processing by +.Xr rtld 1 . +.Pp +When enabled in isolation the RELRO option provides +.Em partial RELRO +support. +In this case the Procedure Linkage Table (PLT)-related part of the +Global Offset Table (GOT) (in the section typically named .got.plt) remains +writable. +.Pp +RELRO is enabled by default. +The +.Xr src.conf 5 +build-time option +.Va WITHOUT_RELRO +may be used to disable it. .Ss BIND_NOW The .Va WITH_BIND_NOW @@ -205,11 +222,12 @@ The run-time loader .Xr rtld 1 will then perform all relocation processing when the process starts, instead of on demand (on the first access to each symbol). +.Pp When enabled in combination with .Dv RELRO (which is enabled by default) this provides -.Qt full -RELRO, the entire GOT (.got and .got.plt) are made read-only at program startup, +.Em full RELRO . +The entire GOT (.got and .got.plt) are made read-only at program startup, preventing attacks on the relocation table. Note that this results in a nonstandard Application Binary Interface (ABI), and it is possible that some applications may not function correctly.