Merge tag 'audit-pr-20200729' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoor...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 29 Jul 2020 19:35:36 +0000 (12:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 29 Jul 2020 19:35:36 +0000 (12:35 -0700)
Pull audit fixes from Paul Moore:
 "One small audit fix that you can hopefully merge before v5.8 is
  released. Unfortunately it is a revert of a patch that went in during
  the v5.7 window and we just recently started to see some bug reports
  relating to that commit.

  We are working on a proper fix, but I'm not yet clear on when that
  will be ready and we need to fix the v5.7 kernels anyway, so in the
  interest of time a revert seemed like the best solution right now"

* tag 'audit-pr-20200729' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit:
  revert: 1320a4052ea1 ("audit: trigger accompanying records when no rules present")

1  2 
kernel/audit.c

diff --combined kernel/audit.c
index 8c201f414226246f7f6c173faa721423aabff51f,9bf2b08b051fbe8b0fbe59c0cc6138d3ddffcf5a..b2301bdc977369e7ad75c60a6d9d22b1021b8bd3
@@@ -1334,9 -1334,6 +1334,9 @@@ static int audit_receive_msg(struct sk_
        case AUDIT_FIRST_USER_MSG2 ... AUDIT_LAST_USER_MSG2:
                if (!audit_enabled && msg_type != AUDIT_USER_AVC)
                        return 0;
 +              /* exit early if there isn't at least one character to print */
 +              if (data_len < 2)
 +                      return -EINVAL;
  
                err = audit_filter(msg_type, AUDIT_FILTER_USER);
                if (err == 1) { /* match or error */
@@@ -1851,7 -1848,6 +1851,6 @@@ struct audit_buffer *audit_log_start(st
        }
  
        audit_get_stamp(ab->ctx, &t, &serial);
-       audit_clear_dummy(ab->ctx);
        audit_log_format(ab, "audit(%llu.%03lu:%u): ",
                         (unsigned long long)t.tv_sec, t.tv_nsec/1000000, serial);