From nobody Tue Nov 10 19:54:21 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 4jPHRK2hPGz6vMCf for ; Tue, 10 Nov 2026 19:54:21 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jPHRK1n2Nz3NGY for ; Tue, 10 Nov 2026 19:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794340461; 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=VOmR8+MVdPqrK+uDmUC82gB6VcU3fUn+qnXdzgytEck=; b=xOOz9lYWw4+qYaw3vYABX+VF3qlACvwoJlpW3XX4NAnzV5rcF4rcTNB+I1eRlFkHa5hXid ZU0w+jPJvW2j+R2QQc3ASJ8NMzEsY+rncjR7YaJdb4Tj+/8+tY5HEiQEV0qhx2H0dTrI5e H53hyw1lhaam15qNIpGGSDOq2O5WnpfWv1gnRy2IrLm55GbLt32Ru1FUeyUhyxrLPmMA8D ITTn7CeAaynN2Jxrv0VNlAzRUKLksXErS9v7iDFbsArzzGAHaa069JIS6bFQa2ZPK9ulmz ef9AhIPTj+Hiwpdi74vTSt4WV6SNViBX2Fq8fxDfi/p56zuQLGPw0QAUM4qTPQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794340461; b=e1wAf/XECWB3DZogCUt1kUb4r3OA4wQpX0ZIBUxD9DuWIowXtHjeiTYxS1XlQ3XqLkp0bF GhMsyiSGGy388bmgFYFLZcDKw1pnM9eKNugI3OAE5IVFH0D5uqzwj9F/wrFIarvYUZkHzH ATd6uZjNWmWYU3QZL+fxp5A8rAHL+0OgIkkD92FLIDi/NwHxN2kq1UNRtsOhT5nXEvTctm KgwtJdKeXseb4v/vWq4BDKZTk0eChujOJmgAw5p07/sGt5CxSiseMAfDu60HIOkceODtcR 3wpC6JIV7CO6jm+4pURSwrH/XDwmnhqU64mqYJXTaV4qaPtEU0VJrNxYE3a/yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794340461; 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=VOmR8+MVdPqrK+uDmUC82gB6VcU3fUn+qnXdzgytEck=; b=YuLbsBK+kqF5CW7i/Dnd0DoX2GTJnK0OPrtWJKbwRjTS4mHGJspwJwfTFi8dI69BWG0HRf y/B53Vgt2z7BMfumNWHIlftYlG+haYL5ruZ99hf7xkF17hHwE5TCJcs/aJxyJWUALH8Wvq aV/gXb4Qd2ZBPtFznnoKJsuWpcW5zniIwWxlvbI6iPC7b6YlSGIO0gxXD4pX7Gyl8pb0Fu TY1ue9lslydPI3eKYt1aHwQn0/jU9uJczB+iEtDuPvn8FegCwl2W7PCefj8J9nGamkViCj BDDxAraXW01McnP8lTC8JE7GvJlXDmyCozsnxnInjiXulq+w0BVJJkcKlMPQwg== 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 4jPHRK1R04zk01 for ; Tue, 10 Nov 2026 19:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2a01 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 10 Nov 2026 19:54:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5feb271df85f - main - namei(9): fix two ni_startdir leaks List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5feb271df85fe6bd968052d5bdd02b6d80335610 Auto-Submitted: auto-generated Date: Tue, 10 Nov 2026 19:54:21 +0000 Message-Id: <6af3766d.2a01.f129457@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5feb271df85fe6bd968052d5bdd02b6d80335610 commit 5feb271df85fe6bd968052d5bdd02b6d80335610 Author: Konstantin Belousov AuthorDate: 2026-11-10 00:49:33 +0000 Commit: Konstantin Belousov CommitDate: 2026-11-10 19:53:27 +0000 namei(9): fix two ni_startdir leaks namei() leaks the caller's ni_startdir reference on the empty-path ENOENT return and on namei_getpath() failure. On ZFS with the default zfs_xattr_compat=1, an empty user-namespace extattr name on a file that has an xattr directory leaks one reference on that directory per call. Reported by: llm-postcr Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61366 --- sys/kern/vfs_lookup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 2960d3aafb92..6fb1d33a0e37 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -681,11 +681,14 @@ restart: */ MPASS(cnp->cn_pnbuf != NULL); error = 0; - } else + } else { error = namei_getpath(ndp); + } if (__predict_false(error != 0)) { namei_cleanup_cnp(cnp); nameicap_cleanup(ndp, error); + if (ndp->ni_startdir != NULL) + vrele(ndp->ni_startdir); SDT_PROBE4(vfs, namei, lookup, return, error, NULL, false, ndp); return (error); @@ -746,6 +749,8 @@ restart: } namei_cleanup_cnp(cnp); nameicap_cleanup(ndp, ENOENT); + if (ndp->ni_startdir != NULL) + vrele(ndp->ni_startdir); SDT_PROBE4(vfs, namei, lookup, return, ENOENT, NULL, false, ndp); return (ENOENT);