[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150708122943.4716f7c3@gandalf.local.home>
Date: Wed, 8 Jul 2015 12:29:43 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Jan Kara <jack@...e.cz>,
Paul Moore <pmoore@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] Revert: audit: Fix check of return value of
strnlen_user()
On Wed, 8 Jul 2015 12:02:49 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
>
> Well, any testing will have to wait. The reason I found this is because
> it caused my own tests to fail for a bug fix I'm testing (unrelated to
> this) that I'm getting ready to send to you. My box to run this on is
> back to running those tests, which can take several hours.
Oh well, my tests just stumbled over another unrelated 4.2-rc1 bug (I
need to dig into this one now :-( ). But that freed up my machine to
test this.
I tested the following patch. Feel free to author it yourself and just
add my reported/tested-by tags, or give it to me. Either way, I don't
care. I just want it fixed so that it doesn't make my own tests fail.
Thanks!
-- Steve
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 09c65640cad6..e85bdfd15fed 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1021,8 +1021,7 @@ static int audit_log_single_execve_arg(struct audit_context *context,
* for strings that are too long, we should not have created
* any.
*/
- if (unlikely((len == 0) || len > MAX_ARG_STRLEN - 1)) {
- WARN_ON(1);
+ if (WARN_ON_ONCE(len < 0 || len > MAX_ARG_STRLEN - 1)) {
send_sig(SIGKILL, current, 0);
return -1;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists