]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit50fc870fe4e93e1cec3f65add5b71b7b6617285d
treee3904ec24efdee2e6d7239885bbf53c7161bac02
parent042f4d6aa90b143686cd05c13aa201f9ed582800
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