netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: edumazet@google.com
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com,
	syzkaller@googlegroups.com, ppenkov@google.com,
	willemb@google.com
Subject: Re: [PATCH net] tun: add mutex_unlock() call and napi.skb clearing in tun_get_user()
Date: Thu, 23 Jan 2020 11:44:21 +0100 (CET)	[thread overview]
Message-ID: <20200123.114421.1414769180741959285.davem@davemloft.net> (raw)
In-Reply-To: <20200122170735.4126-1-edumazet@google.com>

From: Eric Dumazet <edumazet@google.com>
Date: Wed, 22 Jan 2020 09:07:35 -0800

> If both IFF_NAPI_FRAGS mode and XDP are enabled, and the XDP program
> consumes the skb, we need to clear the napi.skb (or risk
> a use-after-free) and release the mutex (or risk a deadlock)
> 
> WARNING: lock held when returning to user space!
> 5.5.0-rc6-syzkaller #0 Not tainted
> ------------------------------------------------
> syz-executor.0/455 is leaving the kernel with locks still held!
> 1 lock held by syz-executor.0/455:
>  #0: ffff888098f6e748 (&tfile->napi_mutex){+.+.}, at: tun_get_user+0x1604/0x3fc0 drivers/net/tun.c:1835
> 
> Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: syzbot <syzkaller@googlegroups.com>

Applied and queued up for -stable, thanks Eric.

      reply	other threads:[~2020-01-23 10:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 17:07 [PATCH net] tun: add mutex_unlock() call and napi.skb clearing in tun_get_user() Eric Dumazet
2020-01-23 10:44 ` David Miller [this message]

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=20200123.114421.1414769180741959285.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=ppenkov@google.com \
    --cc=syzkaller@googlegroups.com \
    --cc=willemb@google.com \
    /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).