From: David Miller <davem@davemloft.net>
To: xemul@openvz.org
Cc: yoshfuji@linux-ipv6.org, dlezcano@fr.ibm.com, netdev@vger.kernel.org
Subject: Re: [PATCH][NEIGH]: Fix race between pneigh deletion and ipv6's ndisc_recv_ns (v3).
Date: Mon, 24 Mar 2008 14:50:10 -0700 (PDT) [thread overview]
Message-ID: <20080324.145010.02903594.davem@davemloft.net> (raw)
In-Reply-To: <47E76525.9010807@openvz.org>
From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 24 Mar 2008 11:24:05 +0300
> Proxy neighbors do not have any reference counting, so any caller
> of pneigh_lookup (unless it's a netlink triggered add/del routine)
> should _not_ perform any actions on the found proxy entry.
>
> There's one exception from this rule - the ipv6's ndisc_recv_ns()
> uses found entry to check the flags for NTF_ROUTER.
>
> This creates a race between the ndisc and pneigh_delete - after
> the pneigh is returned to the caller, the nd_tbl.lock is dropped
> and the deleting procedure may proceed.
>
> One of the fixes would be to add a reference counting, but this
> problem exists for ndisc only. Besides such a patch would be too
> big for -rc4.
>
> So I propose to introduce a __pneigh_lookup() which is supposed
> to be called with the lock held and use it in ndisc code to check
> the flags on alive pneigh entry.
>
>
> Changes from v2:
> As David noticed, Exported the __pneigh_lookup() to ipv6 module.
> The checkpatch generates a warning on it, since the EXPORT_SYMBOL
> does not follow the symbol itself, but in this file all the
> exports come at the end, so I decided no to break this harmony.
>
> Changes from v1:
> Fixed comments from YOSHIFUJI - indentation of prototype in header
> and the pndisc_check_router() name - and a compilation fix, pointed
> by Daniel - the is_routed was (falsely) considered as uninitialized
> by gcc.
>
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Applied, thanks!
prev parent reply other threads:[~2008-03-24 21:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-24 8:24 [PATCH][NEIGH]: Fix race between pneigh deletion and ipv6's ndisc_recv_ns (v3) Pavel Emelyanov
2008-03-24 21:50 ` 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=20080324.145010.02903594.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dlezcano@fr.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=xemul@openvz.org \
--cc=yoshfuji@linux-ipv6.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).