lkml.org 
[lkml]   [2004]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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/

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.037 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site