mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 22:02:58 -04:00
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
This commit is contained in:
parent
9db1cbd1cf
commit
6fe7c20e6e
1 changed files with 3 additions and 2 deletions
|
|
@ -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 || \
|
||||
|
|
|
|||
Loading…
Reference in a new issue