From: Thomas Graf <tgraf@suug.ch>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Andrew Morton <akpm@osdl.org>,
Shailabh Nagar <nagar@watson.ibm.com>,
Balbir Singh <balbir@in.ibm.com>, Jay Lan <jlan@sgi.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] taskstats: fix? sk_buff leak
Date: Sun, 29 Oct 2006 13:33:52 +0100 [thread overview]
Message-ID: <20061029123352.GC12964@postel.suug.ch> (raw)
In-Reply-To: <20061029132449.GA1142@oleg>
* Oleg Nesterov <oleg@tv-sign.ru> 2006-10-29 16:24
> Compile tested only, and I know nothing about net/. Needs an ack from
> maintainer.
>
> '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,
> yes? This means we should always do kfree_skb() on failure.
That's right.
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
>
> --- STATS/kernel/taskstats.c~1_skb 2006-10-29 15:12:51.000000000 +0300
> +++ STATS/kernel/taskstats.c 2006-10-29 16:16:05.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);
> + genlmsg_cancel(rep_skb, reply);
rc = genlmsg_cancel(...) or return value is undefined.
> 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:
>
next prev parent reply other threads:[~2006-10-29 12:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-29 13:24 [PATCH] taskstats: fix? sk_buff leak Oleg Nesterov
2006-10-29 12:33 ` Thomas Graf [this message]
2006-10-29 13:45 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061029123352.GC12964@postel.suug.ch \
--to=tgraf@suug.ch \
--cc=akpm@osdl.org \
--cc=balbir@in.ibm.com \
--cc=jlan@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nagar@watson.ibm.com \
--cc=oleg@tv-sign.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox