Source-Changes archive

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

CVS commit: src/sys/opencrypto



Module Name:    src
Committed By:   riastradh
Date:           Tue May 19 15:58:25 UTC 2026

Modified Files:
        src/sys/opencrypto: cryptodev.c

Log Message:
crypto(4): Fix missing membars on reference count release.

If two threads A and B both hold references, we need to ensure that
memory ops in thread A happen before memory free in thread B in:

thread A                thread B                notes
--------                --------                -----
memory ops
atomic_dec(&refcnt)                             goes from 2 to 1
                        atomic_dec(&refcnt)     goes from 1 to 0
                        memory free

This requires a membar_release in thread A before the atomic_dec (or
atomic_dec with memory_order_release), and a membar_acquire in thread
B after the atomic_dec is found to have brought the reference count
down to zero (or atomic_dec wiht memory_order_acquire).

kern/60281: crypto(4): bugs in reference counting and test


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/opencrypto/cryptodev.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