]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Remove the cloned file descriptors for /dev/crypto.
authorjhb <jhb@FreeBSD.org>
Wed, 25 Nov 2020 00:10:54 +0000 (00:10 +0000)
committerjhb <jhb@FreeBSD.org>
Wed, 25 Nov 2020 00:10:54 +0000 (00:10 +0000)
commit6597daea70bd9b93fda5c6d0dc95f9621dc6d5bb
tree3cd4ee29d26786fc5cae6115ca6dd069672d5456
parent068f0255582f80c518ba7dee14c1de71d23a411b
Remove the cloned file descriptors for /dev/crypto.

Crypto file descriptors were added in the original OCF import as a way
to provide per-open data (specifically the list of symmetric
sessions).  However, this gives a bit of a confusing API where one has
to open /dev/crypto and then invoke an ioctl to obtain a second file
descriptor.  This also does not match the API used with /dev/crypto on
other BSDs or with Linux's /dev/crypto driver.

Character devices have gained support for per-open data via cdevpriv
since OCF was imported, so use cdevpriv to simplify the userland API
by permitting ioctls directly on /dev/crypto descriptors.

To provide backwards compatibility, CRIOGET now opens another
/dev/crypto descriptor via kern_openat() rather than dup'ing the
existing file descriptor.  This preserves prior semantics in case
CRIOGET is invoked multiple times on a single file descriptor.

Reviewed by: markj
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27302
lib/libprocstat/libprocstat.c
lib/libprocstat/libprocstat.h
share/man/man4/crypto.4
sys/opencrypto/cryptodev.c
sys/opencrypto/cryptodev.h
sys/sys/user.h
tools/tools/crypto/cryptocheck.c
usr.bin/procstat/procstat.1
usr.bin/procstat/procstat_files.c