lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 29 Oct 2006 16:45:58 +0300
From:	Oleg Nesterov <oleg@...sign.ru>
To:	Thomas Graf <tgraf@...g.ch>
Cc:	Andrew Morton <akpm@...l.org>,
	Shailabh Nagar <nagar@...son.ibm.com>,
	Balbir Singh <balbir@...ibm.com>, Jay Lan <jlan@....com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] taskstats: fix? sk_buff leak

On 10/29, Thomas Graf wrote:
>
> * Oleg Nesterov <oleg@...sign.ru> 2006-10-29 16:24
> >  nla_put_failure:
> > -	return genlmsg_cancel(rep_skb, reply);
> > +	genlmsg_cancel(rep_skb, reply);
> 
> rc = genlmsg_cancel(...) or return value is undefined.

Thanks!

[PATCH] taskstats: fix sk_buff leak

Compile tested.

'return genlmsg_cancel()' in taskstats_user_cmd/taskstats_exit_send looks
wrong to me. Unless we pass 'rep_skb' to the netlink layer we own sk_buff.
This means we should always do kfree_skb() on failure.

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

--- STATS/kernel/taskstats.c~1_skb	2006-10-29 15:12:51.000000000 +0300
+++ STATS/kernel/taskstats.c	2006-10-29 16:39:10.000000000 +0300
@@ -411,7 +411,7 @@ static int taskstats_user_cmd(struct sk_
 	return send_reply(rep_skb, info->snd_pid);
 
 nla_put_failure:
-	return genlmsg_cancel(rep_skb, reply);
+	rc = genlmsg_cancel(rep_skb, reply);
 err:
 	nlmsg_free(rep_skb);
 	return rc;
@@ -507,7 +507,6 @@ send:
 
 nla_put_failure:
 	genlmsg_cancel(rep_skb, reply);
-	goto ret;
 err_skb:
 	nlmsg_free(rep_skb);
 ret:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ