Messages in this thread Patch in this message | | | Date | Tue, 10 Aug 2004 23:12:45 +0200 | From | Roger Luethi <> | Subject | [PATCH] audit code |
| |
Two things that struck me as odd when reading parts of audit.c:
- audit_receive_skb calls netlink_ack with positive errnos; AFAICT they should be negative, though (netlink(7)).
- audit_receive_skb always returns 0; therefore, the condition in audit_receive is always false.
Signed-off-by: Roger Luethi <rl@hellgate.ch>
--- 2.6-mm/kernel/audit.c.orig 2004-08-10 20:49:07.407311613 +0200 +++ 2.6-mm/kernel/audit.c 2004-08-10 20:54:39.810234132 +0200 @@ -419,7 +419,7 @@ static int audit_receive_skb(struct sk_b if (rlen > skb->len) rlen = skb->len; if ((err = audit_receive_msg(skb, nlh))) { - netlink_ack(skb, nlh, -err); + netlink_ack(skb, nlh, err); } else if (nlh->nlmsg_flags & NLM_F_ACK) netlink_ack(skb, nlh, 0); skb_pull(skb, rlen); @@ -437,10 +437,8 @@ static void audit_receive(struct sock *s /* FIXME: this must not cause starvation */ while ((skb = skb_dequeue(&sk->sk_receive_queue))) { - if (audit_receive_skb(skb) && skb->len) - skb_queue_head(&sk->sk_receive_queue, skb); - else - kfree_skb(skb); + audit_receive_skb(skb); + kfree_skb(skb); } up(&audit_netlink_sem); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |