diff options
author | brueffer <brueffer@FreeBSD.org> | 2012-05-03 15:51:34 +0000 |
---|---|---|
committer | brueffer <brueffer@FreeBSD.org> | 2012-05-03 15:51:34 +0000 |
commit | 5ea8daf89de65aafa797a4697c5fbede90306c31 (patch) | |
tree | 0e96613872af600c8079c5702e215e599a103111 /sys/security/mac_mls | |
parent | 5561327018c6001c4ee05586abe423c739837676 (diff) | |
download | FreeBSD-src-5ea8daf89de65aafa797a4697c5fbede90306c31.zip FreeBSD-src-5ea8daf89de65aafa797a4697c5fbede90306c31.tar.gz |
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
Diffstat (limited to 'sys/security/mac_mls')
-rw-r--r-- | sys/security/mac_mls/mac_mls.c | 3 |
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 8ffa76b..ff9084e 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); |