diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-05-03 21:38:23 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-05-03 21:38:23 +0000 |
commit | 02791e2fb128bd61ef8152c23299d7603690fb12 (patch) | |
tree | 0423a5519b97f74144fc7eb6e1d0f58ab876fd49 /sys/security | |
parent | 8e85a8db2610b028c5d21ae1bd674c3bda2da05c (diff) | |
download | FreeBSD-src-02791e2fb128bd61ef8152c23299d7603690fb12.zip FreeBSD-src-02791e2fb128bd61ef8152c23299d7603690fb12.tar.gz |
When performing label assertions on an mbuf header label in mac_test,
test the label pointer for NULL before testing the label slot for
permitted values. When loading mac_test dynamically with conditional
mbuf labels, the label pointer may be NULL if the mbuf was
instantiated while labels were not required on mbufs by any policy.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, McAfee Research
Diffstat (limited to 'sys/security')
-rw-r--r-- | sys/security/mac_test/mac_test.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c index b02b36a..d1f54ee 100644 --- a/sys/security/mac_test/mac_test.c +++ b/sys/security/mac_test/mac_test.c @@ -104,8 +104,9 @@ SYSCTL_INT(_security_mac_test, OID_AUTO, enabled, CTLFLAG_RW, SLOT(x) == 0, ("%s: Bad INPCB label", __func__ )) #define ASSERT_IPQ_LABEL(x) KASSERT(SLOT(x) == IPQMAGIC || \ SLOT(x) == 0, ("%s: Bad IPQ label", __func__ )) -#define ASSERT_MBUF_LABEL(x) KASSERT(SLOT(x) == MBUFMAGIC || \ - SLOT(x) == 0, ("%s: Bad MBUF label", __func__ )) +#define ASSERT_MBUF_LABEL(x) KASSERT(x == NULL || \ + SLOT(x) == MBUFMAGIC || SLOT(x) == 0, \ + ("%s: Bad MBUF label", __func__ )) #define ASSERT_MOUNT_LABEL(x) KASSERT(SLOT(x) == MOUNTMAGIC || \ SLOT(x) == 0, ("%s: Bad MOUNT label", __func__ )) #define ASSERT_SOCKET_LABEL(x) KASSERT(SLOT(x) == SOCKETMAGIC || \ |