From nobody Fri May 16 22:20:09 2025 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 4ZzhN96Q3Sz5wQf6; Fri, 16 May 2025 22:20:09 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZzhN95d9Xz3Sgw; Fri, 16 May 2025 22:20:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747434009; 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=Usbs1TiBX4klk9oM6vEFlVifLbD8VwSt2RLFS3EJo9U=; b=s1STlEoYHx9XnMPNjfD4oO5MyRegOZk+NDqZg6iSLxv/wRYzzVDXRxoKX1WCVefFfkDOC6 N9dEyvvikdpW9W8H6L+o/wiK49aUdPP7Cd5O5tQdaxrP5rOveHM1pGboA+9srPTflbZ4SQ leBpijfo5RJXqCCmXsI/IXT8r5jwhFJtN8lFmALGwIPqiw0IlXcLqoboTna6Ms4EwZ9QG0 dudng/aG8yPzSiloWE0rdbgnjLuwuYOrEw9FC53h35ijaq5phlkG0wt+0aZhHNIq9sjrFJ /UJa8xG7bGWyQ8A23w/mHywBm1b1dSHNwqUcv+75/UaSxGuz7OutcFE8RkZ3Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747434009; 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=Usbs1TiBX4klk9oM6vEFlVifLbD8VwSt2RLFS3EJo9U=; b=aDDVtbjKOxVGESYTjAmvcshN77qW1OZoD1DS/VnnqWt9Y44LbTr9rDoOoctn4eLXfNr78C T9N+dGJG/153VDd34+lJQZwMruKV8rdGCmkNN76qRrgcASkEa6ImrjVN147/hX8+t5qzeh fFUNOcSW7T/VmjbjPSaRY90VEX5UA0wqWoKR3vC//4wqB6iSLPjGUxm9nNWA9P/xZl8yC+ LPANmB7iDrPs+lGHbMGH73gC20rxQzikht1EHeJWliLJxwbebFuMx4ICIzfUR58xF6xYju Qs1TKgtdPhSUc+gNpOHHGlS8UmcEn5yvrcIuu+PrtotgP+2+8oMTwjb505JZmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747434009; a=rsa-sha256; cv=none; b=LjUEBS8zOqJPa2LMGpXejl7lrPbYvQJOW3q8OxQ7SYhOVfgNOK92k2WSo7TAVIXd1sDRTe O8mXxjmmDx+II9/KZ3agK4dL5EBnDbxJthQnOl1KfPNHU2GNy7DHmYKf2SZtSJe3P2xMp3 lhdAsFvty/Ulj/W9+xuoxaJH+qrbNqsetofF4hjacoXlRF3iD/41dbA2Qo8mshIK9YwthP mJWUHJr3Bs0jOuWUV/h3HlYCETQgyDVLC1psX6qbLNkplyF33whoWgEQtzBGSPrD1ICk1q ItdrZbMWvNo1sPaHIbkt6MYr0eb7N1qm/TfcA38/ia61OS1PDTTPsoo0foxk9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4ZzhN94mXlz6R3; Fri, 16 May 2025 22:20:09 +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 54GMK9gl045301; Fri, 16 May 2025 22:20:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54GMK990045296; Fri, 16 May 2025 22:20:09 GMT (envelope-from git) Date: Fri, 16 May 2025 22:20:09 GMT Message-Id: <202505162220.54GMK990045296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 496b3c3a1ce8 - main - grantbylabel_syscall check p_textvp != NULL 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: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 496b3c3a1ce86b72f56bec993b76bdd64723ee46 Auto-Submitted: auto-generated The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=496b3c3a1ce86b72f56bec993b76bdd64723ee46 commit 496b3c3a1ce86b72f56bec993b76bdd64723ee46 Author: Simon J. Gerraty AuthorDate: 2025-05-16 22:19:06 +0000 Commit: Simon J. Gerraty CommitDate: 2025-05-16 22:19:06 +0000 grantbylabel_syscall check p_textvp != NULL kernel process will not have valid p_textvp Reviewed by: stevek Differential Revision: https://reviews.freebsd.org/D50368 --- sys/security/mac_grantbylabel/mac_grantbylabel.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/security/mac_grantbylabel/mac_grantbylabel.c b/sys/security/mac_grantbylabel/mac_grantbylabel.c index af080e8e34e0..c40885773222 100644 --- a/sys/security/mac_grantbylabel/mac_grantbylabel.c +++ b/sys/security/mac_grantbylabel/mac_grantbylabel.c @@ -409,6 +409,10 @@ cleanup_file: proc = pfind(gbl_args.u.pid); if (proc == NULL) return (EINVAL); + else if (proc->p_textvp == NULL) { + PROC_UNLOCK(proc); + return (EINVAL); + } proc_locked = 1; } gbl_args.gbl = (SLOT(proc->p_textvp->v_label) |