From nobody Fri Oct 09 00:20:48 2026 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 4j16w05rwrz6Z2DD for ; Fri, 09 Oct 2026 00:20:48 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j16w04gvRz4Lxw for ; Fri, 09 Oct 2026 00:20:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791505248; 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=AWYZsbEApPv9RS6haOYkwmQQHIP8jch+LUdZteCgaDU=; b=wIIxegFDXsCGqdWVUDP6JuNa/WtuwY0QFxA7fbHBMQtC6zlvtDh+NWoDpX0F1Ok3ijLZhl kDNczt0ouMzs6Ntc/NTkcLjpfw0V0MjrU7EqaPtS+1dp56R+mDmTh5xkaZQ6A72n/xgTHO 3KZzWhkfih8nE+VQgHiDKFw1HQAt5j1BxvFek2+6vC+bFyRo7eX8aLUaKFUNberFohHwQp SZWqTXm1T8b7SKWXpIsNFAK/JzVtMAdpUq+3ASpfhEi1Df2h0QPWw47fHc267WMTmJI/9o lmLOqPF9ReCTnKZJCdWhZDVEBB7ZT5iCqy8/LdOv32yRsxautTcAoTluy3QN9g== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791505248; b=CsHNfSqPW7xoupMl8cVfTxAndb/oIoL76P3o44Q2jZh+gZj3htE4El7HiFCERCmDXSlbIu DPy6SLRf1LcfpnG2UuMLHustXy0YOotaJ8U3A5YcMtSorcSJsvWjyiQheBu0nanRjEeKTx BYco1GktvnusLvjTyhWHObKQKde46/DR8zM29aq0aBDRz9YeClfzATRS3OHKdIg1UPp+NJ LZBr1Ma8xUEjC6ODLS90th/CPeddPt+G5qdgLKy7gEDlB358bRLPXFakVh50tJ057PvJyi RRNUgzQ4VvtFRWEVZRTdyvjpc5hN50JrgCen7+/Sl4b6jQhFqaUffM6IAJ7t0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791505248; 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=AWYZsbEApPv9RS6haOYkwmQQHIP8jch+LUdZteCgaDU=; b=yZOUJmT1Iad8lJX0hG7rEuk9kKRkD9AknBXqHWkuBcm+NUovFW9II/W7c9/oHOvR/GaX+S n19UvdkpifyBK/I5v+og94dSc/ifu0e8t78XPh01FjIXtABnF6FXOkq8/ttCS4JxGC6zg/ jrkdMaWPWKFbARjoQp3gXPAhmFYIKm0u2bVUc6fSgHOFEXScu2dzqdZt7mph/dQm2F6S3T FF0MuiDyVhKr9OeetQ0WuMQD4+5rBs1Rl8qAchzKj+EtWTCEM22yQaS1/4HaKMr3jmpWnA XE/P0eVoctp8dv55BG5WDTM1LPtQxvqavrBblRWXJ6XUtQNJ36KVOyr4/qZ85A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j16w03Zs7z12VB for ; Fri, 09 Oct 2026 00:20:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1996c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 09 Oct 2026 00:20:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a3174f0f4721 - stable/14 - libc: Reject static ELF exectables with PT_TLS segments were filesz > memsz 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a3174f0f4721ab09d69d5e676b778b418fed68ad Auto-Submitted: auto-generated Date: Fri, 09 Oct 2026 00:20:48 +0000 Message-Id: <6ac83360.1996c.68313bfd@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a3174f0f4721ab09d69d5e676b778b418fed68ad commit a3174f0f4721ab09d69d5e676b778b418fed68ad Author: John Baldwin AuthorDate: 2026-07-31 17:52:34 +0000 Commit: John Baldwin CommitDate: 2026-10-08 18:47:31 +0000 libc: Reject static ELF exectables with PT_TLS segments were filesz > memsz Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D58558 (cherry picked from commit b9eaf9b7cef25228e8c20e3819f1b7be94f486aa) --- lib/libc/gen/tls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 8d453eccb801..86078e2a2fb8 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -436,6 +436,10 @@ _init_tls(void) for (i = 0; (unsigned) i < phnum; i++) { if (phdr[i].p_type == PT_TLS) { + if (phdr[i].p_memsz < phdr[i].p_filesz) { + tls_msg("_init_tls: invalid PT_TLS segment.\n"); + abort(); + } libc_tls_static_space = roundup2(phdr[i].p_memsz, phdr[i].p_align); libc_tls_init_size = phdr[i].p_filesz;