CVS commit: src/sys/opencrypto

"Taylor R Campbell" <[email protected]>
Newsgroups gmane.os.netbsd.devel.cvs
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.