apparmor: replace remaining BUG_ON() asserts with AA_BUG()
AA_BUG() uses WARN and won't break the kernel like BUG_ON().
Signed-off-by: John Johansen <john.johansen@canonical.com>
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 6834000..41073f7 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -91,7 +91,7 @@
{
struct aa_loaddata *data;
- BUG_ON(copy_size > alloc_size);
+ AA_BUG(copy_size > alloc_size);
if (*pos != 0)
/* only writes from pos 0, that is complete writes */
diff --git a/security/apparmor/audit.c b/security/apparmor/audit.c
index 0c81ff64..87f40fa 100644
--- a/security/apparmor/audit.c
+++ b/security/apparmor/audit.c
@@ -119,7 +119,7 @@
int aa_audit(int type, struct aa_profile *profile, struct common_audit_data *sa,
void (*cb) (struct audit_buffer *, void *))
{
- BUG_ON(!profile);
+ AA_BUG(!profile);
if (type == AUDIT_APPARMOR_AUTO) {
if (likely(!aad(sa)->error)) {
diff --git a/security/apparmor/context.c b/security/apparmor/context.c
index 71e9910..1fc16b8 100644
--- a/security/apparmor/context.c
+++ b/security/apparmor/context.c
@@ -95,7 +95,7 @@
{
struct aa_task_ctx *ctx = current_ctx();
struct cred *new;
- BUG_ON(!profile);
+ AA_BUG(!profile);
if (ctx->profile == profile)
return 0;
@@ -166,7 +166,7 @@
struct cred *new = prepare_creds();
if (!new)
return -ENOMEM;
- BUG_ON(!profile);
+ AA_BUG(!profile);
ctx = cred_ctx(new);
if (!ctx->previous) {
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index fc82ac0..0dd4818 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -406,7 +406,7 @@
struct aa_profile *profile, *fprofile = aa_cred_profile(file->f_cred);
int error = 0;
- BUG_ON(!fprofile);
+ AA_BUG(!fprofile);
if (!file->f_path.mnt ||
!path_mediated_fs(file->f_path.dentry))