Netdev List
 help / color / mirror / Atom feed
* [BUG] missing rcu_derefernce of txq->qdisc
@ 2013-08-31 17:23 Stephen Hemminger
  0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2013-08-31 17:23 UTC (permalink / raw)
  To: David Miller, Joe Perches; +Cc: netdev

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-31 17:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-31 17:23 [BUG] missing rcu_derefernce of txq->qdisc Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox