git: c7e7794e9546 - stable/13 - MAC: improve consistency in error handling
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 31 Oct 2024 16:46:45 UTC
The branch stable/13 has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=c7e7794e954604048ecfe9468237b2bb3d95bd1c
commit c7e7794e954604048ecfe9468237b2bb3d95bd1c
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-09-26 06:02:06 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-10-31 16:45:49 +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
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D46701
(cherry picked from commit 3f2792166aeed4baf07d351bcb12a9d196c443eb)
---
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 231887e4e73c..c88d573719a6 100644
--- a/sys/security/mac/mac_inet.c
+++ b/sys/security/mac/mac_inet.c
@@ -474,6 +474,7 @@ mac_syncache_init(struct label **label)
MAC_POLICY_PERFORM_NOSLEEP(syncache_destroy_label,
*label);
mac_labelzone_free(*label);
+ *label = NULL;
}
return (error);
} else