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]
Message-ID: <20070219115955.GB91@tv-sign.ru>
Date:	Mon, 19 Feb 2007 14:59:55 +0300
From:	Oleg Nesterov <oleg@...sign.ru>
To:	David Howells <dhowells@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Jarek Poplawski <jarkao2@...pl>,
	"David S. Miller" <davem@...emloft.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] net/bridge/br_if.c: don't use _WORK_NAR

On 02/19, David Howells wrote:
>
> Oleg Nesterov <oleg@...sign.ru> wrote:
> 
> > Afaics, noautorel work_struct buys nothing for "struct net_bridge_port".
> 
> You may be right.
> 
> > If del_nbp()->cancel_delayed_work(&p->carrier_check) fails, port_carrier_check
> > may be called later anyway.
> 
> Called by what?  Something outside of br_if.c?

No. if cancel_delayed_work() fails, the work may sit pending in cwq->worklist,
or it may be running right now, waiting for rtnl_mutex.

> > So the reading of *work in port_carrier_check() is equally unsafe with or
> > without this patch.
> 
> Hmmm... cancel_delayed_work() in del_nbp() probably ought to be followed by a
> flush_scheduled_work().

Yes, but this deadlocks: we hold rtnl_mutex, and work->func() takes it too.

I think the fix should be so that port_carrier_check() does get/put on
"struct net_bridge_port" (container), but not on "struct net_device", and

del_nbp(struct net_bridge_port *p)

	if (cancel_delayed_work(&p->carrier_check))
-		dev_put(p->dev);
+		kobject_put(&p->kobj);

Oleg.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ