From: David Miller <davem@davemloft.net>
To: lucien.xin@gmail.com
Cc: netdev@vger.kernel.org, jasowang@redhat.com
Subject: Re: [PATCH net] tun: fix rcu_read_lock imbalance in tun_build_skb
Date: Sun, 19 Nov 2017 21:24:16 +0900 (KST)	[thread overview]
Message-ID: <20171119.212416.1338898200006482751.davem@davemloft.net> (raw)
In-Reply-To: <c1707eafcfaaf310d4385a0dcf7f64b8bdc37acc.1511091064.git.lucien.xin@gmail.com>
From: Xin Long <lucien.xin@gmail.com>
Date: Sun, 19 Nov 2017 19:31:04 +0800
> rcu_read_lock in tun_build_skb is used to rcu_dereference tun->xdp_prog
> safely, rcu_read_unlock should be done in every return path.
> 
> Now I could see one place missing it, where it returns NULL in switch-case
> XDP_REDIRECT,  another palce using rcu_read_lock wrongly, where it returns
> NULL in if (xdp_xmit) chunk.
> 
> So fix both in this patch.
> 
> Fixes: 761876c857cb ("tap: XDP support")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Good catch, applied, thanks!
     prev parent reply	other threads:[~2017-11-19 12:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19 11:31 [PATCH net] tun: fix rcu_read_lock imbalance in tun_build_skb Xin Long
2017-11-19 12:24 ` 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=20171119.212416.1338898200006482751.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jasowang@redhat.com \
    --cc=lucien.xin@gmail.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).