All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pavel Emelyanov <xemul@openvz.org>
Cc: David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>,
	devel@openvz.org
Subject: Re: [PATCH] vlan: fix potential race in vlan_cleanup_module vs vlan_ioctl_handler
Date: Tue, 11 Dec 2007 11:38:38 +0100	[thread overview]
Message-ID: <475E68AE.6090708@trash.net> (raw)
In-Reply-To: <475E6587.1090306@openvz.org>

Pavel Emelyanov wrote:
> The vlan module cleanup function starts with
> 
> 	vlan_netlink_fini();
> 	vlan_ioctl_set(NULL);
> 
> The first call removes all the vlan devices and
> the second one closes the vlan ioctl.
> 
> AFAIS there's a tiny race window between these two
> calls - after rtnl unregistered all the vlans, but 
> the ioctl handler isn't set to NULL yet, user can 
> manage to call this ioctl and create one vlan device, 
> and that this function will later BUG_ON seeing 
> non-emply hashes.

Indeed, I can't see anything preventing this.

> I think, that we must first close the vlan ioctl
> and only after this remove all the vlans with the
> vlan_netlink_fini() call.

That looks correct, thanks Pavel. Dave, please apply.


  reply	other threads:[~2007-12-11 10:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-11 10:25 [PATCH] vlan: fix potential race in vlan_cleanup_module vs vlan_ioctl_handler Pavel Emelyanov
2007-12-11 10:38 ` Patrick McHardy [this message]
2007-12-11 10:41   ` 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=475E68AE.6090708@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=devel@openvz.org \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.