Skip to content

Commit 6a40006

Browse files
committed
Merge tag 'audit-pr-20200422' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit
Pull audit fix from Paul Moore: "One small audit patch fix, fixing a missing length check on input from userspace, nothing crazy" * tag 'audit-pr-20200422' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: check the length of userspace generated audit records
2 parents c578ddb + 763dafc commit 6a40006

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/audit.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,9 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
13261326
case AUDIT_FIRST_USER_MSG2 ... AUDIT_LAST_USER_MSG2:
13271327
if (!audit_enabled && msg_type != AUDIT_USER_AVC)
13281328
return 0;
1329+
/* exit early if there isn't at least one character to print */
1330+
if (data_len < 2)
1331+
return -EINVAL;
13291332

13301333
err = audit_filter(msg_type, AUDIT_FILTER_USER);
13311334
if (err == 1) { /* match or error */

0 commit comments

Comments
 (0)