aboutsummaryrefslogtreecommitdiff
path: root/sys/security/mac_mls
diff options
context:
space:
mode:
authorChristian Brueffer <brueffer@FreeBSD.org>2012-05-03 15:51:34 +0000
committerChristian Brueffer <brueffer@FreeBSD.org>2012-05-03 15:51:34 +0000
commite623c22083cf2736906658f78ce6b75e6700f5f0 (patch)
tree0e96613872af600c8079c5702e215e599a103111 /sys/security/mac_mls
parent99fb123f8d95c80945aba9f7599519f5ea3bb054 (diff)
downloadsrc-e623c22083cf2736906658f78ce6b75e6700f5f0.tar.gz
src-e623c22083cf2736906658f78ce6b75e6700f5f0.zip
Check vplabel for NULL before dereferencing it. Fixes a panic
when running atop with MAC_MLS enabled. Submitted by: Richard Kojedzinszky <krichy@tvnetwork.hu> Reviewed by: rwatson MFC after: 1 week
Notes
Notes: svn path=/head/; revision=234957
Diffstat (limited to 'sys/security/mac_mls')
-rw-r--r--sys/security/mac_mls/mac_mls.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c
index 8ffa76b597f3..ff9084e870f8 100644
--- a/sys/security/mac_mls/mac_mls.c
+++ b/sys/security/mac_mls/mac_mls.c
@@ -2028,6 +2028,9 @@ mls_system_check_acct(struct ucred *cred, struct vnode *vp,
if (!mls_enabled)
return (0);
+ if (vplabel == NULL)
+ return (0);
+
subj = SLOT(cred->cr_label);
obj = SLOT(vplabel);