Skip to content

Commit

Permalink
netdev-vport: Fix use-after-free error in netdev_vport_route_changed().
Browse files Browse the repository at this point in the history
We can't unlock the netdev's mutex after close the netdev, because closing
the netdev might destroy the mutex.

VMware-BZ: #1275187
Signed-off-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
blp committed Jun 24, 2014
1 parent 7ed47b7 commit d90edfa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/netdev-vport.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc.
* Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -198,8 +198,9 @@ netdev_vport_route_changed(void)
netdev_change_seq_changed(netdev_);
}
}
netdev_close(netdev_);
ovs_mutex_unlock(&netdev->mutex);

netdev_close(netdev_);
}

free(vports);
Expand Down

0 comments on commit d90edfa

Please sign in to comment.