LKML Archive on lore.kernel.org
 help / color / Atom feed
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
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

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-04  8:36 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 publically 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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox