Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat
On Mon, Dec 7, 2020 at 2:41 PM John Baldwin wrote: > > On 12/7/20 12:37 PM, Kyle Evans wrote: > > On Mon, Dec 7, 2020 at 2:36 PM John Baldwin wrote: > >> > >> qemu-user uses this flag? What on earth can it be using it for? > >> > > > > It was faithfully responding that it wasn't implemented to any > > target-application usage, apparently. :-) > > I mean, it is only a flag in the struct kinfo_file flags field. Even > if it is doing some kind of compat shim for kinfo_file it should just > copy the flags field across, not be checking any of the bits. Does it > try to log the type of a file descriptor in debug traces perhaps? > Apparently we were just that convinced we needed to enumerate the values we didn't have to touch, see: https://github.com/seanbruno/qemu-bsd-user/pull/150/files -> it was actually CRIOGET that we referenced for the sole purpose of declaring it unsupported. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat
On 12/7/20 12:37 PM, Kyle Evans wrote: > On Mon, Dec 7, 2020 at 2:36 PM John Baldwin wrote: >> >> qemu-user uses this flag? What on earth can it be using it for? >> > > It was faithfully responding that it wasn't implemented to any > target-application usage, apparently. :-) I mean, it is only a flag in the struct kinfo_file flags field. Even if it is doing some kind of compat shim for kinfo_file it should just copy the flags field across, not be checking any of the bits. Does it try to log the type of a file descriptor in debug traces perhaps? -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat
On Mon, Dec 7, 2020 at 2:36 PM John Baldwin wrote: > > On 12/7/20 11:11 AM, Kyle Evans wrote: > > On Mon, Dec 7, 2020 at 12:58 PM John Baldwin wrote: > >> > >> On 12/6/20 8:51 PM, Steve Wills wrote: > >>> Hi, > >>> > >>> On 11/24/20 7:10 PM, John Baldwin wrote: > Author: jhb > Date: Wed Nov 25 00:10:54 2020 > New Revision: 368005 > URL: https://svnweb.freebsd.org/changeset/base/368005 > > Log: > Remove the cloned file descriptors for /dev/crypto. > > >>> > >>> Would this change warrant a bump of __FreeBSD_version? I only noticed > >>> because PR 251470 (radare2 not building due to KF_TYPE_CRYPTO). > >> > >> Hmm, perhaps so, though ports could also use #ifdef KF_TYPE_CRYPTO (and > >> that is probably preferred for anything using C). Looks like we haven't > >> yet had another bump of __FreeBSD_version so I can do that. > >> > > > > There's surely a better way, but this version bump would've actually > > been really handy for detecting the resulting qemu-user-static > > fallout. The build was broken for about ~9 days, neither the official > > builder or my local builder felt compelled to rebuild it absent the > > bump because I had just built it a couple revisions prior. =-( > > > > I'm kind of leaning towards trying to shoehorn a qemu-user-static > > build into ci.f.o somewhere, though, since it's used as a part of > > producing some of the weekly snapshot images and digs pretty deeply in > > other areas. I've got a Cirrus config for qemu-user-static and Cirrus > > builds it regularly for me, but that's not so helpful when the image > > it builds against is also tied to the weekly snapshot process. > > qemu-user uses this flag? What on earth can it be using it for? > It was faithfully responding that it wasn't implemented to any target-application usage, apparently. :-) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat
On 12/7/20 11:11 AM, Kyle Evans wrote: > On Mon, Dec 7, 2020 at 12:58 PM John Baldwin wrote: >> >> On 12/6/20 8:51 PM, Steve Wills wrote: >>> Hi, >>> >>> On 11/24/20 7:10 PM, John Baldwin wrote: Author: jhb Date: Wed Nov 25 00:10:54 2020 New Revision: 368005 URL: https://svnweb.freebsd.org/changeset/base/368005 Log: Remove the cloned file descriptors for /dev/crypto. >>> >>> Would this change warrant a bump of __FreeBSD_version? I only noticed >>> because PR 251470 (radare2 not building due to KF_TYPE_CRYPTO). >> >> Hmm, perhaps so, though ports could also use #ifdef KF_TYPE_CRYPTO (and >> that is probably preferred for anything using C). Looks like we haven't >> yet had another bump of __FreeBSD_version so I can do that. >> > > There's surely a better way, but this version bump would've actually > been really handy for detecting the resulting qemu-user-static > fallout. The build was broken for about ~9 days, neither the official > builder or my local builder felt compelled to rebuild it absent the > bump because I had just built it a couple revisions prior. =-( > > I'm kind of leaning towards trying to shoehorn a qemu-user-static > build into ci.f.o somewhere, though, since it's used as a part of > producing some of the weekly snapshot images and digs pretty deeply in > other areas. I've got a Cirrus config for qemu-user-static and Cirrus > builds it regularly for me, but that's not so helpful when the image > it builds against is also tied to the weekly snapshot process. qemu-user uses this flag? What on earth can it be using it for? -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat
On Mon, Dec 7, 2020 at 12:58 PM John Baldwin wrote: > > On 12/6/20 8:51 PM, Steve Wills wrote: > > Hi, > > > > On 11/24/20 7:10 PM, John Baldwin wrote: > >> Author: jhb > >> Date: Wed Nov 25 00:10:54 2020 > >> New Revision: 368005 > >> URL: https://svnweb.freebsd.org/changeset/base/368005 > >> > >> Log: > >>Remove the cloned file descriptors for /dev/crypto. > >> > > > > Would this change warrant a bump of __FreeBSD_version? I only noticed > > because PR 251470 (radare2 not building due to KF_TYPE_CRYPTO). > > Hmm, perhaps so, though ports could also use #ifdef KF_TYPE_CRYPTO (and > that is probably preferred for anything using C). Looks like we haven't > yet had another bump of __FreeBSD_version so I can do that. > There's surely a better way, but this version bump would've actually been really handy for detecting the resulting qemu-user-static fallout. The build was broken for about ~9 days, neither the official builder or my local builder felt compelled to rebuild it absent the bump because I had just built it a couple revisions prior. =-( I'm kind of leaning towards trying to shoehorn a qemu-user-static build into ci.f.o somewhere, though, since it's used as a part of producing some of the weekly snapshot images and digs pretty deeply in other areas. I've got a Cirrus config for qemu-user-static and Cirrus builds it regularly for me, but that's not so helpful when the image it builds against is also tied to the weekly snapshot process. Thanks, Kyle Evans ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat
On 12/6/20 8:51 PM, Steve Wills wrote: > Hi, > > On 11/24/20 7:10 PM, John Baldwin wrote: >> Author: jhb >> Date: Wed Nov 25 00:10:54 2020 >> New Revision: 368005 >> URL: https://svnweb.freebsd.org/changeset/base/368005 >> >> Log: >>Remove the cloned file descriptors for /dev/crypto. >> > > Would this change warrant a bump of __FreeBSD_version? I only noticed > because PR 251470 (radare2 not building due to KF_TYPE_CRYPTO). Hmm, perhaps so, though ports could also use #ifdef KF_TYPE_CRYPTO (and that is probably preferred for anything using C). Looks like we haven't yet had another bump of __FreeBSD_version so I can do that. -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat
Hi, On 11/24/20 7:10 PM, John Baldwin wrote: Author: jhb Date: Wed Nov 25 00:10:54 2020 New Revision: 368005 URL: https://svnweb.freebsd.org/changeset/base/368005 Log: Remove the cloned file descriptors for /dev/crypto. Would this change warrant a bump of __FreeBSD_version? I only noticed because PR 251470 (radare2 not building due to KF_TYPE_CRYPTO). Cheers, Steve ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat
On 11/24/20 4:10 PM, John Baldwin wrote: > Author: jhb > Date: Wed Nov 25 00:10:54 2020 > New Revision: 368005 > URL: https://svnweb.freebsd.org/changeset/base/368005 > > Log: > 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. Oof, I missed updating some tests that were still using CRIOGET. I have a patch at D27367 that I'm working on testing now. -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat
On 11/24/20 4:10 PM, John Baldwin wrote: > Author: jhb > Date: Wed Nov 25 00:10:54 2020 > New Revision: 368005 > URL: https://svnweb.freebsd.org/changeset/base/368005 > > Log: > 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 This also allows the devcrypto engine in OpenSSL 1.1.1 to work since it doesn't know about CRIOGET at all (though I have an open PR to teach OpenSSL about CRIOGET so that it will work again on older branches here: https://github.com/openssl/openssl/pull/13468 -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r368005 - in head: lib/libprocstat share/man/man4 sys/opencrypto sys/sys tools/tools/crypto usr.bin/procstat
Author: jhb Date: Wed Nov 25 00:10:54 2020 New Revision: 368005 URL: https://svnweb.freebsd.org/changeset/base/368005 Log: 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 Modified: head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h head/share/man/man4/crypto.4 head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptodev.h head/sys/sys/user.h head/tools/tools/crypto/cryptocheck.c head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat_files.c Modified: head/lib/libprocstat/libprocstat.c == --- head/lib/libprocstat/libprocstat.c Tue Nov 24 23:56:33 2020 (r368004) +++ head/lib/libprocstat/libprocstat.c Wed Nov 25 00:10:54 2020 (r368005) @@ -708,7 +708,6 @@ kinfo_type2fst(int kftype) int fst_type; } kftypes2fst[] = { { KF_TYPE_PROCDESC, PS_FST_TYPE_PROCDESC }, - { KF_TYPE_CRYPTO, PS_FST_TYPE_CRYPTO }, { KF_TYPE_DEV, PS_FST_TYPE_DEV }, { KF_TYPE_FIFO, PS_FST_TYPE_FIFO }, { KF_TYPE_KQUEUE, PS_FST_TYPE_KQUEUE }, Modified: head/lib/libprocstat/libprocstat.h == --- head/lib/libprocstat/libprocstat.h Tue Nov 24 23:56:33 2020 (r368004) +++ head/lib/libprocstat/libprocstat.h Wed Nov 25 00:10:54 2020 (r368005) @@ -64,7 +64,7 @@ #definePS_FST_TYPE_PIPE4 #definePS_FST_TYPE_PTS 5 #definePS_FST_TYPE_KQUEUE 6 -#definePS_FST_TYPE_CRYPTO 7 +/* was PS_FST_TYPE_CRYPTO 7 */ #definePS_FST_TYPE_MQUEUE 8 #definePS_FST_TYPE_SHM 9 #definePS_FST_TYPE_SEM 10 Modified: head/share/man/man4/crypto.4 == --- head/share/man/man4/crypto.4Tue Nov 24 23:56:33 2020 (r368004) +++ head/share/man/man4/crypto.4Wed Nov 25 00:10:54 2020 (r368005) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 6, 2020 +.Dd November 24, 2020 .Dt CRYPTO 4 .Os .Sh NAME @@ -122,19 +122,11 @@ Open the .Pa /dev/crypto device. .It -Create a new cryptography file descriptor via -.Dv CRIOGET -to use for all subsequent -.Xr ioctl 2 -commands. -.It -Close the -.Pa /dev/crypto -device. -.It If any symmetric-keyed cryptographic or digest operations will be performed, create a session with -.Dv CIOCGSESSION . +.Dv CIOCGSESSION +or +.Dv CIOCGSESSION2 . Most applications will require at least one symmetric session. Since cipher and MAC keys are tied to sessions, many applications will require more. @@ -152,8 +144,9 @@ or Optionally destroy a session with .Dv CIOCFSESSION . .It -Close the cryptography file descriptor with -.Xr close 2 . +Close the +.Pa /dev/crypto +device. This will automatically close any remaining sessions associated with the file desriptor. .El @@ -458,11 +451,3 @@ session: if you request a algorithm, you must supply a suitably-sized buffer. .Pp The scheme for passing arguments for asymmetric requests is baroque. -.Pp -.Dv CRIOGET -should not exist. -It should be possible to use the -.Dv CIOC Ns \&* -commands directly on a -.Pa /dev/crypto -file descriptor. Modified: head/sys/opencrypto/cryptodev.c == --- head/sys/opencrypto/cryptodev.c Tue Nov 24 23:56:33 2020 (r368004) +++ head/sys/opencrypto/cryptodev.c Wed Nov 25 00:10:54 2020 (r368005) @@ -47,9 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include -#include #include #include #include @@ -57,8 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include @@ -67,6 +66,17 @@