Commit b0abcfc1 authored by Eric Paris's avatar Eric Paris Committed by Linus Torvalds

Audit: use == not = in if statements

Clearly this was supposed to be an == not an = in the if statement.
This patch also causes us to stop processing execve args once we have
failed rather than continuing to loop on failure over and over and over.
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f702c581
...@@ -1000,9 +1000,10 @@ static int audit_log_single_execve_arg(struct audit_context *context, ...@@ -1000,9 +1000,10 @@ static int audit_log_single_execve_arg(struct audit_context *context,
* for strings that are too long, we should not have created * for strings that are too long, we should not have created
* any. * any.
*/ */
if (unlikely((len = -1) || len > MAX_ARG_STRLEN - 1)) { if (unlikely((len == -1) || len > MAX_ARG_STRLEN - 1)) {
WARN_ON(1); WARN_ON(1);
send_sig(SIGKILL, current, 0); send_sig(SIGKILL, current, 0);
return -1;
} }
/* walk the whole argument looking for non-ascii chars */ /* walk the whole argument looking for non-ascii chars */
...@@ -1020,6 +1021,7 @@ static int audit_log_single_execve_arg(struct audit_context *context, ...@@ -1020,6 +1021,7 @@ static int audit_log_single_execve_arg(struct audit_context *context,
if (ret) { if (ret) {
WARN_ON(1); WARN_ON(1);
send_sig(SIGKILL, current, 0); send_sig(SIGKILL, current, 0);
return -1;
} }
buf[to_send] = '\0'; buf[to_send] = '\0';
has_cntl = audit_string_contains_control(buf, to_send); has_cntl = audit_string_contains_control(buf, to_send);
...@@ -1083,6 +1085,7 @@ static int audit_log_single_execve_arg(struct audit_context *context, ...@@ -1083,6 +1085,7 @@ static int audit_log_single_execve_arg(struct audit_context *context,
if (ret) { if (ret) {
WARN_ON(1); WARN_ON(1);
send_sig(SIGKILL, current, 0); send_sig(SIGKILL, current, 0);
return -1;
} }
buf[to_send] = '\0'; buf[to_send] = '\0';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment