Skip to contentSkip to conversation

missing rcu_derefernce of txq->qdisc

BUG Stephen Hemminger 1 participant 1 message Aug 31, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Way back in 2008, this commit added rcu_assign_pointer for the dev_queue->qdisc. But we aren't using rcu_dereference to fetch the pointer, here and a couple of other places. This is probably harmless, but could cause issues when compiler decides to optimizations because of missing barrier.

static inline void netif_schedule_queue(struct netdev_queue *txq)

{
	if (!(txq->state & QUEUE_STATE_ANY_XOFF))
		__netif_schedule(txq->qdisc);
}

Adding the needed rcu_dereference creates other problems because the the struct Qdisc needs to be fully known, net/sch_generic.h has to be included from netdevice.h which creates other build problems.

A good way to see all the fallout is to put needed __rcu annotation on netdev_tx_queue qdisc and use sparse.

I don't have time or patience to deal with it right now, maybe someone else could have a go at it.