Thread (15 messages) 15 messages, 4 authors, 2016-11-26
STALE3471d

[PATCH 4/7] security: apparmor: apparmorfs.c WARN_ON vs BUG_ON

From: Walt Feasel <hidden>
Date: 2016-11-26 08:43:22
Subsystem: apparmor security module, security subsystem, the rest · Maintainers: John Johansen, Paul Moore, James Morris, "Serge E. Hallyn", Linus Torvalds

Make style modifications for:
CHECK: Avoid crashing the kernel - try using WARN_ON
& recovery code rather than BUG() or BUG_ON()

Signed-off-by: Walt Feasel <redacted>
---
Not sure if correct use. Seems if copy_size > alloc_size
it is corrected by writing partial data and return an error.

 security/apparmor/apparmorfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index c5701f3..d759c78 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -87,7 +87,7 @@ static char *aa_simple_write_to_buffer(int op, const char __user *userbuf,
 {
 	char *data;
 
-	BUG_ON(copy_size > alloc_size);
+	WARN_ON(copy_size > alloc_size);
 
 	if (*pos != 0)
 		/* only writes from pos 0, that is complete writes */
-- 
2.1.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help