lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 05 Mar 2014 00:10:47 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	John Fastabend <john.r.fastabend@...el.com>
Cc:	Ding Tianhong <dingtianhong@...wei.com>,
	Patrick McHardy <kaber@...sh.net>,
	"David S. Miller" <davem@...emloft.net>,
	Netdev <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net RESEND] vlan: don't allow to add VLAN on VLAN device

On Thu, 2014-02-27 at 19:45 -0800, John Fastabend wrote:
> On 2/27/2014 6:43 PM, Ding Tianhong wrote:
> > I run these steps:
> >
> > modprobe 8021q
> > vconfig add eth2 20
> > vconfig add eth2.20 20
> > ifconfig eth2 xx.xx.xx.xx
> >
> > then the Call Trace happened:
> >
> 
> [...]
> 
> > ========================================================================
> >
> > The reason is that if add vlan on vlan dev, the vlan dev will create vlan_info,
> > then the notification will let the real dev to run dev_set_rx_mode() and hold
> > netif_addr_lock, and then the real dev will call ndo_set_rx_mode(), if the real
> > dev is vlan dev, the ndo_set_rx_mode() will hold netif_addr_lock again, so deadlock
> > happened.
> >
> > Don't allow to add vlan on vlan dev to fix this problem.
> >
> > Signed-off-by: Ding Tianhong <dingtianhong@...wei.com>
> > ---
> 
> I'm not sure we can just disable stacked vlans. There might be something
> using them today and they have worked in the past. Lets try to find a
> better fix.

I don't think there's any deadlock possible here.  We try to acquire the
addr_list_lock for eth2.20, then the addr_list_lock for eth2.  We never
try to acquire them in the opposite order.  The fix would involve
telling lockdep about lock ordering between stacked net_devices (I have
no idea how that's done).

Ben.

-- 
Ben Hutchings
For every complex problem
there is a solution that is simple, neat, and wrong.

Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ