From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ondrej Mosnacek Subject: [PATCH v3 3/4] selinux: remove some useless BUG_ONs Date: Fri, 25 Jan 2019 11:06:50 +0100 Message-ID: <20190125100651.21753-4-omosnace@redhat.com> References: <20190125100651.21753-1-omosnace@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBA694A4 for ; Fri, 25 Jan 2019 10:07:52 +0000 (UTC) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D15C8C0740F1 for ; Fri, 25 Jan 2019 10:07:51 +0000 (UTC) Received: by mail-wm1-f72.google.com with SMTP id f193so2086426wme.8 for ; Fri, 25 Jan 2019 02:07:51 -0800 (PST) In-Reply-To: <20190125100651.21753-1-omosnace@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: selinux@vger.kernel.org, Paul Moore Cc: linux-audit@redhat.com, Stephen Smalley List-Id: linux-audit@redhat.com These BUG_ONs do not really protect from any catastrophic situation so there is no need to have them there. Signed-off-by: Ondrej Mosnacek --- security/selinux/avc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/security/selinux/avc.c b/security/selinux/avc.c index 5ebad47391c9..478fa4213c25 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -1044,7 +1044,6 @@ int avc_has_extended_perms(struct selinux_state *state, int rc = 0, rc2; xp_node = &local_xp_node; - BUG_ON(!requested); rcu_read_lock(); @@ -1134,8 +1133,6 @@ inline int avc_has_perm_noaudit(struct selinux_state *state, int rc = 0; u32 denied; - BUG_ON(!requested); - rcu_read_lock(); node = avc_lookup(state->avc, ssid, tsid, tclass); -- 2.20.1