OSDN Git Service

macvlan: Fix device ref leak when purging bc_queue
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 20 Apr 2017 12:55:12 +0000 (20:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 May 2017 04:19:54 +0000 (21:19 -0700)
commit114f0c66dab46ab5d26585d6f1a63e517098a0a7
tree8182dcbed0170b6ec5cc63ce196d9f001b91597f
parentbdeb026dfd9f27ec2e4a0ea97dab0e6e3d96e632
macvlan: Fix device ref leak when purging bc_queue

[ Upstream commit f6478218e6edc2a587b8f132f66373baa7b2497c ]

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 for...")
Reported-by: Joe Ghalam <Joe.Ghalam@dell.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/macvlan.c