From nobody Tue Oct 29 18:57:01 2024 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 4XdKHf19S6z5bn8g; Tue, 29 Oct 2024 18:57:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XdKHd6xWyz47Q3; Tue, 29 Oct 2024 18:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228222; 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=EIJI00Kf6VCMeffTWJNB86c2LeXWG6snXuajcVa2HuY=; b=GhS7dHMi7zX7cmt38ks6WJfOvuVbvoZFshxzdPw9zuxqBhzbkiignqC0neo6jXquvku8to HnyFbRA1jSmLQx7EmuGlhGZqY8Co0YXvMyuMBaUMHHDYUdYZRcXFlpNRSN+wGSBDy3khCr xcjwgRBe9W7ACw3qHP2ZNGC3eb+1tH2LtF+JEn8akJ4AxVFo6EDTuxYE3WBR6SCqr6OLFX KX23p2uPAJZXUg4mGeKPzZQDcO7f6IiFemfoaX3GhlDEyNgtB69sPCqdfQ1uPQQ51znelI liFH+/yy9em42pMF88SRTH4wTGzC1S1FBCUzeTg2bqJGz1Qc3MLLpqp6HSTRiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730228222; 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=EIJI00Kf6VCMeffTWJNB86c2LeXWG6snXuajcVa2HuY=; b=Gi+eK7CFIUdt5GTArObQFLXQCjdl4YygJxfP8kiWQZ7RTINnn1kO8nMY7ea9nvZk84OhmQ 8OSR8r5vb34YeTLg1IdkQy3Zy6rNoM24xC0vEDSXg6M8PUdkJVkzrbmgp5x6cw2s2KlcTC FYWVEA+YaJhA5GLJumnFBC6LagdPecFTiBpiU7Yg6Np36cYqPywT+OzY79Rzo9+wl8aom0 VvR4hMkaX5HYA7zOjd74gXnZKlEXqMW54NiG6R6+GwUyIGIi/tlb+JcQTuOvD8JQRteCAh fxKn3bzQgVsiItFLHVjOH2+i7kB2ah9t7nrirzQgytGpzgORSOFJ3ed5AKVFIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730228222; a=rsa-sha256; cv=none; b=Umu/qZ70tER8T6YXoKLkTXhnLVQxMe84+BnrisX3h1vCuWcBaWlkWMN2lW7vyL00kVF0gL xxBEHK13WvIv7P3SZmLYFm7EkRgD9gtinPLAreJ0vnBVFk+q99V1BP55hzPTaUxJ0b4PAi DQ0a7ft6kId5upno0YlBXZah/FRKx5Hxav0kcyANf2valmjc1zlR3z5lMFePkAxZ0Y+H6h 0XdQXWGOte+c42Yhz+ECe4kXBBZMAww9aO2VkYpv50oc5yiCGqSYoVlFVWFMJIcaeH+/FU fG0CWOfXRLhN4txDxcqApIx9ERYaQBv77cCkI7imvAnYIn35nyGtw0nvXZ19MQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XdKHd6Xz9zbh9; Tue, 29 Oct 2024 18:57:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49TIv1si036572; Tue, 29 Oct 2024 18:57:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49TIv16v036569; Tue, 29 Oct 2024 18:57:01 GMT (envelope-from git) Date: Tue, 29 Oct 2024 18:57:01 GMT Message-Id: <202410291857.49TIv16v036569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: accf8cee6dd0 - releng/14.1 - pam_xdg: Fix user xdg runtime directory's descriptor leak 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: accf8cee6dd09bc2d0a02cf45ec4386ec42970bf Auto-Submitted: auto-generated The branch releng/14.1 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=accf8cee6dd09bc2d0a02cf45ec4386ec42970bf commit accf8cee6dd09bc2d0a02cf45ec4386ec42970bf Author: Olivier Certner AuthorDate: 2024-08-13 21:04:09 +0000 Commit: Ed Maste CommitDate: 2024-10-29 18:56:03 +0000 pam_xdg: Fix user xdg runtime directory's descriptor leak Approved by: emaste (mentor) Fixes: 6e69612d5df1 ("pam: Add pam_xdg module") MFC after: 3 days Security: FreeBSD-EN-17.pam_xdg Approved by: so Sponsored by: The FreeBSD Foundation (cherry picked from commit 06986e899972ac3a127ab2ab46196672d0e1e5b2) (cherry picked from commit 9e8d504bb5a1e7ede55814069e213d4702172b81) --- lib/libpam/modules/pam_xdg/pam_xdg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index 4d586a21566a..1ad7c56dddb5 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -108,6 +108,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, goto out; } } else { + close(rt_dir); /* Check that the already create dir is correctly owned */ rv = fstatat(rt_dir_prefix, user, &sb, 0); if (rv == -1) {