audit: fixes in audit_log_drain()
PATCH 1/1 audit: fixes in audit_log_drain()
Would this be for you, James?
o Fix skb leak
o Don't send shared skb's to netlink_unicast
Signed-off-by Tommy S. Christensen <[email protected]>
-Tommy
kernel/audit.c +8 -3
@@ -483,6 +483,7 @@while ((skb =skb_dequeue (&ab->sklist))) {int retval =0 ; +struct sk_buff *nskb;if (audit_pid) {if (ab->nlh) {
@@ -492,13 +493,17 @@ ab->nlh->nlmsg_seq =0 ; ab->nlh->nlmsg_pid = ab->pid; } -skb_get (skb);/* because netlink_* frees */ - retval =netlink_unicast (audit_sock, skb, audit_pid, -MSG_DONTWAIT ); + retval = -ENOMEM ; + nskb =skb_clone (skb); +if (nskb) + retval =netlink_unicast (audit_sock, nskb, + audit_pid, +MSG_DONTWAIT ); }if (retval == -EAGAIN && ab->count <5 ) { ++ab->count;audit_log_end_irq (ab); +kfree_skb (skb);return 1 ; }if (retval <0 ) {
Quoted 1 line · Tommy Christensen
o Don't send shared skb's to
netlink_unicast
Never mind. Herbert Xu made a better fix for this in netlink.
-Tommy