aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/auditsc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index ac6d9b23b018..2087d6de67ea 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1000,9 +1000,10 @@ static int audit_log_single_execve_arg(struct audit_context *context,
1000 * for strings that are too long, we should not have created 1000 * for strings that are too long, we should not have created
1001 * any. 1001 * any.
1002 */ 1002 */
1003 if (unlikely((len = -1) || len > MAX_ARG_STRLEN - 1)) { 1003 if (unlikely((len == -1) || len > MAX_ARG_STRLEN - 1)) {
1004 WARN_ON(1); 1004 WARN_ON(1);
1005 send_sig(SIGKILL, current, 0); 1005 send_sig(SIGKILL, current, 0);
1006 return -1;
1006 } 1007 }
1007 1008
1008 /* walk the whole argument looking for non-ascii chars */ 1009 /* 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 if (ret) { 1021 if (ret) {
1021 WARN_ON(1); 1022 WARN_ON(1);
1022 send_sig(SIGKILL, current, 0); 1023 send_sig(SIGKILL, current, 0);
1024 return -1;
1023 } 1025 }
1024 buf[to_send] = '\0'; 1026 buf[to_send] = '\0';
1025 has_cntl = audit_string_contains_control(buf, to_send); 1027 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 if (ret) { 1085 if (ret) {
1084 WARN_ON(1); 1086 WARN_ON(1);
1085 send_sig(SIGKILL, current, 0); 1087 send_sig(SIGKILL, current, 0);
1088 return -1;
1086 } 1089 }
1087 buf[to_send] = '\0'; 1090 buf[to_send] = '\0';
1088 1091