From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, davem@davemloft.net, sri@us.ibm.com,
kaber@trash.net, linux-kernel@vger.kernel.org, mtesar@redhat.com
Subject: Re: [patch net] macvlan: fix passthru mode race between dev removal and rx path
Date: Thu, 09 May 2013 13:35:33 -0700 [thread overview]
Message-ID: <1368131733.13473.103.camel@edumazet-glaptop> (raw)
In-Reply-To: <1368109420-14199-1-git-send-email-jiri@resnulli.us>
On Thu, 2013-05-09 at 16:23 +0200, Jiri Pirko wrote:
> Currently, if macvlan in passthru mode is created and data are rxed and
> you remove this device, following panic happens:
>
> NULL pointer dereference at 0000000000000198
> IP: [<ffffffffa0196058>] macvlan_handle_frame+0x153/0x1f7 [macvlan]
>
...
>
> Reason of the panic is that list_first_entry() is blindly called in
> macvlan_handle_frame() even if the list was empty. vlan is set to
> incorrect pointer which leads to the crash.
>
> I'm fixing this by protecting port->vlans list by rcu and by preventing
> from getting incorrect pointer in case the list is empty.
>
> Introduced by: commit eb06acdc85585f2 "macvlan: Introduce 'passthru' mode to takeover the underlying device"
>
> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> ---
Acked-by: Eric Dumazet <edumazet@google.com>
next prev parent reply other threads:[~2013-05-09 20:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 14:23 [patch net] macvlan: fix passthru mode race between dev removal and rx path Jiri Pirko
2013-05-09 20:35 ` Eric Dumazet [this message]
2013-05-11 23:25 ` 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=1368131733.13473.103.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=jiri@resnulli.us \
--cc=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mtesar@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=sri@us.ibm.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