From nobody Thu Sep 26 06:05:08 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 4XDjkD5wtvz5YGSt; Thu, 26 Sep 2024 06:05:08 +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 4XDjkD39X8z4m9p; Thu, 26 Sep 2024 06:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727330708; 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=wxwd7zf2doNkHelNqK6yI2Kx8gJ/91by93b2Vqkr6C4=; b=EWyC4YR80UZO+VXVwxbCgk+lF8v/MuUIQu6vna/pcdUB240oRjbpixhL7AUaAPpjOd/AhC lIYIcTwBrPestnYIqpr7KOcqSvdGCPBOUZjwfEZp2F74G/OLPCgUt3QGLyRe1as8t/THwF N2L1Fkbzv/FCYIczdSOqxjgvHXU9b0R1ygNuNu0l8YHDiFvDbTL5nib4xckyt+Uac3kDCY lCfa139s2QisQpszUnxJNP5xXFf5N9wJ/F1+0faLhht4zS24TZWKBld0ipVsRIHB0FxDQT pAyM/jwwfjzPUT368G43AMjMpl+DKaMwQ4ANZimjdKFqYya0QOq3zN2lkhShwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727330708; 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=wxwd7zf2doNkHelNqK6yI2Kx8gJ/91by93b2Vqkr6C4=; b=A/+F5z1IJnNJvqfdXSY+6XtpOaj/+OthVH6gXUqUnDFgB4X2qK/K16m378I+7974Gun7mb 78XhkqbYPlMISKilHrecv0pnfcMV3tZYzALMgKbZwe11QT+LxOIGmTUrLLCuljA75eBS/x y6PCuOVySYYJBPiDanhnaMV52F8t1RAW3DjlfK2k9Q09A6YGU5SuB7L46+hGWvYwbuTKCX c6yHjDXHb4y8/up3UFZiY+YgiYLzvGhrP7r+dZC7UkbmZVbqNkURSDzzuO81+3mP7iwPTX wP+uIRSsgie+UH4i1f7qbNQmlCe0zD2QuMVpLi6FZ1ZAPxLZvf1UUFWkYLzkCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727330708; a=rsa-sha256; cv=none; b=ZQYr41fTuOYsTL3vc0NR5EzyoUvdY85hd9ah00SNFi0vdtqP9QhOInBcZGJ4Hb/EVanmOW S9OYVLI9Km16tfGd0BTbw3QrtGwuxI0CfZjisFyGRWxL1rz48EwileFxSlstKF0bma4Wi/ WIj+YfKMZUQwxOAA3I9EZ6TWAby9SAST6hB8igXHwhaMrq8Dq18TnKS6fW/O1OUKt+PZAu u+yeX4ywE2f+EKxCl3WHp2dkOvhY03swniXlziPEHRx06B/fhZ4QCcnS8fAeEVeE8SrcHw xWdbCp4fiVljWR5AyRzB8GehtstwMvEf8J6ZXC7q1An5CmIcOJWg8N4zV1oAXA== 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 4XDjkD2nXjzlSG; Thu, 26 Sep 2024 06:05:08 +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 48Q6581D053817; Thu, 26 Sep 2024 06:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48Q658Gp053814; Thu, 26 Sep 2024 06:05:08 GMT (envelope-from git) Date: Thu, 26 Sep 2024 06:05:08 GMT Message-Id: <202409260605.48Q658Gp053814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 3f2792166aee - main - MAC: improve consistency in error handling 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f2792166aeed4baf07d351bcb12a9d196c443eb Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3f2792166aeed4baf07d351bcb12a9d196c443eb commit 3f2792166aeed4baf07d351bcb12a9d196c443eb Author: Michael Tuexen AuthorDate: 2024-09-26 06:02:06 +0000 Commit: Michael Tuexen CommitDate: 2024-09-26 06:04:54 +0000 MAC: improve consistency in error handling Whenever mac_syncache_init() returns an error, ensure that *label = NULL. This simplifies the error handling by the caller. Reviewed by: rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46701 --- sys/security/mac/mac_inet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/security/mac/mac_inet.c b/sys/security/mac/mac_inet.c index 29a355071065..9770fa840f95 100644 --- a/sys/security/mac/mac_inet.c +++ b/sys/security/mac/mac_inet.c @@ -485,6 +485,7 @@ mac_syncache_init(struct label **label) MAC_POLICY_PERFORM_NOSLEEP(syncache_destroy_label, *label); mac_labelzone_free(*label); + *label = NULL; } return (error); } else