CVSROOT: /cvs Module name: src Changes by: mi...@cvs.openbsd.org 2017/08/17 12:14:39
Modified files: sys/net : hfsc.c Log message: Resolve races with the hfsc_deferred timeout Since NET_LOCK no longer protects the ioctl path from timeouts running while ifq configuration is happening, the hfsc_deferred timeout needs to make sure that the underlying HFSC object is locked before attempting to reference it. This prevents the race happening after we release the ifq mutex in ifq_attach but before hfsc_free disables the timeout. The second race is possible after hfsc_alloc but before the ifq mutex gets locked in ifq_attach and a new set of ifq operations is installed. If hfsc_deferred fires in between, it wouldn't be able to reschedule itself and will no longer be executed. To prevent this, the timeout can be established when packets are enqueued instead of the moment the queue is created. With input and OK visa