kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: waltfeasel@gmail.com (Walt Feasel)
To: kernelnewbies@lists.kernelnewbies.org
Subject: [PATCH 4/7] security: apparmor: apparmorfs.c WARN_ON vs BUG_ON
Date: Sat, 26 Nov 2016 03:43:22 -0500	[thread overview]
Message-ID: <1480149805-18736-5-git-send-email-waltfeasel@gmail.com> (raw)
In-Reply-To: <1480149805-18736-1-git-send-email-waltfeasel@gmail.com>

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 <waltfeasel@gmail.com>
---
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

  parent reply	other threads:[~2016-11-26  8:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-26  8:43 [PATCH 0/7] security: apparmor: apparmorfs.c Checkpatch mods Walt Feasel
2016-11-26  8:43 ` [PATCH 1/7] security: apparmor: apparmorfs.c Multiple blank lines Walt Feasel
2016-11-26  8:43 ` [PATCH 2/7] security: apparmor: apparmorfs.c Blank line after declarations Walt Feasel
2016-11-26  8:43 ` [PATCH 3/7] security: apparmor: apparmorfs.c Space after cast Walt Feasel
2016-11-26  8:43 ` Walt Feasel [this message]
2016-11-26  8:43 ` [PATCH 5/7] security: apparmor: apparmorfs.c Align parenthesis Walt Feasel
2016-11-26  8:43 ` [PATCH 6/7] security: apparmor: apparmorfs.c Comparison to NULL Walt Feasel
2016-11-26  8:43 ` [PATCH 7/7] security: apparmor: apparmorfs.c Line continuations Walt Feasel
2016-11-26 11:05 ` [PATCH 0/7] security: apparmor: apparmorfs.c Checkpatch mods Greg KH
2016-11-26 16:56   ` Walt Feasel
2016-11-26 17:19     ` Greg KH
2016-11-26 18:02       ` Walt Feasel
2016-11-26 20:40         ` Greg KH
2016-11-26 21:28           ` Bjørn Mork
2016-11-26 22:41             ` Joel Fernandes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1480149805-18736-5-git-send-email-waltfeasel@gmail.com \
    --to=waltfeasel@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).