From nobody Tue Nov 25 13:49:40 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 4dG3w50VDmz6JB8Q for ; Tue, 25 Nov 2025 13:49:41 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dG3w44bllz3KLl for ; Tue, 25 Nov 2025 13:49:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764078580; 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=hSIu8O5tIhKpvK0f33YxwfFoq4uEeVgsaORVcJJVcmQ=; b=X3BCE7aJZ+Zs6Vjo8sSxDp6KkU3dlx5BF0hVUK8FF4KM74IYdTBKtXLlCGgLz+a5DsrdcD QYjP9SR5CjVqFOGUtp0z4cF1JQEiWLYaVGSAtG27Aal3UVML6pJmd4iVGFd07Pi5QxT53b LtdS5v6PDwlxqAdcRJTruASuPMZwoWkA5nbltl00JqhrVfaqJ7LUv1wR0KAb6sEWfjbYRq dC1yg2TspVeEKBVqzZQKZG/6y1I0T2OVlZSZzeUkEbWB5tLyRLG8QhzsSBlfuU1Ccs4RQ3 1ZRFNdvdwFpzZ3T+ifN2DV+pXXU487cOH8ArJ07Dgn+UKD36qqcu2HKBYfq4IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764078580; 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=hSIu8O5tIhKpvK0f33YxwfFoq4uEeVgsaORVcJJVcmQ=; b=vjwqAslKr2y3TzjdfCMBN88X6G4GvL1+5jKyrQddXa5M3CcKKWHKpvE5G7db0B2TShPHfm iaQNufcVTNNbqFIjZ9yk+Bt2G5IFNNa3Pr+6+5jV63chKg/Fx8z1k4FnqWnz0RqbADsbsk kWjdtxHg9QE9Z4u8r+jUMcTGLCfCNPS2kVs+YzjHYTBL6Z3KwSnYGyPnZDBsgIF/o3vxnR tYSLZY+9HhfvaWR9DcrqPKfsHGWW1IJ0T+lnsZP3RC3AXSyyxei2BGgTR/xAwkjEbhfo4H E26+kGV9bjQC8xz2+LOrh112rOgvkINb74Ch1nRf2kjZ7W7ia0mUWsEfCV3ZHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764078580; a=rsa-sha256; cv=none; b=jEkPb930hHdPhq4XvN3xwIoLGAYOwSCa17HTeHZXDdiKdiVRaoNMyom8g6DxBSxvPbBWgi ne38MgdfpPuTvfNT6bIDse+JFMjiM+RGlnzMjbvw1ZQLmRpvJtOxFTcQ5mOERsoATyFwxv 5jMWHdByNfmSb5CBGqkeSXuzMqQHvN0uyxt8MTA3lUDSm7d6LdpjRqQmoKL0u0+qBt9bEN fesd+rjkaJbW6iwbO4F0eRBzQdFAzAjGjGSrfo7uonwYlGMKZn1Se01tuC2+auB+HjI/hE uIlm4L6Nex88ZZhE0lUBpQB5nWA4hEtdXmtrfBmkS1gPw2P8nvf50M21/FLj4w== 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 4dG3w448M3z13Kt for ; Tue, 25 Nov 2025 13:49:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2c48c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 25 Nov 2025 13:49:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9562994a7aac - main - kernel linker: Disable local sym resolution by default 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9562994a7aacee2baae6ddee1a7b558b48ae39ef Auto-Submitted: auto-generated Date: Tue, 25 Nov 2025 13:49:40 +0000 Message-Id: <6925b3f4.2c48c.61345a6b@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9562994a7aacee2baae6ddee1a7b558b48ae39ef commit 9562994a7aacee2baae6ddee1a7b558b48ae39ef Author: Ed Maste AuthorDate: 2024-11-25 19:05:54 +0000 Commit: Ed Maste CommitDate: 2025-11-25 13:49:20 +0000 kernel linker: Disable local sym resolution by default In 95c20faf11a1 and ecd8245e0d77 kib introduced support to have the kernel linker stop resolving local symbols from other files, but did not enable it by default to avoid surprises. Flip the default now, before FreeBSD 16.0. The debug.link_elf_leak_locals and debug.link_elf_obj_leak_locals sysctls are available to revert to the previous behaviour if necessary. PR: 207898 Reviewed by: bz Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47742 --- UPDATING | 9 +++++++++ sys/kern/link_elf.c | 2 +- sys/kern/link_elf_obj.c | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/UPDATING b/UPDATING index aaef0e5b4cd3..7f0cb44181d3 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20251125: + The `debug.link_elf_leak_locals` and `debug.link_elf_obj_leak_locals` + sysctls now default to 0, so the kernel module linker no longer + performs symbol resolution against local symbols from other modules. + + If a kernel module now fails to load because of an unresolved symbol, + set these sysctls to 1 and file a bug report including details about + the affected module. + 20251115: The FreeBSD-base repository is now defined in /etc/pkg/FreeBSD.conf, disabled by default. In -CURRENT and -STABLE this points at nightly diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index ebd203858b66..f910fc3d5df5 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -203,7 +203,7 @@ static struct linker_class link_elf_class = { link_elf_methods, sizeof(struct elf_file) }; -static bool link_elf_leak_locals = true; +static bool link_elf_leak_locals = false; SYSCTL_BOOL(_debug, OID_AUTO, link_elf_leak_locals, CTLFLAG_RWTUN, &link_elf_leak_locals, 0, "Allow local symbols to participate in global module symbol resolution"); diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index a3a53a39bfd6..759cd75cba31 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -192,7 +192,7 @@ static struct linker_class link_elf_class = { link_elf_methods, sizeof(struct elf_file) }; -static bool link_elf_obj_leak_locals = true; +static bool link_elf_obj_leak_locals = false; SYSCTL_BOOL(_debug, OID_AUTO, link_elf_obj_leak_locals, CTLFLAG_RWTUN, &link_elf_obj_leak_locals, 0, "Allow local symbols to participate in global module symbol resolution");