Skip to content

Commit e6bfa25

Browse files
committed
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>
1 parent 2c17cd3 commit e6bfa25

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

security/apparmor/apparmorfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static struct aa_loaddata *aa_simple_write_to_buffer(const char __user *userbuf,
9191
{
9292
struct aa_loaddata *data;
9393

94-
BUG_ON(copy_size > alloc_size);
94+
AA_BUG(copy_size > alloc_size);
9595

9696
if (*pos != 0)
9797
/* only writes from pos 0, that is complete writes */

security/apparmor/audit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void aa_audit_msg(int type, struct common_audit_data *sa,
119119
int aa_audit(int type, struct aa_profile *profile, struct common_audit_data *sa,
120120
void (*cb) (struct audit_buffer *, void *))
121121
{
122-
BUG_ON(!profile);
122+
AA_BUG(!profile);
123123

124124
if (type == AUDIT_APPARMOR_AUTO) {
125125
if (likely(!aad(sa)->error)) {

security/apparmor/context.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ int aa_replace_current_profile(struct aa_profile *profile)
9595
{
9696
struct aa_task_ctx *ctx = current_ctx();
9797
struct cred *new;
98-
BUG_ON(!profile);
98+
AA_BUG(!profile);
9999

100100
if (ctx->profile == profile)
101101
return 0;
@@ -166,7 +166,7 @@ int aa_set_current_hat(struct aa_profile *profile, u64 token)
166166
struct cred *new = prepare_creds();
167167
if (!new)
168168
return -ENOMEM;
169-
BUG_ON(!profile);
169+
AA_BUG(!profile);
170170

171171
ctx = cred_ctx(new);
172172
if (!ctx->previous) {

security/apparmor/lsm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static int common_file_perm(const char *op, struct file *file, u32 mask)
406406
struct aa_profile *profile, *fprofile = aa_cred_profile(file->f_cred);
407407
int error = 0;
408408

409-
BUG_ON(!fprofile);
409+
AA_BUG(!fprofile);
410410

411411
if (!file->f_path.mnt ||
412412
!path_mediated_fs(file->f_path.dentry))

0 commit comments

Comments
 (0)