summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2017-01-16 03:43:15 -0500
committerJohn Johansen <john.johansen@canonical.com>2017-01-16 04:18:56 -0500
commite6bfa25deb5096c05a08f01e4d6a436dd331fa88 (patch)
tree5db7ff5a4ec43181058deb41fdcf403006fe3b42 /security
parent2c17cd3681eab6d5d380dcfd073b5ee8c3440e7e (diff)
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>
Diffstat (limited to 'security')
-rw-r--r--security/apparmor/apparmorfs.c2
-rw-r--r--security/apparmor/audit.c2
-rw-r--r--security/apparmor/context.c4
-rw-r--r--security/apparmor/lsm.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 6834000640d7..41073f70eb41 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -91,7 +91,7 @@ static struct aa_loaddata *aa_simple_write_to_buffer(const char __user *userbuf,
91{ 91{
92 struct aa_loaddata *data; 92 struct aa_loaddata *data;
93 93
94 BUG_ON(copy_size > alloc_size); 94 AA_BUG(copy_size > alloc_size);
95 95
96 if (*pos != 0) 96 if (*pos != 0)
97 /* only writes from pos 0, that is complete writes */ 97 /* only writes from pos 0, that is complete writes */
diff --git a/security/apparmor/audit.c b/security/apparmor/audit.c
index 0c81ff64993b..87f40fa8c431 100644
--- a/security/apparmor/audit.c
+++ b/security/apparmor/audit.c
@@ -119,7 +119,7 @@ void aa_audit_msg(int type, struct common_audit_data *sa,
119int aa_audit(int type, struct aa_profile *profile, struct common_audit_data *sa, 119int aa_audit(int type, struct aa_profile *profile, struct common_audit_data *sa,
120 void (*cb) (struct audit_buffer *, void *)) 120 void (*cb) (struct audit_buffer *, void *))
121{ 121{
122 BUG_ON(!profile); 122 AA_BUG(!profile);
123 123
124 if (type == AUDIT_APPARMOR_AUTO) { 124 if (type == AUDIT_APPARMOR_AUTO) {
125 if (likely(!aad(sa)->error)) { 125 if (likely(!aad(sa)->error)) {
diff --git a/security/apparmor/context.c b/security/apparmor/context.c
index 71e9910cca7b..1fc16b88efbf 100644
--- a/security/apparmor/context.c
+++ b/security/apparmor/context.c
@@ -95,7 +95,7 @@ int aa_replace_current_profile(struct aa_profile *profile)
95{ 95{
96 struct aa_task_ctx *ctx = current_ctx(); 96 struct aa_task_ctx *ctx = current_ctx();
97 struct cred *new; 97 struct cred *new;
98 BUG_ON(!profile); 98 AA_BUG(!profile);
99 99
100 if (ctx->profile == profile) 100 if (ctx->profile == profile)
101 return 0; 101 return 0;
@@ -166,7 +166,7 @@ int aa_set_current_hat(struct aa_profile *profile, u64 token)
166 struct cred *new = prepare_creds(); 166 struct cred *new = prepare_creds();
167 if (!new) 167 if (!new)
168 return -ENOMEM; 168 return -ENOMEM;
169 BUG_ON(!profile); 169 AA_BUG(!profile);
170 170
171 ctx = cred_ctx(new); 171 ctx = cred_ctx(new);
172 if (!ctx->previous) { 172 if (!ctx->previous) {
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index fc82ac0247dc..0dd48184946a 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -406,7 +406,7 @@ static int common_file_perm(const char *op, struct file *file, u32 mask)
406 struct aa_profile *profile, *fprofile = aa_cred_profile(file->f_cred); 406 struct aa_profile *profile, *fprofile = aa_cred_profile(file->f_cred);
407 int error = 0; 407 int error = 0;
408 408
409 BUG_ON(!fprofile); 409 AA_BUG(!fprofile);
410 410
411 if (!file->f_path.mnt || 411 if (!file->f_path.mnt ||
412 !path_mediated_fs(file->f_path.dentry)) 412 !path_mediated_fs(file->f_path.dentry))