mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] audit: use copied skb length in kauditd_send_multicast_skb()
@ 2026-08-10 12:57 Ricardo Robaina
  2026-08-10 13:26 ` Bradley Morgan
  2026-08-24 22:25 ` Paul Moore
  0 siblings, 2 replies; 8+ messages in thread
From: Ricardo Robaina @ 2026-08-10 12:57 UTC (permalink / raw)
  To: audit, linux-kernel; +Cc: paul, eparis, Ricardo Robaina

The netlink header's nlmsg_len was being set using the original skb
instead of the local copy passed to nlmsg_multicast().

While skb->len and copy->len are identical at this point following
skb_copy(), it is conceptually cleaner and safer to use the length
of the skb being actively modified and sent. Thus, this is a minor
cleanup only, no functional change expected.

Signed-off-by: Ricardo Robaina <rrobaina@redhat.com>
---
 kernel/audit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index 9412af9144bc..631d6d4a23cf 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -871,7 +871,7 @@ static void kauditd_send_multicast_skb(struct sk_buff *skb)
 	if (!copy)
 		return;
 	nlh = nlmsg_hdr(copy);
-	nlh->nlmsg_len = skb->len;
+	nlh->nlmsg_len = copy->len;
 
 	nlmsg_multicast(sock, copy, 0, AUDIT_NLGRP_READLOG, GFP_KERNEL);
 }
-- 
2.55.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-08-25 12:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 12:57 [PATCH] audit: use copied skb length in kauditd_send_multicast_skb() Ricardo Robaina
2026-08-10 13:26 ` Bradley Morgan
2026-08-10 15:19   ` Ricardo Robaina
2026-08-10 16:27     ` Bradley Morgan
2026-08-10 20:49       ` Ricardo Robaina
2026-08-10 21:10         ` Bradley Morgan
2026-08-24 22:25 ` Paul Moore
2026-08-25 12:15   ` Ricardo Robaina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®