提交 8c5aa40c 编写于 作者: S Steve Grubb 提交者: David Woodhouse

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 <sgrubb@redhat.com>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 ea9c102c
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册