diff options
author | 2020-03-02 17:07:49 +0000 | |
---|---|---|
committer | 2020-03-02 17:07:49 +0000 | |
commit | 2c699552a74d38c820eee4a0f16428c4cc1454e1 (patch) | |
tree | 4dff24084364d64f668a9c6c590de55ce206a64c /lib/libcrypto/evp/encode.c | |
parent | amd64 ramdisk does not support CD9660, so no use to have a cd(4). (diff) | |
download | wireguard-openbsd-2c699552a74d38c820eee4a0f16428c4cc1454e1.tar.xz wireguard-openbsd-2c699552a74d38c820eee4a0f16428c4cc1454e1.zip |
Fix use of WITNESS_UNLOCK() in rw_exit_read() and rw_exit_write().
WITNESS_UNLOCK() has to be called before the actual lock is released.
Otherwise, the checker would trigger a use-after-free if the rwlock was
dynamically allocated and another thread freed it too early.
In addition to fixing the lock release issue, this patch does
the following improvements:
* membar_exit_before_atomic() is now invoked only once per lock release.
* rwl_owner is read as late as possible to make rw_cas() failure
less likely.
* The rw_cas() of rw_exit() (now rw_do_exit()) is put inside
__predict_false(). This compacts the resulting machine code a bit.
Tested by and OK anton@
OK mpi@
Diffstat (limited to 'lib/libcrypto/evp/encode.c')
0 files changed, 0 insertions, 0 deletions