Explorar o código

AUDIT: Properly account for alignment difference in nlmsg_len.

Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Chris Wright %!s(int64=20) %!d(string=hai) anos
pai
achega
5a241d7703
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      kernel/audit.c

+ 1 - 1
kernel/audit.c

@@ -488,7 +488,7 @@ static inline int audit_log_drain(struct audit_buffer *ab)
 
 
 		if (audit_pid) {
 		if (audit_pid) {
 			struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data;
 			struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data;
-			nlh->nlmsg_len = skb->len - sizeof(*nlh);
+			nlh->nlmsg_len = skb->len - NLMSG_SPACE(0);
 			skb_get(skb); /* because netlink_* frees */
 			skb_get(skb); /* because netlink_* frees */
 			retval = netlink_unicast(audit_sock, skb, audit_pid,
 			retval = netlink_unicast(audit_sock, skb, audit_pid,
 						 MSG_DONTWAIT);
 						 MSG_DONTWAIT);