Merge branch 'stable-4.13' of git://git.infradead.org/users/pcmoore/audit
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 Jul 2017 17:22:26 +0000 (10:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 Jul 2017 17:22:26 +0000 (10:22 -0700)
Pull audit fix from Paul Moore:
 "A small audit fix, just a single line, to plug a memory leak in some
  audit error handling code"

* 'stable-4.13' of git://git.infradead.org/users/pcmoore/audit:
  audit: fix memleak in auditd_send_unicast_skb.

1  2 
kernel/audit.c

diff --combined kernel/audit.c
index 833267bbd80bc62b367699eb9cdc646c20fb264c,07def5e49cc9e29abd2dc4d5980564726a74f858..6dd5569317393889d2f90814dc7b15a840f7e0eb
@@@ -641,6 -641,7 +641,7 @@@ static int auditd_send_unicast_skb(stru
        ac = rcu_dereference(auditd_conn);
        if (!ac) {
                rcu_read_unlock();
+               kfree_skb(skb);
                rc = -ECONNREFUSED;
                goto err;
        }
@@@ -1467,7 -1468,7 +1468,7 @@@ static void audit_receive(struct sk_buf
                err = audit_receive_msg(skb, nlh);
                /* if err or if this message says it wants a response */
                if (err || (nlh->nlmsg_flags & NLM_F_ACK))
 -                      netlink_ack(skb, nlh, err);
 +                      netlink_ack(skb, nlh, err, NULL);
  
                nlh = nlmsg_next(nlh, &len);
        }