From: Herbert Xu <herbert@gondor.apana.org.au>
To: Mariusz Kozlowski <m.kozlowski@tuxland.pl>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org
Cc: Eugene Kapun <abacabadabacaba@gmail.com>,
maxk@qualcomm.com, linux-net@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: tun/tap crashes if open() /dev/net/tun and then poll() it.
Date: Mon, 6 Jul 2009 09:12:30 +0800 [thread overview]
Message-ID: <20090706011230.GC15156@gondor.apana.org.au> (raw)
In-Reply-To: <20090706001114.2d4517be@mako-desktop>
On Mon, Jul 06, 2009 at 12:11:14AM +0200, Mariusz Kozlowski wrote:
>
> Can you try this patch?
>
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index 11a0ba4..c599327 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -486,12 +486,14 @@ static unsigned int tun_chr_poll(struct file *file, poll_table * wait)
> {
> struct tun_file *tfile = file->private_data;
> struct tun_struct *tun = __tun_get(tfile);
> - struct sock *sk = tun->sk;
> + struct sock *sk;
> unsigned int mask = 0;
>
> if (!tun)
> return POLLERR;
>
> + sk = tun->sk;
> +
> DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name);
>
> poll_wait(file, &tun->socket.wait, wait);
Good catch. Can you please resend with a sign-off?
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2009-07-06 1:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-04 8:36 PROBLEM: tun/tap crashes if open() /dev/net/tun and then poll() it Eugene Kapun
2009-07-05 22:11 ` Mariusz Kozlowski
2009-07-06 1:12 ` Herbert Xu [this message]
2009-07-06 5:48 ` Mariusz Kozlowski
2009-07-06 20:08 ` 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=20090706011230.GC15156@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=abacabadabacaba@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
--cc=m.kozlowski@tuxland.pl \
--cc=maxk@qualcomm.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).