Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys/kern



Module Name:    src
Committed By:   riastradh
Date:           Sun Feb 27 14:16:43 UTC 2022

Modified Files:
        src/sys/kern: subr_pool.c

Log Message:
pool(9): Membar audit.

- Use atomic_store_release and atomic_load_consume for associating a
  freshly constructed pool_cache with its underlying pool.  The pool
  gets published in various ways before the pool cache is fully
  constructed.

  => Nix membar_sync -- no store-before-load is needed here.

- Take pool_head_lock around sysctl kern.pool TAILQ_FOREACH.  Then take
  a reference count, and drop the lock, around copyout.

  => Otherwise, pools could be partially initialized or freed while
     we're still trying to read from them -- and in the worst case,
     we might see a corrupted view of the tailq.

  => If we kept the lock around copyout, this could deadlock in memory
     allocation.

  => If we didn't take a reference count while releasing the lock, the
     pool could be destroyed while we're trying to traverse the list,
     sending us into oblivion instead of the next element.


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/sys/kern/subr_pool.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index