From: Steve Grubb Date: Tue, 10 May 2005 17:53:07 +0000 (+0100) Subject: AUDIT: Fix reported length of audit messages. X-Git-Tag: v2.6.14-rc2~49^2~71 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=8c5aa40c94ef8bb7f7da95ecd5942e2d20fc3c9d;p=~emulex%2Finfiniband.git AUDIT: Fix reported length of audit messages. We were setting nlmsg_len to skb->len, but we should be subtracting the size of the header. From: Steve Grubb Signed-off-by: David Woodhouse --- diff --git a/kernel/audit.c b/kernel/audit.c index b86007da8a3..2ddd1a2b66d 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -488,7 +488,7 @@ static inline int audit_log_drain(struct audit_buffer *ab) if (audit_pid) { struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data; - nlh->nlmsg_len = skb->len; + nlh->nlmsg_len = skb->len - sizeof(*nlh); skb_get(skb); /* because netlink_* frees */ retval = netlink_unicast(audit_sock, skb, audit_pid, MSG_DONTWAIT);