taprio: Fix potencial use of invalid memory during dequeue()
authorVinicius Costa Gomes <vinicius.gomes@intel.com>
Mon, 29 Apr 2019 22:48:30 +0000 (15:48 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 May 2019 15:58:51 +0000 (11:58 -0400)
commit8c79f0ea5d6087645ed5ed5d638c338962052766
treee3904ec24efdee2e6d7239885bbf53c7161bac02
parentcd86972a9fd076aea43165394b05bbca26254cd7
taprio: Fix potencial use of invalid memory during dequeue()

Right now, this isn't a problem, but the next commit allows schedules
to be added during runtime. When a new schedule transitions from the
inactive to the active state ("admin" -> "oper") the previous one can
be freed, if it's freed just after the RCU read lock is released, we
may access an invalid entry.

So, we should take care to protect the dequeue() flow, so all the
places that access the entries are protected by the RCU read lock.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_taprio.c