netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Cc: Gao feng <gaofeng@cn.fujitsu.com>, netdev@vger.kernel.org
Subject: Re: [PATCH] net: tun: release the reference of tun device in tun_recvmsg
Date: Fri, 26 Apr 2013 13:08:50 +0800	[thread overview]
Message-ID: <517A0BE2.9080503@redhat.com> (raw)
In-Reply-To: <517A0A84.40102@cn.fujitsu.com>

On 04/26/2013 01:03 PM, Gao feng wrote:
> On 04/25/2013 11:04 PM, Arkadiusz Miskiewicz wrote:
>> On Thursday 25 of April 2013, Gao feng wrote:
>>> We forget to release the reference of tun device in tun_recvmsg.
>>> bug introduced in commit 54f968d6efdbf7dec36faa44fc11f01b0e4d1990
>>> (tuntap: move socket to tun_file)
>> Hm, still hitting the problem even with the patch - dmesg:
>>
> Ok, seams there are another problems we haven't discovered.
> it's excellent if you can find out which commit introduces this
> bug by git bisect.
>
> Thanks!

Yes, bisect will be helpful. If you could not do it, please tell me the
steps to reproduce the issue and the tree you used. I just test with
net.git and net-next.git with a tap device created by tunctl, didn't
meet the issue.

>
>> http://pastebin.com/iSm0QJVY
>>
>>
>>> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
>>> ---
>>>  drivers/net/tun.c | 7 +++++--
>>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
>>> index 0c9df2f..dcd0c19 100644
>>> --- a/drivers/net/tun.c
>>> +++ b/drivers/net/tun.c
>>> @@ -1471,14 +1471,17 @@ static int tun_recvmsg(struct kiocb *iocb, struct
>>> socket *sock, if (!tun)
>>>  		return -EBADFD;
>>>
>>> -	if (flags & ~(MSG_DONTWAIT|MSG_TRUNC))
>>> -		return -EINVAL;
>>> +	if (flags & ~(MSG_DONTWAIT|MSG_TRUNC)) {
>>> +		ret = -EINVAL;
>>> +		goto out;
>>> +	}
>>>  	ret = tun_do_read(tun, tfile, iocb, m->msg_iov, total_len,
>>>  			  flags & MSG_DONTWAIT);
>>>  	if (ret > total_len) {
>>>  		m->msg_flags |= MSG_TRUNC;
>>>  		ret = flags & MSG_TRUNC ? ret : total_len;
>>>  	}
>>> +out:
>>>  	tun_put(tun);
>>>  	return ret;
>>>  }
>>

  reply	other threads:[~2013-04-26  5:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-25  6:22 3.9.0-rc8-00005-g824282c: [24988.276086] unregister_netdevice: waiting for tap0 to become free. Usage count = 1 Arkadiusz Miskiewicz
2013-04-25  7:59 ` [PATCH] net: tun: release the reference of tun device in tun_recvmsg Gao feng
2013-04-25  7:59   ` Jason Wang
2013-04-25 15:04   ` Arkadiusz Miskiewicz
2013-04-26  5:03     ` Gao feng
2013-04-26  5:08       ` Jason Wang [this message]
2013-05-28 22:29         ` Arkadiusz Miskiewicz
2013-06-03  8:16           ` [PATCH] ipv6: assign rt6_info to inet6_ifaddr in init_loopback Gao feng
2013-06-04 23:58             ` David Miller
2013-06-03  8:26           ` [PATCH] net: tun: release the reference of tun device in tun_recvmsg Gao feng
2013-06-05 15:20             ` Arkadiusz Miskiewicz
2013-06-05 15:36               ` Eric Dumazet
2013-04-29 15:07   ` David Miller

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=517A0BE2.9080503@redhat.com \
    --to=jasowang@redhat.com \
    --cc=a.miskiewicz@gmail.com \
    --cc=gaofeng@cn.fujitsu.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).