CVSROOT:        /cvs
Module name:    src
Changes by:     v...@cvs.openbsd.org    2020/03/14 23:58:48

Modified files:
        sys/kern       : subr_witness.c 

Log message:
Fix memory corruption with kern.witness.locktrace.

The allocating of lock stacks does not handle correctly the case where
the system-wide free list becomes empty. Consequently, the returned
stack buffer can still be on the CPU's free list.

This patch fixes the bug by simplifying the code. Lock stack buffers are
now allocated and freed one by one from the system-wide free list
instead of using batching.

The fix additionally addresses a buffer hoarding problem that can arise
under workloads where some CPUs are net acquirers and some other CPUs
net releasers of rwlocks.

Panic reported by Hrvoje Popovski

Reply via email to