From nobody Fri May 1 20:28:20 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 4g6jKj2vK2z6cDWc for ; Fri, 01 May 2026 20:28:25 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g6jKj1zXQz3fsh for ; Fri, 01 May 2026 20:28:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777667305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ODMBc30G5j/BLsW0pvAUKNOEwjqtDsG8cPiKr+Caehs=; b=JWX72Eccji+3ezKIOqmlLkjcH2SPn/dFegvta52Mv3ull1KJTJuPHFJUoAjQ5zVBn7Lge7 3Y9cKy7nU/WnMWWPM2Rb0x8iP0UynCblA484EfxEtUzuH2xJlARLnrS4f9v8i+qiEtHTVI oIX7mvjN3qI/n337SbU50n0aw/CWOlPbze/xxmTtbepF5rstkfwLBjY1QgtAkqGYj5gV69 b5OlfwHU8zxJDYETiBUi6gygyAi+rh8fcT6gHORVNTZPcIhuB9FBxzbUuBLNjyYA/Z7i7G edi1xiKdwQ4ZfT792bdww9DvEf9PjX2ardTQgj0iWVeCCTlEEvJzB16QXwyAKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777667305; a=rsa-sha256; cv=none; b=Ag5Nbr8NpXA7WxY4qxtyhYDx/GQosrMqzEgc6g0mtSZJkcq0QhX01BCTBEeJ6S9QS4DEes 2KEDK9n/LL3dI6xfRrnLbkn9YpS/7+duML5CFhYDdLb1V7A0QGlH+xnvwzfT0Uz0Ivrz0X 245EtkJIPh0ArdM25Nzkd196c+IKj1FfAMM5wfgGPz9+kZGPlXey+4SaYK8nQ3GtI3nO/j KL1s3S36wVQHfa+EAenWNk8Q7cR4BKmTq6c9WrGUzaXT4e/wSDIftx5XDM5g+Nr67nWA9w 4FE1GWlNBJhzKr8Bty+LjL+OpT1Um0mn6R+7lCosC4uecAtUSzgWUpJz2/CZbQ== 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=1777667305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ODMBc30G5j/BLsW0pvAUKNOEwjqtDsG8cPiKr+Caehs=; b=U1j8oO3sDt38tr68VH9HNzATH0tGRUVfsGJnB5+AyHMPnVrXUy8P1RcAwZHLLPRSEEWrYT mb7KziL+Mufoytgo8ameK2YLpLrjv5hVl2PQ8H3dCRn9EdtxD8GiFp6OFaXII/X+sSnJjA jy8gY36pzemIi5it0pHm3NE/O+5ZG9OVMY9l/+R1rvXGokkyJmYh8uGLeR6Q6vRDlC+ISK QSY4CVcPa9r0FAELc4qelpCJpHFrIMRUJlTTugSj3XgxqvZQqOuJkplyrrtvz+8SSa5I9e ooDdl1wY6KxDTWb87TJo/Yj4/3C2/2SH6mpmGwgS7lLvzOMQLQu8Gv54LlFQow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g6jKj1Gcrz1CYS for ; Fri, 01 May 2026 20:28:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4264f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 01 May 2026 20:28:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Ricardo Branco From: Pouria Mousavizadeh Tehrani Subject: git: 459ac3044b51 - main - namei: Preserve ABI root for absolute symlinks before fallback 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 459ac3044b516af698d7342431bdbcf784fdf7a4 Auto-Submitted: auto-generated Date: Fri, 01 May 2026 20:28:20 +0000 Message-Id: <69f50ce4.4264f.6104aee4@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=459ac3044b516af698d7342431bdbcf784fdf7a4 commit 459ac3044b516af698d7342431bdbcf784fdf7a4 Author: Ricardo Branco AuthorDate: 2026-04-26 16:44:39 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-05-01 20:27:36 +0000 namei: Preserve ABI root for absolute symlinks before fallback D40479 changed namei() so that an absolute symlink target encountered during an ABI-root lookup restarts from the native root. This helps the native fallback case, but it also makes successful lookups inside an ABI root escape that root while following absolute symlinks. Only switch absolute symlink lookup to the native root after namei() is already in the restarted/native fallback pass. Do not mark the lookup as restarted merely because an absolute symlink was encountered while still resolving inside the ABI root. This preserves the intended native fallback behavior while keeping absolute symlinks within a successfully resolved ABI-root path in the ABI namespace. Signed-off-by: Ricardo Branco PR: 289739 Reviewed by: kib Fixes: cea7c564c70a ("namei: Reset the lookup to ...") Pull-Request: https://github.com/freebsd/freebsd-src/pull/2166 --- sys/kern/vfs_lookup.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 39c7da803de1..c1363c0104d3 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -778,13 +778,17 @@ restart: cnp->cn_nameptr = cnp->cn_pnbuf; if (*(cnp->cn_nameptr) == '/') { /* - * Reset the lookup to start from the real root without - * origin path name reloading. + * For ABI-root lookups, preserve the ABI root while + * following absolute symlinks during the first lookup. + * + * Only force the real root after the ABI lookup has + * already failed and namei() has restarted in the + * native namespace. Otherwise absolute symlinks inside + * /compat/linux, including the ELF interpreter symlink, + * incorrectly escape to the native root (PR 289739). */ - if (__predict_false(ndp->ni_rootdir != pwd->pwd_rdir)) { - cnp->cn_flags |= ISRESTARTED; + if ((cnp->cn_flags & ISRESTARTED) != 0) ndp->ni_rootdir = pwd->pwd_rdir; - } vrele(dp); error = namei_handle_root(ndp, &dp); if (error != 0)