Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-25 Thread Joe.Ghalam
From: David Miller <da...@davemloft.net> Sent: Tuesday, April 25, 2017 7:42 AM To: herb...@gondor.apana.org.au Cc: Ghalam, Joe; Wichmann, Clifford; netdev@vger.kernel.org Subject: Re: macvlan: Fix device ref leak when purging bc_queue > Applied and queued up for -stable, thanks Herbert.

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-25 Thread David Miller
From: Herbert Xu Date: Thu, 20 Apr 2017 20:55:12 +0800 > When a parent macvlan device is destroyed we end up purging its > broadcast queue without dropping the device reference count on > the packet source device. This causes the source device to linger. > > This

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-24 Thread Joe.Ghalam
> I'm waiting for this discussion to settle down before I apply the patch. Thanks David. I will get some answers soon, and hopefully the change is a good one.

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-24 Thread David Miller
From: Date: Mon, 24 Apr 2017 15:01:24 + >> The only thing that can stop macvlan_process_broadcast from getting >> called is macvlan_port_destroy. Nothing else can stop the work >> queue, unless of course the work queue mechanism itself is broken. > >> So if you're sure

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-24 Thread Joe.Ghalam
> The only thing that can stop macvlan_process_broadcast from getting > called is macvlan_port_destroy. Nothing else can stop the work > queue, unless of course the work queue mechanism itself is broken. > So if you're sure macvlan_port_destroy is never even called in > your case, then you'll

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-24 Thread Herbert Xu
On Fri, Apr 21, 2017 at 02:40:50PM +, joe.gha...@dell.com wrote: > That's not true. macvlan_dellink() unregisters the queue, and > macvlan_process_broadcast() will never get called. Please note that I'm not > speculating. I have traced enabled on the dev_put and dev_hold, and I'm >

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-21 Thread Joe.Ghalam
> From: Mahesh Bandewar (महेश बंडेवार) <mahe...@google.com> > Sent: Friday, April 21, 2017 12:23 PM > To: Ghalam, Joe > Cc: herb...@gondor.apana.org.au; David Miller; Wichmann, Clifford; > linux-netdev > Subject: Re: macvlan:

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-21 Thread महेश बंडेवार
e queue prior to deleting the port. > > From: Herbert Xu <herb...@gondor.apana.org.au> > Sent: Thursday, April 20, 2017 9:40 PM > To: Ghalam, Joe > Cc: da...@davemloft.net; Wichmann, Clifford; netdev@vger.kernel.org > Subject: Re: macvla

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-21 Thread David Miller
Please DO NOT top-post. Thank you.

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-21 Thread Joe.Ghalam
To: Ghalam, Joe Cc: da...@davemloft.net; Wichmann, Clifford; netdev@vger.kernel.org Subject: Re: macvlan: Fix device ref leak when purging bc_queue On Thu, Apr 20, 2017 at 04:09:56PM +, joe.gha...@dell.com wrote: > I agree with this change, but the same purge would be needed for the > m

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-20 Thread Herbert Xu
On Thu, Apr 20, 2017 at 04:09:56PM +, joe.gha...@dell.com wrote: > I agree with this change, but the same purge would be needed for the > macvlan_dellink() call also. I don't think that's necessary because as long as the master device is still around it will continue to process the

Re: macvlan: Fix device ref leak when purging bc_queue

2017-04-20 Thread Joe.Ghalam
ft.net; Wichmann, Clifford; netdev@vger.kernel.org Subject: macvlan: Fix device ref leak when purging bc_queue When a parent macvlan device is destroyed we end up purging its broadcast queue without dropping the device reference count on the packet source device. This causes the source device to

macvlan: Fix device ref leak when purging bc_queue

2017-04-20 Thread Herbert Xu
When a parent macvlan device is destroyed we end up purging its broadcast queue without dropping the device reference count on the packet source device. This causes the source device to linger. This patch drops that reference count. Fixes: 260916dfb48c ("macvlan: Fix potential use-after free