From 5ea8daf89de65aafa797a4697c5fbede90306c31 Mon Sep 17 00:00:00 2001 From: brueffer Date: Thu, 3 May 2012 15:51:34 +0000 Subject: Check vplabel for NULL before dereferencing it. Fixes a panic when running atop with MAC_MLS enabled. Submitted by: Richard Kojedzinszky Reviewed by: rwatson MFC after: 1 week --- sys/security/mac_mls/mac_mls.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys/security') 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); -- cgit v1.1