public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] taskstats: fix? sk_buff size calculation
@ 2006-10-29 15:57 Oleg Nesterov
  0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2006-10-29 15:57 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Thomas Graf, Shailabh Nagar, Balbir Singh, Jay Lan,
	Linus Torvalds, linux-kernel

Again, I am not sure this patch is correct, it needs an ack...

prepare_reply() adds GENL_HDRLEN to the payload (genlmsg_total_size()),
but then it does genlmsg_put()->nlmsg_put(). This means we forget to
reserve a room for 'struct nlmsghdr', no?

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- STATS/kernel/taskstats.c~2_size	2006-10-29 16:39:10.000000000 +0300
+++ STATS/kernel/taskstats.c	2006-10-29 18:35:40.000000000 +0300
@@ -77,7 +77,8 @@ static int prepare_reply(struct genl_inf
 	/*
 	 * If new attributes are added, please revisit this allocation
 	 */
-	skb = nlmsg_new(genlmsg_total_size(size), GFP_KERNEL);
+	size = nlmsg_total_size(genlmsg_total_size(size));
+	skb = nlmsg_new(size, GFP_KERNEL);
 	if (!skb)
 		return -ENOMEM;
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-29 14:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-29 15:57 [PATCH] taskstats: fix? sk_buff size calculation Oleg Nesterov

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