From: Ben Pfaff Date: Mon, 2 Jun 2008 17:13:23 +0000 (-0700) Subject: Avoid wild pointer write in del_switch_port(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26e5b3af274be63234b6ba72b0f01baeb6a5f905;p=openvswitch Avoid wild pointer write in del_switch_port(). --- diff --git a/datapath/datapath.c b/datapath/datapath.c index 4b706499..c87fa241 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -387,7 +387,8 @@ static int del_switch_port(struct net_bridge_port *p) dev_set_promiscuity(p->dev, -1); rtnl_unlock(); list_del_rcu(&p->node); - rcu_assign_pointer(p->dp->ports[p->port_no], NULL); + if (p->port_no != OFPP_LOCAL) + rcu_assign_pointer(p->dp->ports[p->port_no], NULL); rcu_assign_pointer(p->dev->br_port, NULL); /* Then wait until no one is still using it, and destroy it. */