From nobody Wed Jul 15 15:04:14 2026 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 4h0fb24kyCz6lbZm for ; Wed, 15 Jul 2026 15:04:14 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h0fb23wClz3f6K for ; Wed, 15 Jul 2026 15:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784127854; 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=eqgqvLhKsrFPFNRpyszUjjkAQ5ytzlhWWawD+EwUm9U=; b=LPRgyMt23ZUHCleo1zG+/sJehZE8O37aPTGce7Rg4FJzZ2nyW8rGBoLO8AjX/MzwWIHonj tLHmRpIbO1qvcR1XEws9v7RIxPvf17lQ0mzReWe+9XI4QIBNV1zYoNt4/uLSiaKE2H71Uv j7vDNLRg/dh0ooVJc2GhpR1qYeTTnQ0GeQKNl2TPmXzsFO5uVjYqVdib92BfgHfVy+jJPI j+wkf/rsbvaHWselBTThcA+UpyvNXKdNniuv4P8fucarzRJuTRQaf7ee/AZkdUN9uLpmb0 fnEaDX5CsC9lS0e07WkKq/oCBUrYI7uupEuK4zToxhjm4ljpP2Diq9qf5ImVGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784127854; a=rsa-sha256; cv=none; b=ClQ0hoQsyXHh81xmSd9IStQRIaQsLtTdimSHEA/77S1gxQ4PeKOs7gUpwJohytipxeFmj2 9Ev4rjMLgTk0nVaN0qcoF8mu6zWUBj1NuzeMGv7dFNpbFk/Y47V+oI1BWll4waeMOWP42F C1fdPHfaD0eax0AnXdX77zq6zEN3MQhbAKzx8Mu/ra2ddg2AlDfu2djz+dkAbrCqgs3giq 9yVZSbva/VeHqT5wh6APGjNSaev0q2byi1pJnhIfBqzcbXUytuCk1Gepg/wOK+POiOu9NA m+48d0mNeRtfPs6leQ7sFTSvZ9Y41bViY9izzfVFqozxTVe/LZYQPUQxa7AyRA== 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=1784127854; 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=eqgqvLhKsrFPFNRpyszUjjkAQ5ytzlhWWawD+EwUm9U=; b=uVQB9JyR3NBcL90wsd801MX071Jse5zc8ZS0HjroUi0ZC63P129WkK/a0/cSqMAE4Nh5xN ZIyr+UQkpDW2NeuMAuZ+hAvkCo2ZwJT8k4UW0k8/fLuY+93JTDtMSVFN4e9daaZfAAuYUn FrahPcxIh2BbFdxjhidfQIYcGbZJjG757Qa1ZhYMoqU1XWjBuEAAAqqxA10oJLHKKTMFoe 3gxNQN98knkG9SnfIXdHpIEUef8Fz42R49kYM+8jtPLE2qaWIGBGSq+eZvGy2jPEZAT0Ec 0VNpljjC3rWdcvx2i3fa/aDw6t6MZgD6nvUCylvbqAkCVeFzyWv2mFev1F3W3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h0fb22fZyzcXW for ; Wed, 15 Jul 2026 15:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18312 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Jul 2026 15:04:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 4b0ae7e001a9 - main - stand: Recognize SHT_INIT_ARRAY sections as constructor sections 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 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b0ae7e001a97e5449835bb8a2e6c2e6f53aac39 Auto-Submitted: auto-generated Date: Wed, 15 Jul 2026 15:04:14 +0000 Message-Id: <6a57a16e.18312.5285197f@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4b0ae7e001a97e5449835bb8a2e6c2e6f53aac39 commit 4b0ae7e001a97e5449835bb8a2e6c2e6f53aac39 Author: Mark Johnston AuthorDate: 2026-07-15 14:58:32 +0000 Commit: Mark Johnston CommitDate: 2026-07-15 14:58:32 +0000 stand: Recognize SHT_INIT_ARRAY sections as constructor sections Pass such a section to the kernel using modinfo, otherwise link_elf.c won't execute constructors for the file. This is required for KASAN, otherwise redzones for global buffers are not poisoned during boot. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58244 --- stand/common/load_elf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index a6ea60c74b84..1c4efb8c4156 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -726,7 +726,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, uint64_t off) if (shstr) { for (i = 0; i < ehdr->e_shnum; i++) { if (strcmp(shstr + shdr[i].sh_name, - ".ctors") != 0) + ".ctors") != 0 && + shdr[i].sh_type != SHT_INIT_ARRAY) continue; ctors = shdr[i].sh_addr; file_addmetadata(fp, MODINFOMD_CTORS_ADDR,