The NetBSD Project

CVS log for src/sys/opencrypto/cryptodev.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / opencrypto

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.125.10.2: download - view: text, markup, annotated - select for diffs
Wed Nov 4 23:28:01 2026 UTC (11 days, 8 hours ago) by perseant
Branches: perseant-exfatfs
Diff to: previous 1.125.10.1: preferred, colored; branchpoint 1.125: preferred, colored; next MAIN 1.126: preferred, colored
Changes since revision 1.125.10.1: +538 -588 lines
Sync with HEAD

Revision 1.139: download - view: text, markup, annotated - select for diffs
Tue Sep 22 14:46:27 2026 UTC (7 weeks, 5 days ago) by riastradh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20261102, HEAD
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +5 -4 lines
opencrypto(9): Fix mistakes in previous attempt to plug leaks.

1. Common error branch is now also used when cse is null.

2. Missed a spot in using the common error branch.

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

Revision 1.138: download - view: text, markup, annotated - select for diffs
Sat Sep 19 02:45:19 2026 UTC (8 weeks, 2 days ago) by riastradh
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +3 -3 lines
crypto(4): Fix sign error in CIOCNCRYPTM bounds check.

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

Revision 1.137: download - view: text, markup, annotated - select for diffs
Sat Sep 19 02:45:04 2026 UTC (8 weeks, 2 days ago) by riastradh
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +10 -4 lines
crypto(4): Clamp some more kmem_zalloc inputs.

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

Revision 1.136: download - view: text, markup, annotated - select for diffs
Sat Sep 19 02:44:41 2026 UTC (8 weeks, 2 days ago) by riastradh
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +4 -4 lines
crypto(4): Fix leak in error branch of CIOCNCRYPTM.

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

Revision 1.135: download - view: text, markup, annotated - select for diffs
Sun Jul 5 15:34:13 2026 UTC (4 months, 1 week ago) by riastradh
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +80 -79 lines
opencrypto(9): Sprinkle SET_ERROR dtrace probes.

Revision 1.134: download - view: text, markup, annotated - select for diffs
Sun Jul 5 15:33:44 2026 UTC (4 months, 1 week ago) by riastradh
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +44 -43 lines
opencrypto(9): Sort includes and nix trailing whitespace.

No functional change intended.

Revision 1.125.4.2: download - view: text, markup, annotated - select for diffs
Sat Jun 27 15:25:56 2026 UTC (4 months, 2 weeks ago) by martin
Branches: netbsd-10
CVS tags: netbsd-10-2-RELEASE
Diff to: previous 1.125.4.1: preferred, colored; branchpoint 1.125: preferred, colored; next MAIN 1.126: preferred, colored
Changes since revision 1.125.4.1: +108 -139 lines
Pull up following revision(s) (requested by riastradh in ticket #1278):

	sys/opencrypto/cryptodev.c: revision 1.130
	sys/opencrypto/cryptodev.c: revision 1.131
	sys/opencrypto/cryptodev.c: revision 1.132
	sys/opencrypto/cryptodev.c: revision 1.133
	tests/crypto/opencrypto/Makefile: revision 1.6
	sys/opencrypto/cryptosoft.c: revision 1.67
	sys/opencrypto/ocryptodev.c: revision 1.19
	tests/crypto/opencrypto/h_thread.c: revision 1.1
	sys/rump/dev/lib/libopencrypto/OPENCRYPTO.ioconf: revision 1.2
	tests/crypto/opencrypto/h_thread.c: revision 1.2
	sys/rump/dev/lib/libopencrypto/opencrypto_component.c: revision 1.7
	tests/crypto/opencrypto/t_opencrypto.sh: revision 1.12
	tests/crypto/opencrypto/t_opencrypto.sh: revision 1.13
	sys/opencrypto/cryptodev_internal.h: revision 1.5
	tests/crypto/opencrypto/t_opencrypto.sh: revision 1.14
	sys/opencrypto/cryptodev.c: revision 1.129
	distrib/sets/lists/debug/mi: revision 1.512
	distrib/sets/lists/tests/mi: revision 1.1417

Add a threaded test to test for races in cryptodev.
new thread cryptodev test


crypto(4): Make test more reliable, and test more.
1. New thread to concurrently create and destroy sessions.
   (There should really be multiple threads to concurrently compete
   with each other to create and destroy sessions, but this is
   already surfacing more crashes, as I expected.)
2. Handle EBUSY in CIOCFSESSION in case there is a concurrent
   CIOCCRYPT, as we are trying to test.
3. Handle CIOCCRYPT failure if a concurrent CIOCFSESSION beat us to
   it, as we are trying to test
4. Dump core if the threads get stuck for too long.
5. Provide stack traces from the test program or rump server if they
   dump core.
PR kern/60281: crypto(4): bugs in reference counting and test


crypto(4): Take reference _before_ releasing the lock.

Otherwise nothing ensures the object will still exist by the time we
try to take the reference.

Also guard against too many references, since this is only a 32-bit
reference count.
PR kern/60281: crypto(4): bugs in reference counting and test


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


crypto(4): Disentangle initialization and attachment goo.
Lotta unnecessary boilerplate deleted here!

Disable module unloading: can't be done safely.  Explain precisely
why it can't be done safely.

This also fixes annoying `crypto: unable to register devsw, error 17'
messages in rump dmesg by having exactly one path to devsw_attach.
PR kern/60281: crypto(4): bugs in reference counting and test


crypto(4): Omit needless locking in fcrypt_dtor.

We must have exclusive access to the object for this function to work
at all, so if removing the locks appeared to cause issues, it would
necessarily happen only because there is a bug somewhere else.
PR kern/60281: crypto(4): bugs in reference counting and test
crypto(4): Nix spurious mutex_exit; add missing bounds checks.

Consistently use `foo = kmem_alloc(n * sizeof(*foo), ...)' instead of
`sizeof(struct whatever_foo_is)'.  Makes it easier for a reader to
notice a discrepancy this way.

Move CRYPTODEV_OPS_MAX to cryptodev_internal.h so it can be used by
the compat ocryptodev.c shims too.  I think this is waaaaaaaaaaaaay
too high, by the way.  For example, it looks like qat(4) puts a limit
of 16384 on the number of sessions.  Other devices like hifn(4) look
like they're limited to numbers of sessions ranging from 2 to around
256.
PR kern/60281: crypto(4): bugs in reference counting and test

Revision 1.126.2.2: download - view: text, markup, annotated - select for diffs
Sat Jun 27 15:23:23 2026 UTC (4 months, 2 weeks ago) by martin
Branches: netbsd-11
CVS tags: netbsd-11-1-RELEASE, netbsd-11-0-RELEASE, netbsd-11-0-RC7, netbsd-11-0-RC6
Diff to: previous 1.126.2.1: preferred, colored; branchpoint 1.126: preferred, colored; next MAIN 1.127: preferred, colored
Changes since revision 1.126.2.1: +108 -139 lines
Pull up following revision(s) (requested by riastradh in ticket #330):

	sys/opencrypto/cryptodev.c: revision 1.130
	sys/opencrypto/cryptodev.c: revision 1.131
	sys/opencrypto/cryptodev.c: revision 1.132
	sys/opencrypto/cryptodev.c: revision 1.133
	tests/crypto/opencrypto/Makefile: revision 1.6
	sys/opencrypto/cryptosoft.c: revision 1.67
	sys/opencrypto/ocryptodev.c: revision 1.19
	tests/crypto/opencrypto/h_thread.c: revision 1.1
	sys/rump/dev/lib/libopencrypto/OPENCRYPTO.ioconf: revision 1.2
	tests/crypto/opencrypto/h_thread.c: revision 1.2
	sys/rump/dev/lib/libopencrypto/opencrypto_component.c: revision 1.7
	tests/crypto/opencrypto/t_opencrypto.sh: revision 1.12
	tests/crypto/opencrypto/t_opencrypto.sh: revision 1.13
	sys/opencrypto/cryptodev_internal.h: revision 1.5
	tests/crypto/opencrypto/t_opencrypto.sh: revision 1.14
	sys/opencrypto/cryptodev.c: revision 1.129
	distrib/sets/lists/debug/mi: revision 1.512
	distrib/sets/lists/tests/mi: revision 1.1417

Add a threaded test to test for races in cryptodev.
new thread cryptodev test


crypto(4): Make test more reliable, and test more.
1. New thread to concurrently create and destroy sessions.
   (There should really be multiple threads to concurrently compete
   with each other to create and destroy sessions, but this is
   already surfacing more crashes, as I expected.)
2. Handle EBUSY in CIOCFSESSION in case there is a concurrent
   CIOCCRYPT, as we are trying to test.
3. Handle CIOCCRYPT failure if a concurrent CIOCFSESSION beat us to
   it, as we are trying to test
4. Dump core if the threads get stuck for too long.
5. Provide stack traces from the test program or rump server if they
   dump core.
PR kern/60281: crypto(4): bugs in reference counting and test


crypto(4): Take reference _before_ releasing the lock.

Otherwise nothing ensures the object will still exist by the time we
try to take the reference.

Also guard against too many references, since this is only a 32-bit
reference count.
PR kern/60281: crypto(4): bugs in reference counting and test


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


crypto(4): Disentangle initialization and attachment goo.
Lotta unnecessary boilerplate deleted here!

Disable module unloading: can't be done safely.  Explain precisely
why it can't be done safely.

This also fixes annoying `crypto: unable to register devsw, error 17'
messages in rump dmesg by having exactly one path to devsw_attach.
PR kern/60281: crypto(4): bugs in reference counting and test


crypto(4): Omit needless locking in fcrypt_dtor.

We must have exclusive access to the object for this function to work
at all, so if removing the locks appeared to cause issues, it would
necessarily happen only because there is a bug somewhere else.
PR kern/60281: crypto(4): bugs in reference counting and test
crypto(4): Nix spurious mutex_exit; add missing bounds checks.

Consistently use `foo = kmem_alloc(n * sizeof(*foo), ...)' instead of
`sizeof(struct whatever_foo_is)'.  Makes it easier for a reader to
notice a discrepancy this way.

Move CRYPTODEV_OPS_MAX to cryptodev_internal.h so it can be used by
the compat ocryptodev.c shims too.  I think this is waaaaaaaaaaaaay
too high, by the way.  For example, it looks like qat(4) puts a limit
of 16384 on the number of sessions.  Other devices like hifn(4) look
like they're limited to numbers of sessions ranging from 2 to around
256.
PR kern/60281: crypto(4): bugs in reference counting and test

Revision 1.133: download - view: text, markup, annotated - select for diffs
Tue May 19 19:00:00 2026 UTC (5 months, 4 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +13 -14 lines
crypto(4): Nix spurious mutex_exit; add missing bounds checks.

Consistently use `foo = kmem_alloc(n * sizeof(*foo), ...)' instead of
`sizeof(struct whatever_foo_is)'.  Makes it easier for a reader to
notice a discrepancy this way.

Move CRYPTODEV_OPS_MAX to cryptodev_internal.h so it can be used by
the compat ocryptodev.c shims too.  I think this is waaaaaaaaaaaaay
too high, by the way.  For example, it looks like qat(4) puts a limit
of 16384 on the number of sessions.  Other devices like hifn(4) look
like they're limited to numbers of sessions ranging from 2 to around
256.

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

Revision 1.132: download - view: text, markup, annotated - select for diffs
Tue May 19 15:59:01 2026 UTC (5 months, 4 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +2 -4 lines
crypto(4): Omit needless locking in fcrypt_dtor.

We must have exclusive access to the object for this function to work
at all, so if removing the locks appeared to cause issues, it would
necessarily happen only because there is a bug somewhere else.

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

Revision 1.131: download - view: text, markup, annotated - select for diffs
Tue May 19 15:58:37 2026 UTC (5 months, 4 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +91 -124 lines
crypto(4): Disentangle initialization and attachment goo.

Lotta unnecessary boilerplate deleted here!

Disable module unloading: can't be done safely.  Explain precisely
why it can't be done safely.

This also fixes annoying `crypto: unable to register devsw, error 17'
messages in rump dmesg by having exactly one path to devsw_attach.

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

Revision 1.130: download - view: text, markup, annotated - select for diffs
Tue May 19 15:58:24 2026 UTC (5 months, 4 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +4 -2 lines
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

Revision 1.129: download - view: text, markup, annotated - select for diffs
Tue May 19 15:58:12 2026 UTC (5 months, 4 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +6 -3 lines
crypto(4): Take reference _before_ releasing the lock.

Otherwise nothing ensures the object will still exist by the time we
try to take the reference.

Also guard against too many references, since this is only a 32-bit
reference count.

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

Revision 1.125.4.1: download - view: text, markup, annotated - select for diffs
Thu May 7 14:43:24 2026 UTC (6 months, 1 week ago) by martin
Branches: netbsd-10
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +328 -356 lines
Pull up following revision(s) (requested by christos in ticket #1262):

	sys/opencrypto/crypto.c: revision 1.132
	sys/opencrypto/crypto.c: revision 1.133
	sys/opencrypto/cryptosoft.h: revision 1.8
	sys/opencrypto/xform.c: revision 1.32
	sys/opencrypto/deflate.h: revision 1.10
	sys/opencrypto/cryptodev.h: revision 1.52
	sys/opencrypto/cryptosoft.c: revision 1.66
	sys/opencrypto/cryptodev.h: revision 1.53
	sys/opencrypto/ocryptodev.c: revision 1.18
	sys/opencrypto/cryptodev_internal.h: revision 1.4
	sys/opencrypto/aesxcbcmac.c: revision 1.4
	sys/opencrypto/cryptodev.c: revision 1.127
	sys/opencrypto/aesxcbcmac.h: revision 1.3
	sys/opencrypto/cryptodev.c: revision 1.128
	sys/opencrypto/cryptosoft_xform.c: revision 1.31
	sys/opencrypto/deflate.c: revision 1.24
	sys/opencrypto/deflate.c: revision 1.25
	sys/opencrypto/xform.h: revision 1.22
	sys/opencrypto/ocryptodev.h: revision 1.5
	sys/opencrypto/ocryptodev.h: revision 1.6

u_intXX_t -> uintXX_t

Fix:
An integer wraparound bug that could cause a NULL pointer exception.
Data sharing issues that could cause data corruption.
Locking issues that could cause double freeing or using free memory.

Issues discovered by nasm and coordinated by VulnCheck
Thank you!

Revision 1.126.2.1: download - view: text, markup, annotated - select for diffs
Thu May 7 14:40:13 2026 UTC (6 months, 1 week ago) by martin
Branches: netbsd-11
CVS tags: netbsd-11-0-RC5, netbsd-11-0-RC4
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +328 -356 lines
Pull up following revision(s) (requested by christos in ticket #262):

	sys/opencrypto/crypto.c: revision 1.132
	sys/opencrypto/crypto.c: revision 1.133
	sys/opencrypto/cryptosoft.h: revision 1.8
	sys/opencrypto/xform.c: revision 1.32
	sys/opencrypto/deflate.h: revision 1.10
	sys/opencrypto/cryptodev.h: revision 1.52
	sys/opencrypto/cryptosoft.c: revision 1.66
	sys/opencrypto/cryptodev.h: revision 1.53
	sys/opencrypto/ocryptodev.c: revision 1.18
	sys/opencrypto/cryptodev_internal.h: revision 1.4
	sys/opencrypto/aesxcbcmac.c: revision 1.4
	sys/opencrypto/cryptodev.c: revision 1.127
	sys/opencrypto/aesxcbcmac.h: revision 1.3
	sys/opencrypto/cryptodev.c: revision 1.128
	sys/opencrypto/cryptosoft_xform.c: revision 1.31
	sys/opencrypto/deflate.c: revision 1.24
	sys/opencrypto/deflate.c: revision 1.25
	sys/opencrypto/xform.h: revision 1.22
	sys/opencrypto/ocryptodev.h: revision 1.5
	sys/opencrypto/ocryptodev.h: revision 1.6

u_intXX_t -> uintXX_t

Fix:
An integer wraparound bug that could cause a NULL pointer exception.
Data sharing issues that could cause data corruption.
Locking issues that could cause double freeing or using free memory.

Issues discovered by nasm and coordinated by VulnCheck
Thank you!

Revision 1.128: download - view: text, markup, annotated - select for diffs
Wed Apr 29 14:51:58 2026 UTC (6 months, 2 weeks ago) by christos
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +30 -30 lines
u_intXX_t -> uintXX_t

Revision 1.127: download - view: text, markup, annotated - select for diffs
Wed Apr 29 14:49:51 2026 UTC (6 months, 2 weeks ago) by christos
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +317 -345 lines
Fix:

An integer wraparound bug that could cause a NULL pointer exception.
Data sharing issues that could cause data corruption.
Locking issues that could cause double freeing or using free memory.

Issues discovered by nasm and coordinated by VulnCheck

Thank you!

Revision 1.125.10.1: download - view: text, markup, annotated - select for diffs
Sat Aug 2 05:57:52 2025 UTC (15 months, 2 weeks ago) by perseant
Branches: perseant-exfatfs
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +3 -3 lines
Sync with HEAD

Revision 1.126: download - view: text, markup, annotated - select for diffs
Thu Apr 17 12:59:58 2025 UTC (18 months, 4 weeks ago) by riastradh
Branches: MAIN
CVS tags: perseant-exfatfs-base-20250801, netbsd-11-base, netbsd-11-0-RC3, netbsd-11-0-RC2, netbsd-11-0-RC1
Branch point for: netbsd-11
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +3 -3 lines
opencrypto: Fix typo that somehow snuck past our resident typo-hunter.

crypto_userasymcrypto (as in asymmetric), not crypto_userasmcrypto
(as in assembly).

Revision 1.125: download - view: text, markup, annotated - select for diffs
Sat Sep 10 12:14:17 2022 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, perseant-exfatfs-base-20240630, perseant-exfatfs-base, netbsd-10-base, netbsd-10-1-RELEASE, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Branch point for: perseant-exfatfs, netbsd-10
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +4 -4 lines
fix misspellings of 'available' and nearby typos

Revision 1.124: download - view: text, markup, annotated - select for diffs
Sun May 22 11:40:38 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +2 -24 lines
opencrypto: Prune dead code now that crypto_dispatch never fails.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Sun May 22 11:40:29 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +9 -20 lines
opencrypto: crypto_dispatch never fails now.  Make it return void.

Same with crypto_kdispatch.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Sun May 22 11:40:03 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +4 -18 lines
opencrypto: Rip out EAGAIN logic when unregistering crypto drivers.

I'm pretty sure this never worked reliably based on code inspection,
and it's unlikely to have ever been tested because it only applies
when unregistering a driver -- but we have no crypto drivers for
removable devices, so it would only apply if we went out of our way
to trigger detach with drvctl.

Instead, just make the operation fail with ENODEV, and remove all the
callback logic to resubmit the request on EAGAIN.  (Maybe this should
be ENXIO, but crypto_kdispatch already does ENODEV.)

Revision 1.121: download - view: text, markup, annotated - select for diffs
Sun May 22 11:39:45 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +12 -16 lines
crypto(4): Nix dead code now that crypto_freesession never fails.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Sun May 22 11:39:37 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +4 -4 lines
opencrypto: Make crypto_freesession return void.

No callers use the return value.  It is not sensible to allow this to
fail.

Revision 1.119: download - view: text, markup, annotated - select for diffs
Sun May 22 11:39:17 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +3 -2 lines
crypto(4): crypto_freesession should never fail here.

It can only fail if we pass it an invalid sid, which the logic to
maintain the user sessions should not do.  So kassert error=0 here.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sun May 22 11:34:29 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +12 -2 lines
crypto(4): Refuse crypto operations with nothing in them earlier.

This way we avoid passing 0 to crypto_getreq -- makes it easier to
reason about everything downstream.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Sun May 22 11:30:41 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +12 -16 lines
opencrypto: Make crp_callback, krp_callback return void.

Nothing uses the return values inside opencrypto, so let's stop
making users return them.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Sun May 22 11:29:54 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +18 -19 lines
crypto(4): Fix possible use-after-free in race around detach.

This is extremely unlikely because I don't think we have any drivers
for removable crypto decelerators^Waccelerators...but if we were to
sprout one, and someone ran crypto_dispatch concurrently with
crypto_unregister, cryptodev_cb/mcb would enter with crp->crp_etype =
EAGAIN and with CRYPTO_F_DONE set in crp->crp_flags.  In this case,
cryptodev_cb/mcb would issue crypto_dispatch but -- since nothing
clears CRYPTO_F_DONE -- it would _also_ consider the request done and
notify the ioctl thread of that.

With this change, we return early if crypto_dispatch succeeds.  No
need to consult CRYPTO_F_DONE: if the callback is invoked it's done,
and if we try to redispatch it on EAGAIN but crypto_dispatch fails,
it's done.  (Soon we'll get rid of the possibility of crypto_dispatch
failing synchronously, but not just yet.)

XXX This path could really use some testing!

Revision 1.115: download - view: text, markup, annotated - select for diffs
Sat May 21 23:11:03 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +3 -4 lines
crypto(4): Fix set-but-unused variable warning.

This deliberately ignores the error code returned by crypto_dispatch,
but that error code is fundamentally incoherent and the issue will be
mooted by subsequent changes to make it return void and always pass
the error through the callback, as well as subsequent changes to rip
out the EAGAIN logic anyway.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Sat May 21 20:37:18 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +2 -5 lines
crypto(4): Don't signal the condvar for multi-operation completion.

The condvar may be destroyed by the time we got here, and nothing
waits on it anyway -- instead the caller is expected to select/poll
for completion in userland.

The bug was already here, but the recent change to eliminate
CRYPTO_F_CBIMM made it happen more often by causing the callback to
_always_ be run asynchronously instead of sometimes being run
synchronously.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Thu May 19 20:51:46 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +5 -11 lines
opencrypto: Nix CRYPTO_F_USER, CRYPTO_F_CBIMM, CRYPTO_F_CBIFSYNC.

CRYPTO_F_USER is no longer needed.  It was introduced in 2008 by
darran@ in crypto.c 1.30, cryptodev.c 1.45 in an attempt to avoid
double-free between the issuing thread and asynchronous callback.
But the `fix' didn't work.  In 2017, knakahara@ fixed it properly in
cryptodev.c 1.87 by distinguishing `the crypto operation has
completed' (CRYPTO_F_DONE) from `the callback is done touching the
crp object' (CRYPTO_F_DQRETQ, now renamed to CRYPTODEV_F_RET).

CRYPTO_F_CBIMM formerly served to invoke the callback synchronously
from the driver's interrupt completion routine, to reduce contention
on what was once a single cryptoret thread.  Now, there is a per-CPU
queue and softint for much cheaper processing, so there is less
motivation for this in the first place.  So let's remove the
complicated logic.  This means the callbacks never run in hard
interrupt context, which means we don't need to worry about recursion
into crypto_dispatch in hard interrupt context.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Wed May 18 20:03:58 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +4 -14 lines
crypto(4): Simplify error test in cryptodev_op.

No functional change intended.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Wed May 18 20:03:45 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +3 -4 lines
crypto(4): Narrow scope of cryptodev_mtx to cover wait.

No functional change intended -- this only removes an unnecessary
lock/unlock cycle in the error case.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Wed May 18 20:03:32 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +3 -23 lines
crypto(4): Nix long-dead code and comments.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Wed May 18 20:02:49 2022 UTC (4 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +4 -4 lines
crypto(4): Use IPL_NONE, not IPL_NET, for /dev/crypto pools.

These are used (pool_get/put) only from thread context, never from
interrupt or even soft interrupt context.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Tue May 17 09:53:09 2022 UTC (4 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +20 -25 lines
opencrypto(9): Omit needless casts around callbacks.

Just declare the right types to begin with.  No functional change
intended.

Revision 1.107: download - view: text, markup, annotated - select for diffs
Thu Mar 31 19:30:17 2022 UTC (4 years, 7 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +13 -18 lines
For device modules that provide both auto-config and /dev/xxx
interfaces, make sure that initialization and destruction
follow the proper sequence.  This is triggered by the recent
changes to the devsw stuff; per riastradh@ the required call
sequence is:

	devsw_attach()
	config_init_component() or config_cf*_attach()
	...
	config_fini_component() or config_cf*_detach()
	devsw_detach()

While here, add a few missing calls to some of the detach
routines.

Testing of these changes has been limited to:
	1. compile without build break
	2. no related test failures from atf
	3. modload/modunload work as well as
	   before.

No functional device testing done, since I don't have any
of these devices.  Let me know of any damage I might cause
here!

XXX Some of the modules affected by this commit are already
XXX broken;  see kern/56772.  This commit does not break
any additional modules (as far as I know).

Revision 1.106: download - view: text, markup, annotated - select for diffs
Tue Jun 30 04:14:55 2020 UTC (6 years, 4 months ago) by riastradh
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +3 -3 lines
Rename enc_xform_rijndael128 -> enc_xform_aes.

Update netipsec dependency.

Revision 1.98.4.4: download - view: text, markup, annotated - select for diffs
Tue Apr 21 18:42:44 2020 UTC (6 years, 6 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.98.4.3: preferred, colored; branchpoint 1.98: preferred, colored; next MAIN 1.99: preferred, colored
Changes since revision 1.98.4.3: +2 -4 lines
Sync with HEAD

Revision 1.104.4.1: download - view: text, markup, annotated - select for diffs
Mon Apr 20 11:29:13 2020 UTC (6 years, 6 months ago) by bouyer
Branches: bouyer-xenpvh
Diff to: previous 1.104: preferred, colored; next MAIN 1.105: preferred, colored
Changes since revision 1.104: +4 -6 lines
Sync with HEAD

Revision 1.98.4.3: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:05:17 2020 UTC (6 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.98.4.2: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.4.2: +2 -0 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.105: download - view: text, markup, annotated - select for diffs
Mon Apr 13 00:27:17 2020 UTC (6 years, 7 months ago) by chs
Branches: MAIN
CVS tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +4 -6 lines
slightly change and fix the semantics of pool_set*wat(), pool_sethardlimit()
and pool_prime() (and their pool_cache_* counterparts):

 - the pool_set*wat() APIs are supposed to specify thresholds for the count of
   free items in the pool before pool pages are automatically allocated or freed
   during pool_get() / pool_put(), whereas pool_sethardlimit() and pool_prime()
   are supposed to specify minimum and maximum numbers of total items
   in the pool (both free and allocated).  these were somewhat conflated
   in the existing code, so separate them as they were intended.

 - change pool_prime() to take an absolute number of items to preallocate
   rather than an increment over whatever was done before, and wait for
   any memory allocations to succeed.  since pool_prime() can no longer fail
   after this, change its return value to void and adjust all callers.

 - pool_setlowat() is documented as not immediately attempting to allocate
   any memory, but it was changed some time ago to immediately try to allocate
   up to the lowat level, so just fix the manpage to describe the current
   behaviour.

 - add a pool_cache_prime() to complete the API set.

Revision 1.98.4.2: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:08:59 2020 UTC (6 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.98.4.1: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.4.1: +15 -7 lines
Merge changes from current as of 20200406

Revision 1.102.2.2: download - view: text, markup, annotated - select for diffs
Sat Feb 29 20:21:08 2020 UTC (6 years, 8 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.102.2.1: preferred, colored; branchpoint 1.102: preferred, colored; next MAIN 1.103: preferred, colored
Changes since revision 1.102.2.1: +8 -7 lines
Sync with head.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Mon Jan 27 02:56:15 2020 UTC (6 years, 9 months ago) by pgoyette
Branches: MAIN
CVS tags: phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base, ad-namecache-base3
Branch point for: bouyer-xenpvh
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +8 -7 lines
If we get an error from devsw_attach(), don't destroy the error value,
since we need to return it to our caller.  While we're here, improve
the value of the debug message by actually printing the error value.

Revision 1.102.2.1: download - view: text, markup, annotated - select for diffs
Fri Jan 17 21:47:36 2020 UTC (6 years, 10 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +3 -2 lines
Sync with head.

Revision 1.103: download - view: text, markup, annotated - select for diffs
Thu Jan 16 15:29:24 2020 UTC (6 years, 10 months ago) by christos
Branches: MAIN
CVS tags: ad-namecache-base2, ad-namecache-base1
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +3 -2 lines
Initialize the session variable to an impossible session to prevent compiler
warnings.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Fri Nov 29 08:30:30 2019 UTC (6 years, 11 months ago) by hikaru
Branches: MAIN
CVS tags: ad-namecache-base
Branch point for: ad-namecache
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +8 -2 lines
crypto(4): accept CRYPTO_SHA2_384_HMAC and CRYPTO_SHA2_512_HMAC.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Thu Jun 13 02:02:45 2019 UTC (7 years, 5 months ago) by christos
Branches: MAIN
CVS tags: phil-wifi-20191119, netbsd-9-base, netbsd-9-5-RELEASE, netbsd-9-4-RELEASE, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +4 -2 lines
don't always panic when modunload crypto (int the pool destroy code, because
the pools are busy). XXX: this is still racy; we need to prevent creating
more sessions while destroying.

Revision 1.98.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:09:49 2019 UTC (7 years, 5 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +10 -11 lines
Sync with HEAD

Revision 1.100: download - view: text, markup, annotated - select for diffs
Fri Mar 1 11:06:57 2019 UTC (7 years, 8 months ago) by pgoyette
Branches: MAIN
CVS tags: phil-wifi-20190609, isaki-audio2-base, isaki-audio2
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +3 -3 lines
Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as briefly
discussed on irc.

NFCI intended.

Ride the earlier kernel bump - it;s getting crowded.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Sun Jan 27 02:08:48 2019 UTC (7 years, 9 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +10 -11 lines
Merge the [pgoyette-compat] branch

Revision 1.98.2.11: download - view: text, markup, annotated - select for diffs
Tue Jan 22 07:42:42 2019 UTC (7 years, 9 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.98.2.10: preferred, colored; branchpoint 1.98: preferred, colored; next MAIN 1.99: preferred, colored
Changes since revision 1.98.2.10: +5 -16 lines
Convert the MODULE_{,VOID_}HOOK_CALL macros to do everything in-line
rather than defining an intermediate hook##call function.  Almost
all of the hooks are called only once, and although we lose the
ability of doing things like

	if (MODULE_HOOK_CALL(...) == 0) ...

we simplify things quite a bit.  With this change, we no longer need
to have both declaration and definition macros, and the definition
no longer needs to have both prototype argument list and a "real"
argument list.

FWIW, the above if now needs to written as

	int ret;

	MODULE_HOOK_CALL(..., ret);
	if (ret == 0) ...

with appropriate use of braces {}.

Revision 1.98.2.10: download - view: text, markup, annotated - select for diffs
Fri Jan 18 00:01:02 2019 UTC (7 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.98.2.9: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.2.9: +4 -4 lines
Don't restrict hooks to having only int or void types.  Pass the hook's
type to the various macros, as needed.

Allows us to reduce diffs to original in at least one or two places (we
no longer have to provide an additional parameter to the hook routine
for returning a non-int return value).

Revision 1.98.2.9: download - view: text, markup, annotated - select for diffs
Mon Jan 14 13:34:28 2019 UTC (7 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.98.2.8: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.2.8: +4 -4 lines
Create a variant of the HOOK macros that handles hook routines of
type void, and use them where appropriate.

Revision 1.98.2.8: download - view: text, markup, annotated - select for diffs
Sun Jan 13 10:49:51 2019 UTC (7 years, 10 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.98.2.7: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.2.7: +5 -5 lines
Remove the HOOK2 versions of the MODULE_HOOK macros.  There were
only a few uses, and using them led to some lack of clarity in the
code.  Instead, we now use two separate hooks, with names that
make it clear(er) what we're doing.

This also positions us to start unraveling some of the rtsock_50
mess, which will need (at least) five hooks.

Revision 1.98.2.7: download - view: text, markup, annotated - select for diffs
Sat Sep 29 21:36:15 2018 UTC (8 years, 1 month ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.98.2.6: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.2.6: +3 -3 lines
In MODULE_HOOK_CALL_DECL we don't need to provide the actual argument
list for calling the hook function, nor do we need to provide the
default value (for when the hook has not been set).

Revision 1.98.2.6: download - view: text, markup, annotated - select for diffs
Sun Sep 23 01:33:26 2018 UTC (8 years, 1 month ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.98.2.5: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.2.5: +4 -10 lines
Split the compat_crypto_50 from the rest of the crypto module

Cleanup some stuff left over from similar changes to raid modules.

Revision 1.98.2.5: download - view: text, markup, annotated - select for diffs
Sat Sep 22 10:33:50 2018 UTC (8 years, 1 month ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.98.2.4: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.2.4: +18 -5 lines
When the compat code needs to callback to the original code, we cannot
call directly via the routines' global symbols, since the original code
might not be built-in.  So, the original code that calls compat code
needs to pass in the addresses of the callbacks.  This allows for the
compat code to be built whether or not the original (calling) code is
included.

XXX Done for cryptodev, will need to do the same thing for ccd(4) and
XXX vnd(4)

Revision 1.98.2.4: download - view: text, markup, annotated - select for diffs
Tue Sep 18 23:03:55 2018 UTC (8 years, 1 month ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.98.2.3: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.2.3: +4 -4 lines
The COMPAT_HOOK macros were renamed to MODULE_HOOK, adjust all callers

Revision 1.98.2.3: download - view: text, markup, annotated - select for diffs
Tue Sep 18 01:15:58 2018 UTC (8 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.98.2.2: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.2.2: +4 -2 lines
Split the COMPAT_CALL_HOOK to separate the declaration from the
implementation.  Some hooks are called from multiple source files,
and the old method resulted in duplicate implementations.

Implement MP-safe hooks for the usb_subr_30 code.  Pass the helper
functions as arguments to the compat code so it does not have to
determine if the kernel contains usb code.

Revision 1.98.2.2: download - view: text, markup, annotated - select for diffs
Mon Sep 17 11:04:31 2018 UTC (8 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.98.2.1: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.2.1: +8 -3 lines
Adapt (most of) the indirect function pointers to the new MP-safe
mechanism.  Still remaining are the compat_netbsd32 stuff, and
some usb subroutines.

Revision 1.98.2.1: download - view: text, markup, annotated - select for diffs
Fri Mar 23 09:41:10 2018 UTC (8 years, 7 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +7 -11 lines
Handle the compat_50 stuff for opencrypto/cryptodev

Revision 1.98: download - view: text, markup, annotated - select for diffs
Thu Feb 8 09:05:20 2018 UTC (8 years, 9 months ago) by dholland
Branches: MAIN
CVS tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: phil-wifi, pgoyette-compat
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +3 -3 lines
Typos.

Revision 1.68.12.2: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:39:06 2017 UTC (8 years, 11 months ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.68.12.1: preferred, colored; branchpoint 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68.12.1: +217 -184 lines
update from HEAD

Revision 1.97: download - view: text, markup, annotated - select for diffs
Thu Nov 30 20:25:55 2017 UTC (8 years, 11 months ago) by christos
Branches: MAIN
CVS tags: tls-maxphys-base-20171202
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +3 -2 lines
add fo_name so we can identify the fileops in a simple way.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Tue Nov 14 14:29:33 2017 UTC (9 years ago) by christos
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +7 -4 lines
check results of pool_prime.

Revision 1.82.2.4: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:53:13 2017 UTC (9 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.82.2.3: preferred, colored; branchpoint 1.82: preferred, colored; next MAIN 1.83: preferred, colored
Changes since revision 1.82.2.3: +208 -179 lines
Sync with HEAD

Revision 1.92.2.1: download - view: text, markup, annotated - select for diffs
Wed Jul 5 20:19:21 2017 UTC (9 years, 4 months ago) by snj
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Diff to: previous 1.92: preferred, colored; next MAIN 1.93: preferred, colored
Changes since revision 1.92: +39 -6 lines
Pull up following revision(s) (requested by knakahara in ticket #97):
	sys/opencrypto/crypto.c: 1.87-1.91
	sys/opencrypto/cryptodev.c: 1.93-1.95
	sys/opencrypto/cryptodev.h: 1.37
	sys/opencrypto/cryptosoft.c: 1.52
	sys/rump/dev/lib/libopencrypto/opencrypto_component.c: 1.5
sanitize count used for kmem_alloc size.
Hmm, who uses CIOCNGSESSION, CIOCNFSESSION, CIOCNCRYPTM or CIOCNFKEYM?
--
sanitize in CIOCNCRYPTM and initialize comp_alg in CIOCNGSESSION
--
must release cap->cc_lock before calling cap->cc_newsession() because of spinlock.
--
refactor crypto_newsession() like FreeBSD.
--
support multiple encryption drivers (port from FreeBSD).
--
Divide crp_devflags from crp_flags to write exclusively.
CRYPTO_F_DQRETQ(new name is CRYPTODEV_F_RET) is used by cryptodev.c only.
It should be divided to other member.
--
Reduce crypto_ret_q_mtx lock regions.
crypto.c does not access the members of crp when the crp is in crp_q or
crp_ret_q. Furthermore, crp_q and crp_ret_q are protected by each mutex,
so the members of crp is not shared. That means crp_flags is not required
mutex in crypto.c.
--
fix cryptosoft.c:r1.51 mistake. swcrypto_attach() must not be called from module_init_class().
swcrypto_attach() will call softint_establish(), it must be called after cpus
attached. module_init_class() is too early to call softint_establish().
--
simplify mutex_enter/exit(crypto_q_mtx), and fix missing exit.
--
reduce rump waring message. pointed out by ozaki-r@n.o, thanks.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Thu Jun 15 12:41:18 2017 UTC (9 years, 5 months ago) by knakahara
Branches: MAIN
CVS tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +6 -6 lines
Divide crp_devflags from crp_flags to write exclusively.

CRYPTO_F_DQRETQ(new name is CRYPTODEV_F_RET) is used by cryptodev.c only.
It should be divided to other member.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Thu Jun 8 09:49:46 2017 UTC (9 years, 5 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +10 -2 lines
sanitize in CIOCNCRYPTM and initialize comp_alg in CIOCNGSESSION

Revision 1.93: download - view: text, markup, annotated - select for diffs
Thu Jun 8 03:02:26 2017 UTC (9 years, 5 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +27 -2 lines
sanitize count used for kmem_alloc size.

Hmm, who uses CIOCNGSESSION, CIOCNFSESSION, CIOCNCRYPTM or CIOCNFKEYM?

Revision 1.92: download - view: text, markup, annotated - select for diffs
Fri Jun 2 09:46:57 2017 UTC (9 years, 5 months ago) by knakahara
Branches: MAIN
CVS tags: netbsd-8-base
Branch point for: netbsd-8
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +79 -79 lines
rename crypto_mtx to cryptodev_mtx

It is used by cryptodev.c and ocryptodev.c only.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Thu May 25 05:24:57 2017 UTC (9 years, 5 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +16 -8 lines
add cryptkop alloc/free KPI instead of manipulating cryptkop_pool directly.

Revision 1.89.2.4: download - view: text, markup, annotated - select for diffs
Fri May 19 00:22:58 2017 UTC (9 years, 6 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.89.2.3: preferred, colored; branchpoint 1.89: preferred, colored; next MAIN 1.90: preferred, colored
Changes since revision 1.89.2.3: +63 -69 lines
Resolve conflicts from previous merge (all resulting from $NetBSD
keywork expansion)

Revision 1.90: download - view: text, markup, annotated - select for diffs
Wed May 17 06:33:04 2017 UTC (9 years, 6 months ago) by knakahara
Branches: MAIN
CVS tags: prg-localcount2-base3
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +63 -69 lines
opencrypto: cleanup debug messages.

Revision 1.89.2.3: download - view: text, markup, annotated - select for diffs
Wed May 17 01:44:18 2017 UTC (9 years, 6 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.89.2.2: preferred, colored; branchpoint 1.89: preferred, colored
Changes since revision 1.89.2.2: +5 -3 lines
At suggestion of chuq@, modify config_attach_pseudo() to return with a
reference held on the device.

Adapt callers to expect the reference to exist, and to ensure that the
reference is released.

Revision 1.89.2.2: download - view: text, markup, annotated - select for diffs
Sat Apr 29 11:12:15 2017 UTC (9 years, 6 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.89.2.1: preferred, colored; branchpoint 1.89: preferred, colored
Changes since revision 1.89.2.1: +2 -3 lines
Remove more unnecessary #include for sys/localcount.h

Revision 1.89.2.1: download - view: text, markup, annotated - select for diffs
Thu Apr 27 05:36:38 2017 UTC (9 years, 6 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +4 -2 lines
Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita.  There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.

Revision 1.85.2.4: download - view: text, markup, annotated - select for diffs
Wed Apr 26 02:53:30 2017 UTC (9 years, 6 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.85.2.3: preferred, colored; branchpoint 1.85: preferred, colored; next MAIN 1.86: preferred, colored
Changes since revision 1.85.2.3: +18 -24 lines
Sync with HEAD

Revision 1.89: download - view: text, markup, annotated - select for diffs
Mon Apr 24 03:29:37 2017 UTC (9 years, 6 months ago) by knakahara
Branches: MAIN
CVS tags: prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-20170426
Branch point for: prg-localcount2
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +8 -2 lines
separate crypto_drv_mtx from crypto_mtx.

crypto_mtx is used only for cryptodev.c and ocryptodev.c now.

Revision 1.85.4.1: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:54:07 2017 UTC (9 years, 6 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.85: preferred, colored; next MAIN 1.86: preferred, colored
Changes since revision 1.85: +12 -24 lines
Sync with HEAD

Revision 1.88: download - view: text, markup, annotated - select for diffs
Fri Apr 7 12:17:57 2017 UTC (9 years, 7 months ago) by knakahara
Branches: MAIN
CVS tags: jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +2 -13 lines
the processing said "ghastly hacks" is unnecessary now.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Fri Apr 7 12:15:51 2017 UTC (9 years, 7 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +6 -4 lines
fix race among crypto_done(), cryptoret(), and {cryptodev_op(), cryptodev_key()}.

crypto_op() waited to be set CRYPTO_F_DONE with crp->crp_cv.
However, there is context switch chances between being set CRYPTO_F_DONE in
crypto_done() and done cv_signal(crp->crp_cv) in cryptodev_cb(), that is,
cryptodev_op() thread can run to cv_destroy(crp->crp_cv) before cryptoret()
thread is waken up. As a result, cryptodev_cb() can call invalid(destroyed)
cv_signal(crp->crp_cv).

Furthermore, below two implementations cause other races.
    - waiting CRYPTO_F_DONE with crp->crp_cv
    - context witch chances between set CRYPTO_F_DONE and cv_signal(crp->crp_cv)

So, use other flag(CRYPTO_F_DQRETQ) for cryptodev_op() and cryptodev_key(),
and then call cv_signal(crp->crp_cv) immediately after set CRYPTO_F_DQRETQ.

Tested concurrent over 20 processes with software and hardware drivers.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Wed Apr 5 08:51:04 2017 UTC (9 years, 7 months ago) by knakahara
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +8 -11 lines
fix processes accessing /dev/crypto stall when over three processes run with a hardware encryption driver

The process has stalled at cv_wait(&crp->crp_cv) because cryptodev_cb()
is not called as cryptoret() kthread keep waiting at cv_wait(&cryptoret_cv).
Previous opencrypto implementation assumes the thread from cryptodev.c
does all processing in the same context, so skips enqueueing and sending
cryptoret_cv. However, the context can be switched, e.g. when we use
a hardware encryption driver.

And add debug messages.

Revision 1.85.2.3: download - view: text, markup, annotated - select for diffs
Tue Jul 26 05:54:40 2016 UTC (10 years, 3 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.85.2.2: preferred, colored; branchpoint 1.85: preferred, colored
Changes since revision 1.85.2.2: +3 -3 lines
Rename LOCALCOUNT_INITIALIZER to DEVSW_MODULE_INIT.  This better describes
what we're doing, and why.

Revision 1.85.2.2: download - view: text, markup, annotated - select for diffs
Tue Jul 19 06:27:00 2016 UTC (10 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.85.2.1: preferred, colored; branchpoint 1.85: preferred, colored
Changes since revision 1.85.2.1: +3 -9 lines
Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it.  This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@

Revision 1.85.2.1: download - view: text, markup, annotated - select for diffs
Mon Jul 18 03:50:00 2016 UTC (10 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +10 -2 lines
Rump drivers are always installed via devsw_attach() so we need to
always allocate a 'struct localcount' for these drivers whenever they
are built as modules.

Revision 1.82.2.3: download - view: text, markup, annotated - select for diffs
Sat Jul 9 20:25:23 2016 UTC (10 years, 4 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.82.2.2: preferred, colored; branchpoint 1.82: preferred, colored
Changes since revision 1.82.2.2: +3 -3 lines
Sync with HEAD

Revision 1.85: download - view: text, markup, annotated - select for diffs
Thu Jul 7 06:55:43 2016 UTC (10 years, 4 months ago) by msaitoh
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, localcount-20160914, bouyer-socketcan-base
Branch point for: pgoyette-localcount, bouyer-socketcan
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +8 -8 lines
KNF. Remove extra spaces. No functional change.

Revision 1.82.2.2: download - view: text, markup, annotated - select for diffs
Tue Sep 22 12:06:12 2015 UTC (11 years, 1 month ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.82.2.1: preferred, colored; branchpoint 1.82: preferred, colored
Changes since revision 1.82.2.1: +48 -48 lines
Sync with HEAD

Revision 1.84: download - view: text, markup, annotated - select for diffs
Thu Aug 20 14:40:19 2015 UTC (11 years, 2 months ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +4 -4 lines
include "ioconf.h" to get the 'void <driver>attach(int count);' prototype.

Revision 1.82.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 6 15:18:24 2015 UTC (11 years, 7 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +3 -3 lines
Sync with HEAD

Revision 1.83: download - view: text, markup, annotated - select for diffs
Thu Mar 26 17:40:16 2015 UTC (11 years, 7 months ago) by prlw1
Branches: MAIN
CVS tags: nick-nhusb-base-20150606, nick-nhusb-base-20150406
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +3 -3 lines
Trivial printf format changes and typo fix

Revision 1.82: download - view: text, markup, annotated - select for diffs
Thu Nov 27 20:30:05 2014 UTC (11 years, 11 months ago) by christos
Branches: MAIN
CVS tags: nick-nhusb-base
Branch point for: nick-nhusb
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +3 -3 lines
Return ENOSPC instead of ENOMEM when there is no room in the buffer to
store results. ENOMEM in this subsystem means we cannot allocate more
requests or internal buffers for xforms.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Fri Sep 5 09:23:40 2014 UTC (12 years, 2 months ago) by matt
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +7 -7 lines
Try not to use f_data, use f_fcrypt to get a correctly typed pointer.

Revision 1.68.12.1: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:04:36 2014 UTC (12 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +164 -14 lines
Rebase to HEAD as of a few days ago.

Revision 1.78.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 06:56:47 2014 UTC (12 years, 3 months ago) by tls
Branches: tls-earlyentropy
Diff to: previous 1.78: preferred, colored; next MAIN 1.79: preferred, colored
Changes since revision 1.78: +5 -2 lines
Rebase.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Mon Aug 4 14:17:18 2014 UTC (12 years, 3 months ago) by skrll
Branches: MAIN
CVS tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +4 -2 lines
At least crypto_mtx needs initialisation here.  Spotted during PR/49065
investigation.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Fri Jul 25 08:10:40 2014 UTC (12 years, 3 months ago) by dholland
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +3 -2 lines
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.

Revision 1.68.2.1: download - view: text, markup, annotated - select for diffs
Thu May 22 11:41:11 2014 UTC (12 years, 5 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68: +161 -14 lines
sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.68.16.1: download - view: text, markup, annotated - select for diffs
Sun May 18 17:46:14 2014 UTC (12 years, 6 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.68: preferred, colored; next MAIN 1.69: preferred, colored
Changes since revision 1.68: +161 -14 lines
sync with head

Revision 1.78: download - view: text, markup, annotated - select for diffs
Sun Mar 16 05:20:30 2014 UTC (12 years, 8 months ago) by dholland
Branches: MAIN
CVS tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +13 -13 lines
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Mon Feb 3 23:11:40 2014 UTC (12 years, 9 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +50 -17 lines
Undo previous - it still needs a lot more work.

For now, we'll use the hand-crafted cf* structures and directly
call all the config routines.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Fri Jan 31 18:11:32 2014 UTC (12 years, 9 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +19 -52 lines
Replace home-grown config with standardized calls to
config_{init,fini}_component()

Revision 1.75: download - view: text, markup, annotated - select for diffs
Fri Jan 24 15:11:09 2014 UTC (12 years, 9 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +7 -2 lines
As requested by mrg@, since there is still a small window during which
the in-module ref-counting can fail, completely disable auto-unload.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Tue Jan 21 20:33:01 2014 UTC (12 years, 9 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +13 -7 lines
Implement in-module ref-counting, and do not allow auto-unload if there
are existing references.

Note that manual unloading is not prevented.

OK christos@

XXX Also note that there is still a small window where the ref-count can
XXX be decremented, and then the process/thread preempted.  If auto-unload
XXX happens before that thread can return from the module's code, bad
XXX things (tm) could happen.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Tue Jan 21 18:54:28 2014 UTC (12 years, 9 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +3 -2 lines
knf: Blank line even if no variable declarations.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Sun Jan 19 18:16:13 2014 UTC (12 years, 9 months ago) by christos
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +7 -2 lines
bail out unloading for now

Revision 1.71: download - view: text, markup, annotated - select for diffs
Sat Jan 4 21:42:42 2014 UTC (12 years, 10 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +15 -6 lines
When crypto(4) is built-in, crypto_modcmd() doesn't need to handle all
the auto-config stuff.

While here, ensure that we depend on opencrypto.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Wed Jan 1 16:06:01 2014 UTC (12 years, 10 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +123 -2 lines
Modularize the opencrypto components and link to the build

Revision 1.69: download - view: text, markup, annotated - select for diffs
Thu Sep 12 13:02:37 2013 UTC (13 years, 2 months ago) by martin
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +3 -3 lines
Fix return value of cryptodev_msessionfin.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Mon Jul 4 16:06:17 2011 UTC (15 years, 4 months ago) by joerg
Branches: MAIN
CVS tags: yamt-pagecache-tag8, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, khorben-n900, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, jmcneill-usbmp-base, jmcneill-usbmp, jmcneill-audiomp3-base, jmcneill-audiomp3, agc-symver-base, agc-symver
Branch point for: yamt-pagecache, tls-maxphys, rmind-smpnet
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +3 -3 lines
Fix memset usage.

Revision 1.66.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 23 14:20:28 2011 UTC (15 years, 4 months ago) by cherry
Branches: cherry-xenmp
Diff to: previous 1.66: preferred, colored; next MAIN 1.67: preferred, colored
Changes since revision 1.66: +9 -2 lines
Catchup with rmind-uvmplock merge.

Revision 1.52.4.3: download - view: text, markup, annotated - select for diffs
Sun Jun 12 00:24:31 2011 UTC (15 years, 5 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.52.4.2: preferred, colored; branchpoint 1.52: preferred, colored; next MAIN 1.53: preferred, colored
Changes since revision 1.52.4.2: +7 -0 lines
sync with head

Revision 1.67: download - view: text, markup, annotated - select for diffs
Thu Jun 9 14:41:24 2011 UTC (15 years, 5 months ago) by drochner
Branches: MAIN
CVS tags: rmind-uvmplock-nbase, rmind-uvmplock-base
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +9 -2 lines
-if an opencrypto(9) session is allocated, the driver is refcounted
 and can not disappear -- no need to hold crypto_mtx to check the
 driver list
 (the whole check is questionable)
-crp->crp_cv (the condition variable) is used by userland cryptodev
 exclusively -- move its initialization there, no need to waste
 cycles of in-kernel callers
-add a comment which members of "struct cryptop" are used
 by opencrypto(9) and which by crypto(4)
 (this should be split, no need to waste memory for in-kernel callers)

Revision 1.53.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 6 09:10:03 2011 UTC (15 years, 5 months ago) by jruoho
Branches: jruoho-x86intr
Diff to: previous 1.53: preferred, colored; next MAIN 1.54: preferred, colored
Changes since revision 1.53: +151 -102 lines
Sync with HEAD.

Revision 1.52.4.2: download - view: text, markup, annotated - select for diffs
Tue May 31 03:05:10 2011 UTC (15 years, 5 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.52.4.1: preferred, colored; branchpoint 1.52: preferred, colored
Changes since revision 1.52.4.1: +131 -90 lines
sync with head

Revision 1.66: download - view: text, markup, annotated - select for diffs
Fri May 27 17:09:09 2011 UTC (15 years, 5 months ago) by drochner
Branches: MAIN
CVS tags: cherry-xenmp-base
Branch point for: cherry-xenmp
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +22 -2 lines
allow testing of GCM/GMAC code from userland

Revision 1.65: download - view: text, markup, annotated - select for diffs
Thu May 26 20:33:24 2011 UTC (15 years, 5 months ago) by drochner
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +7 -7 lines
fix building of a linked list if multiple algorithms are requested
in a session -- this just didn't work

Revision 1.64: download - view: text, markup, annotated - select for diffs
Tue May 24 19:12:53 2011 UTC (15 years, 5 months ago) by drochner
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +8 -4 lines
catch some corner cases of user input

Revision 1.63: download - view: text, markup, annotated - select for diffs
Tue May 24 19:10:09 2011 UTC (15 years, 5 months ago) by drochner
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +5 -2 lines
copy AES-XCBC-MAC support from KAME IPSEC to FAST_IPSEC
For this to fit, an API change in cryptosoft was adopted from OpenBSD
(addition of a "Setkey" method to hashes) which was done for GCM/GMAC
support there, so it might be useful in the future anyway.
tested against KAME IPSEC
AFAICT, FAST_IPSEC now supports as much as KAME.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Mon May 23 15:37:36 2011 UTC (15 years, 5 months ago) by drochner
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +4 -4 lines
-remove references to crypto/arc4/arc4.* -- the code isn't used
 anywhere afaics
 (The confusion comes probably from use of arc4random() at various places,
  but this lives in libkern and doesn't share code with the former.)
-g/c non-implementation of arc4 encryption in swcrypto(4)
-remove special casing of ARC4 in crypto(4) -- the point is that it
 doesn't use an IV, and this fact is made explicit by the new "ivsize"
 property of xforms

Revision 1.61: download - view: text, markup, annotated - select for diffs
Mon May 23 15:22:57 2011 UTC (15 years, 5 months ago) by drochner
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +6 -4 lines
If symmetric encryption is done from userland crypto(4) and no IV
is specified, the kernel gets one from the random generator. Make sure it
is copied out to the user, otherwise the result is quite useless.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Mon May 23 13:53:59 2011 UTC (15 years, 5 months ago) by drochner
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +5 -2 lines
being here, export camellia-cbc through crypto(4) to allow userland tests

Revision 1.59: download - view: text, markup, annotated - select for diffs
Mon May 23 13:51:10 2011 UTC (15 years, 5 months ago) by drochner
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +5 -2 lines
add an AES-CTR xform, from OpenBSD

Revision 1.58: download - view: text, markup, annotated - select for diffs
Mon May 23 13:46:54 2011 UTC (15 years, 5 months ago) by drochner
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +19 -13 lines
-in the descriptor for encryption xforms, split the "blocksize" field
 into "blocksize" and "IV size"
-add an "reinit" function pointer which, if set, means that the xform
 does its IV handling itself and doesn't want the default CBC handling
 by the framework (poor name, but left that way to avoid unecessary
 differences)
This syncs with Open/FreeBSD, purpose is to allow non-CBC transforms.
Refer to ivsize instead of blocksize where appropriate.
(At this point, blocksize and ivsize are identical.)

Revision 1.44.8.2.4.1: download - view: text, markup, annotated - select for diffs
Fri May 20 08:11:31 2011 UTC (15 years, 6 months ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.44.8.2: preferred, colored; next MAIN 1.44.8.3: preferred, colored
Changes since revision 1.44.8.2: +303 -108 lines
bring matt-nb5-mips64 up to date with netbsd-5-1-RELEASE (except compat).

Revision 1.57: download - view: text, markup, annotated - select for diffs
Mon May 16 10:27:49 2011 UTC (15 years, 6 months ago) by drochner
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +68 -68 lines
split the "crypto_mtx" spinlock into 3: one spinlock each for
the incoming and outgoing request queues (which can be dealt with
by hardware accelerators) and an adaptive lock for "all the rest"
(mostly driver configuration, but also some unrelated stuff in
cryptodev.c which should be revisited)
The latter one seems to be uneeded at many places, but for now I've
done simple replacements only, except minor fixes (where
softint_schedule() was called without the lock held)

Revision 1.56: download - view: text, markup, annotated - select for diffs
Fri May 6 21:48:46 2011 UTC (15 years, 6 months ago) by drochner
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +12 -12 lines
As a first step towards more fine-grained locking, don't require
crypto_{new.free}session() to be called with the "crypto_mtx"
spinlock held.
This doesn't change much for now because these functions acquire
the said mutex first on entry now, but at least it keeps the nasty
locks local to the opencrypto core.

Revision 1.52.4.1: download - view: text, markup, annotated - select for diffs
Sat Mar 5 20:56:04 2011 UTC (15 years, 8 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +33 -23 lines
sync with head

Revision 1.53.4.1: download - view: text, markup, annotated - select for diffs
Sat Mar 5 15:10:48 2011 UTC (15 years, 8 months ago) by bouyer
Branches: bouyer-quota2
Diff to: previous 1.53: preferred, colored; next MAIN 1.54: preferred, colored
Changes since revision 1.53: +20 -12 lines
Sync with HEAD

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sat Feb 19 16:26:34 2011 UTC (15 years, 8 months ago) by drochner
Branches: MAIN
CVS tags: bouyer-quota2-nbase
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +10 -3 lines
make the compatibility code conditional on COMPAT_50

Revision 1.54: download - view: text, markup, annotated - select for diffs
Fri Feb 18 19:56:01 2011 UTC (15 years, 9 months ago) by drochner
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +12 -11 lines
more "const"

Revision 1.52.2.1: download - view: text, markup, annotated - select for diffs
Tue Aug 17 06:47:52 2010 UTC (16 years, 3 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.52: preferred, colored; next MAIN 1.53: preferred, colored
Changes since revision 1.52: +15 -13 lines
Sync with HEAD.

Revision 1.39.2.4: download - view: text, markup, annotated - select for diffs
Wed Aug 11 22:54:59 2010 UTC (16 years, 3 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.39.2.3: preferred, colored; branchpoint 1.39: preferred, colored; next MAIN 1.40: preferred, colored
Changes since revision 1.39.2.3: +15 -13 lines
sync with head.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Mon Aug 2 19:59:35 2010 UTC (16 years, 3 months ago) by jakllsch
Branches: MAIN
CVS tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, matt-mips64-premerge-20101231, jruoho-x86intr-base, bouyer-quota2-base
Branch point for: jruoho-x86intr, bouyer-quota2
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +15 -13 lines
Consistently use a single CRYPTO_SESID2HID-like macro.
Improve CRYPTO_DEBUG printing a bit:
 print pointers with %p
 print unsigned with %u rather than %d
 use CRYPTO_SESID2LID instead of just casting to uint32_t

Revision 1.39.2.3: download - view: text, markup, annotated - select for diffs
Thu Mar 11 15:04:32 2010 UTC (16 years, 8 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.39.2.2: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.2: +5 -5 lines
sync with head

Revision 1.44.8.4: download - view: text, markup, annotated - select for diffs
Sun Feb 14 13:36:57 2010 UTC (16 years, 9 months ago) by bouyer
Branches: netbsd-5
CVS tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, matt-nb5-pq3-base, matt-nb5-pq3
Diff to: previous 1.44.8.3: preferred, colored; branchpoint 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44.8.3: +4 -4 lines
Pull up following revision(s) (requested by hubertf in ticket #1291):
	sys/opencrypto/cryptodev.c: revision 1.52
Add missing "break" for CRYPTO_CAST_CBC, and some assorted comment fixes.
openssl(1) checks for CAST (and others) on ~every startup.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Sun Jan 31 14:32:56 2010 UTC (16 years, 9 months ago) by hubertf
Branches: MAIN
CVS tags: yamt-nfs-mp-base9, uebayasi-xip-base1, uebayasi-xip-base
Branch point for: uebayasi-xip, rmind-uvmplock
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +4 -4 lines
Add missing "break" for CRYPTO_CAST_CBC, and some assorted comment fixes.
openssl(1) checks for CAST (and others) on ~every startup.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Sun Dec 20 09:36:06 2009 UTC (16 years, 11 months ago) by dsl
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +3 -3 lines
If a multithreaded app closes an fd while another thread is blocked in
read/write/accept, then the expectation is that the blocked thread will
exit and the close complete.
Since only one fd is affected, but many fd can refer to the same file,
the close code can only request the fs code unblock with ERESTART.
Fixed for pipes and sockets, ERESTART will only be generated after such
a close - so there should be no change for other programs.
Also rename fo_abort() to fo_restart() (this used to be fo_drain()).
Fixes PR/26567

Revision 1.50: download - view: text, markup, annotated - select for diffs
Wed Dec 9 21:32:59 2009 UTC (16 years, 11 months ago) by dsl
Branches: MAIN
CVS tags: matt-premerge-20091211
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +3 -3 lines
Rename fo_drain() to fo_abort(), 'drain' is used to mean 'wait for output
do drain' in many places, whereas fo_drain() was called in order to force
blocking read()/write() etc calls to return to userspace so that a close()
call from a different thread can complete.
In the sockets code comment out the broken code in the inner function,
it was being called from compat code.

Revision 1.45.4.1: download - view: text, markup, annotated - select for diffs
Wed May 13 17:22:56 2009 UTC (17 years, 6 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.45: preferred, colored; next MAIN 1.46: preferred, colored
Changes since revision 1.45: +358 -115 lines
Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.39.2.2: download - view: text, markup, annotated - select for diffs
Mon May 4 08:14:24 2009 UTC (17 years, 6 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.39.2.1: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.1: +535 -281 lines
sync with head.

Revision 1.44.8.3: download - view: text, markup, annotated - select for diffs
Sun May 3 17:24:45 2009 UTC (17 years, 6 months ago) by snj
Branches: netbsd-5
Diff to: previous 1.44.8.2: preferred, colored; branchpoint 1.44: preferred, colored
Changes since revision 1.44.8.2: +302 -107 lines
Pull up following revision(s) (requested by tls in ticket #611):
	sys/lib/libkern/Makefile: patch
	sys/lib/libkern/crc32.c: revision 1.1
	sys/lib/libkern/crc32.h: revision 1.1
	sys/lib/libkern/libkern.h: revision 1.89
	sys/lib/libkern/arch/i386/Makefile.inc: revision 1.28
	sys/net/zlib.h: revision 1.14 via patch
	sys/opencrypto/crypto.c: revision 1.33
	sys/opencrypto/cryptodev.c: revision 1.46
	sys/opencrypto/cryptodev.h: revision 1.16
	sys/opencrypto/cryptosoft.c: revision 1.24
	sys/opencrypto/cryptosoft.h: revision 1.6
	sys/opencrypto/deflate.h: revision 1.6
	sys/opencrypto/cryptosoft_xform.c: revision 1.12
	sys/opencrypto/deflate.c: revision 1.13
	sys/opencrypto/files.opencrypto: revision 1.20
	sys/opencrypto/ocryptodev.c: revision 1.1
	sys/opencrypto/ocryptodev.h: revision 1.1
	sys/opencrypto/xform.c: revision 1.18
	sys/opencrypto/xform.h: revision 1.10
Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION,  CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel.  The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.

Revision 1.44.6.2: download - view: text, markup, annotated - select for diffs
Tue Apr 28 07:37:50 2009 UTC (17 years, 6 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.44.6.1: preferred, colored; branchpoint 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44.6.1: +358 -115 lines
Sync with HEAD.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Sat Apr 11 23:05:26 2009 UTC (17 years, 7 months ago) by christos
Branches: MAIN
CVS tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jymxensuspend-base, jym-xensuspend-nbase, jym-xensuspend-base
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +22 -6 lines
Fix locking as Andy explained. Also fill in uid and gid like sys_pipe did.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Sat Apr 11 15:47:34 2009 UTC (17 years, 7 months ago) by christos
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +34 -3 lines
Fix PR/37878 and PR/37550: Provide stat(2) for all devices and don't use
fbadop_stat.

Revision 1.44.8.2: download - view: text, markup, annotated - select for diffs
Sat Apr 4 23:36:28 2009 UTC (17 years, 7 months ago) by snj
Branches: netbsd-5
CVS tags: netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb4-mips64-k7-u2a-k9b
Branch point for: matt-nb5-mips64
Diff to: previous 1.44.8.1: preferred, colored; branchpoint 1.44: preferred, colored
Changes since revision 1.44.8.1: +11 -10 lines
Pull up following revision(s) (requested by ad in ticket #661):
	sys/arch/xen/xen/xenevt.c: revision 1.32
	sys/compat/svr4/svr4_net.c: revision 1.56
	sys/compat/svr4_32/svr4_32_net.c: revision 1.19
	sys/dev/dmover/dmover_io.c: revision 1.32
	sys/dev/putter/putter.c: revision 1.21
	sys/kern/kern_descrip.c: revision 1.190
	sys/kern/kern_drvctl.c: revision 1.23
	sys/kern/kern_event.c: revision 1.64
	sys/kern/sys_mqueue.c: revision 1.14
	sys/kern/sys_pipe.c: revision 1.109
	sys/kern/sys_socket.c: revision 1.59
	sys/kern/uipc_syscalls.c: revision 1.136
	sys/kern/vfs_vnops.c: revision 1.164
	sys/kern/uipc_socket.c: revision 1.188
	sys/net/bpf.c: revision 1.144
	sys/net/if_tap.c: revision 1.55
	sys/opencrypto/cryptodev.c: revision 1.47
	sys/sys/file.h: revision 1.67
	sys/sys/param.h: patch
	sys/sys/socketvar.h: revision 1.119
Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.
Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.
thr0	accept(fd, ...)
thr1	close(fd)

Revision 1.47: download - view: text, markup, annotated - select for diffs
Sat Apr 4 10:12:52 2009 UTC (17 years, 7 months ago) by ad
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +11 -10 lines
Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.

Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.

thr0	accept(fd, ...)
thr1	close(fd)

Revision 1.46: download - view: text, markup, annotated - select for diffs
Wed Mar 25 01:26:13 2009 UTC (17 years, 7 months ago) by darran
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +302 -107 lines
Fixes PR kern/41069 and PR kern/41070.

Extends the Opencrypto API to allow the destination buffer size to be
specified when its not the same size as the input buffer (i.e. for
operations like compress and decompress).
The crypto_op and crypt_n_op structures gain a u_int dst_len field.
The session_op structure gains a comp_alg field to specify a compression
algorithm.
Moved four ioctls to new ids; CIOCGSESSION, CIOCNGSESSION,  CIOCCRYPT,
and CIOCNCRYPTM.
Added four backward compatible ioctls; OCIOCGSESSION, OCIOCNGSESSION,
OCIOCCRYPT, and OCIOCNCRYPTM.

Backward compatibility is maintained in ocryptodev.h and ocryptodev.c which
implement the original ioctls and set dst_len and comp_alg to 0.

Adds user-space access to compression features.

Adds software gzip support (CRYPTO_GZIP_COMP).

Adds the fast version of crc32 from zlib to libkern. This should be generally
useful and provide a place to start normalizing the various crc32 routines
in the kernel.  The crc32 routine is used in this patch to support GZIP.

With input and support from tls@NetBSD.org.

Revision 1.44.6.1: download - view: text, markup, annotated - select for diffs
Mon Jan 19 13:20:20 2009 UTC (17 years, 10 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +36 -14 lines
Sync with HEAD.

Revision 1.34.6.4: download - view: text, markup, annotated - select for diffs
Sat Jan 17 13:29:34 2009 UTC (17 years, 10 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.34.6.3: preferred, colored; branchpoint 1.34: preferred, colored; next MAIN 1.35: preferred, colored
Changes since revision 1.34.6.3: +34 -12 lines
Sync with HEAD.

Revision 1.44.4.1: download - view: text, markup, annotated - select for diffs
Sat Dec 13 01:15:33 2008 UTC (17 years, 11 months ago) by haad
Branches: haad-dm
Diff to: previous 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44: +36 -14 lines
Update haad-dm branch to haad-dm-base2.

Revision 1.44.8.1: download - view: text, markup, annotated - select for diffs
Thu Nov 20 03:22:38 2008 UTC (18 years ago) by snj
Branches: netbsd-5
CVS tags: netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +36 -14 lines
Pull up following revision(s) (requested by darran in ticket #92):
	sys/opencrypto/cryptodev.c: revision 1.45
	sys/sys/queue.h: revision 1.50
	sys/opencrypto/cryptodev.h: revision 1.15
	sys/opencrypto/crypto.c: revision 1.30
Fix a race condition in opencrypto where the crypto request could be
completed by the crypto device, queued on the retq, but freed by the
ioctl lwp.  The problem manifests as various panics relating to the
condvar inside the request. The problem can occur whenever the crypto
device completes the request immediately and the ioctl skips the
cv_wait().
The problem can be reproduced by enabling cryptosoft and running an
openssl
speed test. E.g.
    sysctl -w kern.cryptodevallowsoft=-1
    openssl speed -engine cryptodev -evp des-ede3-cbc -multi 64
Add a macro for TAILQ_FOREACH_REVERSE_SAFE() to queue.h, since this
was missing and the opencrypto code removes requests from a list while
iterating with TAILQ_FOREACH_REVERSE().
Add missing cv_destroy() calls for the key request cleanup.
Reviewed by Thor Lancelot Simon.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Tue Nov 18 12:59:58 2008 UTC (18 years ago) by darran
Branches: MAIN
CVS tags: nick-hppapmap-base2, mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: jym-xensuspend
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +36 -14 lines
Fix a race condition in opencrypto where the crypto request could be
completed by the crypto device, queued on the retq, but freed by the
ioctl lwp.  The problem manifests as various panics relating to the
condvar inside the request. The problem can occur whenever the crypto
device completes the request immediately and the ioctl skips the cv_wait().

The problem can be reproduced by enabling cryptosoft and running an openssl
speed test. E.g.
    sysctl -w kern.cryptodevallowsoft=-1
    openssl speed -engine cryptodev -evp des-ede3-cbc -multi 64

Add a macro for TAILQ_FOREACH_REVERSE_SAFE() to queue.h, since this
was missing and the opencrypto code removes requests from a list while
iterating with TAILQ_FOREACH_REVERSE().

Add missing cv_destroy() calls for the key request cleanup.

Reviewed by Thor Lancelot Simon.

Revision 1.41.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 23 04:32:02 2008 UTC (18 years, 4 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.41: preferred, colored; next MAIN 1.42: preferred, colored
Changes since revision 1.41: +179 -190 lines
Sync w/ -current. 34 merge conflicts to follow.

Revision 1.38.2.2: download - view: text, markup, annotated - select for diffs
Wed Jun 4 02:05:48 2008 UTC (18 years, 5 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.38.2.1: preferred, colored; branchpoint 1.38: preferred, colored; next MAIN 1.39: preferred, colored
Changes since revision 1.38.2.1: +179 -190 lines
sync with head

Revision 1.34.6.3: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:24:31 2008 UTC (18 years, 5 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.34.6.2: preferred, colored; branchpoint 1.34: preferred, colored
Changes since revision 1.34.6.2: +1114 -245 lines
Sync with HEAD.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Sat May 24 16:42:00 2008 UTC (18 years, 5 months ago) by christos
Branches: MAIN
CVS tags: yamt-pf42-base4, yamt-pf42-base3, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, netbsd-5-base, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5, haad-dm
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +4 -4 lines
Coverity CID 5021: Check pointers before using.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Sat May 24 16:29:34 2008 UTC (18 years, 5 months ago) by christos
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +11 -13 lines
Coverity CID 5027: Remove impossible test.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Sat May 24 16:28:58 2008 UTC (18 years, 5 months ago) by christos
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +169 -178 lines
KNF, whitespace, b* -> mem*. No functional change.

Revision 1.38.2.1: download - view: text, markup, annotated - select for diffs
Sun May 18 12:35:45 2008 UTC (18 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +4 -42 lines
sync with head.

Revision 1.39.2.1: download - view: text, markup, annotated - select for diffs
Fri May 16 02:25:50 2008 UTC (18 years, 6 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +3 -10 lines
sync with head.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Wed Apr 30 14:07:14 2008 UTC (18 years, 6 months ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-base2, yamt-nfs-mp-base2, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +3 -3 lines
Make various bits of debug code compile again.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Mon Apr 28 20:24:10 2008 UTC (18 years, 6 months ago) by martin
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +2 -9 lines
Remove clause 3 and 4 from TNF licenses

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Apr 21 19:05:41 2008 UTC (18 years, 6 months ago) by tls
Branches: MAIN
CVS tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +3 -34 lines
As suggested by rmind, do not check return status of KM_SLEEP/PR_WAITOK
allocations.  A little hair-raising but it does make the code easier to
read.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Fri Apr 11 10:28:10 2008 UTC (18 years, 7 months ago) by rmind
Branches: MAIN
CVS tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +14 -13 lines
Protect selrecord/selnotify calls with crypto_mtx; few misc changes.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Fri Apr 11 06:25:35 2008 UTC (18 years, 7 months ago) by dogcow
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +5 -4 lines
fix 64-bit b0rkenness.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Thu Apr 10 22:48:42 2008 UTC (18 years, 7 months ago) by tls
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +1090 -174 lines
Extend crypto.4 interface:

	* Asynchronous operation with result retrieval via select/poll
	* Mutliple-request submit/retrieve ioctls
	* Mutliple-session create-destroy ioctls

Revise/rewrite crypto.4 manual page.  It should now be much easier to write
new applications to this API.

Measured performance for trivial requests: 84,000 very short modular math
operations/sec, 120,000 very short md5 hashes per sec (with a hardware
accellerator of moderate performance but very low latency, whose driver
will be contributed at a later date).

Contributed to TNF by Coyote Point Systems, Inc.

Revision 1.34.6.2: download - view: text, markup, annotated - select for diffs
Sat Apr 5 23:33:23 2008 UTC (18 years, 7 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.34.6.1: preferred, colored; branchpoint 1.34: preferred, colored
Changes since revision 1.34.6.1: +6 -2 lines
- add "file-system DEVFS" and "pseudo-device devfsctl" to conf/std seeing
  as these are always needed.

- convert many, many drivers over to the New Devfs World Order. For a
  list of device drivers yet to be converted see,
  http://www.netbsd.org/~mjf/devfs-todo.html.

- add a new device_unregister_all(device_t) function to remove all device
  names associated with a device_t, which saves us having to construct
  device names when the driver is detached.

- add a DEV_AUDIO type for devices.

Revision 1.34.6.1: download - view: text, markup, annotated - select for diffs
Thu Apr 3 12:43:10 2008 UTC (18 years, 7 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +19 -19 lines
Sync with HEAD.

Revision 1.12.12.7: download - view: text, markup, annotated - select for diffs
Mon Mar 24 09:39:10 2008 UTC (18 years, 7 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.12.12.6: preferred, colored; branchpoint 1.12: preferred, colored; next MAIN 1.13: preferred, colored
Changes since revision 1.12.12.6: +19 -19 lines
sync with head.

Revision 1.26.16.1: download - view: text, markup, annotated - select for diffs
Sun Mar 23 02:05:09 2008 UTC (18 years, 7 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.26: preferred, colored; next MAIN 1.27: preferred, colored
Changes since revision 1.26: +217 -111 lines
sync with HEAD

Revision 1.35: download - view: text, markup, annotated - select for diffs
Fri Mar 21 21:55:01 2008 UTC (18 years, 8 months ago) by ad
Branches: MAIN
CVS tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, ad-socklock-base1
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +19 -19 lines
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.

Revision 1.26.22.1: download - view: text, markup, annotated - select for diffs
Mon Feb 18 21:07:18 2008 UTC (18 years, 9 months ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.26: preferred, colored; next MAIN 1.27: preferred, colored
Changes since revision 1.26: +217 -111 lines
Sync with HEAD.

Revision 1.12.12.6: download - view: text, markup, annotated - select for diffs
Mon Feb 11 15:00:09 2008 UTC (18 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.12.12.5: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.12.5: +31 -21 lines
sync with head.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Mon Feb 4 14:46:27 2008 UTC (18 years, 9 months ago) by tls
Branches: MAIN
CVS tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base
Branch point for: mjf-devfs2
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +31 -21 lines
Some locking fixes (double-release mutex in softintr wakeup case, which I
hadn't tested) and an uninitialized field in cse which Darran Hunt
found.  Some more debugging printfs.

Turn on MPSAFE for the kthread.  We're not sure it's safe for the softint
yet.  Gives a little performance kick for swcrypto with many requests on
MP systems.

Revision 1.12.12.5: download - view: text, markup, annotated - select for diffs
Mon Feb 4 09:24:47 2008 UTC (18 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.12.12.4: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.12.4: +165 -93 lines
sync with head.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Mon Feb 4 00:35:34 2008 UTC (18 years, 9 months ago) by tls
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +90 -35 lines
Rework opencrypto to use a spin mutex (crypto_mtx) instead of "splcrypto"
(actually splnet) and condvars instead of tsleep/wakeup.  Fix a few
miscellaneous problems and add some debugging printfs while there.

Restore set of CRYPTO_F_DONE in crypto_done() which was lost at some
point after this code came from FreeBSD -- it made it impossible to wait
properly for a condition.

Add flags analogous to the "crp" flags to the key operation's krp struct.
Add a new flag, CRYPTO_F_ONRETQ which tells us a request finished before
the kthread had a chance to dequeue it and call its callback -- this was
letting requests stick on the queues before even though done and copied
out.

Callers of crypto_newsession() or crypto_freesession() must now take the
mutex.  Change netipsec to do so.  Dispatch takes the mutex itself as
needed.

This was tested fairly extensively with the cryptosoft backend and lightly
with a new hardware driver.  It has not been tested with FAST_IPSEC; I am
unable to ascertain whether FAST_IPSEC currently works at all in our tree.

pjd@FreeBSD.ORG, ad@NetBSD.ORG, and darran@snark.us pointed me in the
right direction several times in the course of this.  Remaining bugs
are mine alone.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sat Feb 2 02:39:00 2008 UTC (18 years, 9 months ago) by tls
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +9 -3 lines
From Darran Hunt at Coyote Point: don't truncate HMAC to 96 bits unless
actually asked to.

Fixed in FreeBSD a while ago, discussed on tech-kern and tech-crypto.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Fri Feb 1 04:52:35 2008 UTC (18 years, 9 months ago) by tls
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -6 lines
This code never worked on a released version of FreeBSD in the form it's
been in in our tree, and certainly does not work on any version of FreeBSD
now.  Run through unifdef -D__NetBSD__ -U__FreeBSD__ yielding a small
reduction of size and a dramatic improvement in readability.

No, this does not yield any meaningful decrease in patchability (unlike
mechanical changes that touch live source lines) -- try it and see.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Jan 29 20:33:44 2008 UTC (18 years, 9 months ago) by tls
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +3 -3 lines
Fix accidental checkin inverting the sense of cryptodev_allowsoft, which
is crazy but has always documented.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sat Jan 26 00:04:27 2008 UTC (18 years, 9 months ago) by tls
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +67 -64 lines
Make /dev/crypto properly cloning.  Leave CRIOGET in place but note that
it is deprecated, no longer required, and will be removed in a future
release of NetBSD.

Dramatically reduce the size of the session structure by removing an
IOV_MAX array of iovecs where only the first was use.  Saves an 8k
bzero on each session creation.

Convert fixed-size allocations in cryptodev.c to pools.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Fri Jan 25 07:09:56 2008 UTC (18 years, 9 months ago) by tls
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +17 -5 lines
Some minor opencrypto fixes, one with a major performance impact for
OpenSSL:

1) Fix extremely misleading text in crypto.4 manual page so it does not
   appear to claim that a new cloned file descriptor is required for every
   session.

2) Fix severe performance problem (and fd leak!) in openssl cryptodev
   engine resulting from misunderstanding probably caused by said manual
   page text.

3) Check for session-ID wraparound in kernel cryptodev provider.  Also,
   start allocating sessions at 1, not 0 -- this will be necessary when
   we add ioctls for the creation of multiple sessions at once, so we
   can tell which if any creations failed.

Revision 1.12.12.4: download - view: text, markup, annotated - select for diffs
Mon Jan 21 09:47:38 2008 UTC (18 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.12.12.3: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.12.3: +26 -2 lines
sync with head

Revision 1.26.28.1: download - view: text, markup, annotated - select for diffs
Sat Jan 19 12:15:38 2008 UTC (18 years, 10 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.26: preferred, colored; next MAIN 1.27: preferred, colored
Changes since revision 1.26: +26 -2 lines
Sync with HEAD

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sat Jan 19 08:08:20 2008 UTC (18 years, 10 months ago) by tls
Branches: MAIN
CVS tags: bouyer-xeni386-nbase, bouyer-xeni386-base
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +26 -2 lines
Add constants for modular arithmetic operations other than exponentiation -- there's hardware out there which can do them.

Revision 1.12.12.3: download - view: text, markup, annotated - select for diffs
Mon Sep 3 14:44:23 2007 UTC (19 years, 2 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.12.12.2: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.12.2: +12 -12 lines
sync with head.

Revision 1.25.4.1: download - view: text, markup, annotated - select for diffs
Mon Mar 12 06:00:50 2007 UTC (19 years, 8 months ago) by rmind
Branches: yamt-idlelwp
Diff to: previous 1.25: preferred, colored; next MAIN 1.26: preferred, colored
Changes since revision 1.25: +12 -12 lines
Sync with HEAD.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Mar 4 06:03:38 2007 UTC (19 years, 8 months ago) by christos
Branches: MAIN
CVS tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, yamt-idlelwp-base8, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, vmlocking-base, vmlocking, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, reinoud-bufcleanup, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, mjf-ufs-trans, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-base, jmcneill-pm-base, jmcneill-pm, jmcneill-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf, bouyer-xeni386-merge1, bouyer-xenamd64-base2, bouyer-xenamd64-base, bouyer-xenamd64
Branch point for: mjf-devfs, matt-armv6, bouyer-xeni386
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +12 -12 lines
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.12.12.2: download - view: text, markup, annotated - select for diffs
Sat Dec 30 20:50:54 2006 UTC (19 years, 10 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.12.12.1: preferred, colored; branchpoint 1.12: preferred, colored
Changes since revision 1.12.12.1: +12 -9 lines
sync with head.

Revision 1.23.4.2: download - view: text, markup, annotated - select for diffs
Sun Dec 10 07:19:28 2006 UTC (19 years, 11 months ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.23.4.1: preferred, colored; branchpoint 1.23: preferred, colored; next MAIN 1.24: preferred, colored
Changes since revision 1.23.4.1: +15 -15 lines
sync with head.

Revision 1.23.2.1: download - view: text, markup, annotated - select for diffs
Sat Nov 18 21:39:44 2006 UTC (20 years ago) by ad
Branches: newlock2
Diff to: previous 1.23: preferred, colored; next MAIN 1.24: preferred, colored
Changes since revision 1.23: +10 -8 lines
Sync with head.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Thu Nov 16 01:33:51 2006 UTC (20 years ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, post-newlock2-merge, newlock2-nbase, newlock2-base, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm, ad-audiomp-base, ad-audiomp
Branch point for: yamt-idlelwp
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +15 -15 lines
__unused removal on arguments; approved by core.

Revision 1.23.4.1: download - view: text, markup, annotated - select for diffs
Sun Oct 22 06:07:47 2006 UTC (20 years ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +16 -14 lines
sync with head

Revision 1.24: download - view: text, markup, annotated - select for diffs
Thu Oct 12 01:32:47 2006 UTC (20 years, 1 month ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base2
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +16 -14 lines
- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.16.4.1: download - view: text, markup, annotated - select for diffs
Sat Sep 9 02:59:41 2006 UTC (20 years, 2 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.16: preferred, colored; next MAIN 1.17: preferred, colored
Changes since revision 1.16: +45 -24 lines
sync with head

Revision 1.17.2.6: download - view: text, markup, annotated - select for diffs
Sun Sep 3 15:25:56 2006 UTC (20 years, 2 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.17.2.5: preferred, colored; branchpoint 1.17: preferred, colored; next MAIN 1.18: preferred, colored
Changes since revision 1.17.2.5: +3 -2 lines
sync with head.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Tue Aug 29 23:52:06 2006 UTC (20 years, 2 months ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +3 -2 lines
fix incomplete initializer

Revision 1.17.2.5: download - view: text, markup, annotated - select for diffs
Fri Aug 11 15:47:26 2006 UTC (20 years, 3 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.17.2.4: preferred, colored; branchpoint 1.17: preferred, colored
Changes since revision 1.17.2.4: +3 -3 lines
sync with head

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sun Jul 23 22:06:14 2006 UTC (20 years, 3 months ago) by ad
Branches: MAIN
CVS tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +3 -3 lines
Use the LWP cached credentials where sane.

Revision 1.12.12.1: download - view: text, markup, annotated - select for diffs
Wed Jun 21 15:12:02 2006 UTC (20 years, 5 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +77 -42 lines
sync with head.

Revision 1.16.6.2: download - view: text, markup, annotated - select for diffs
Thu Jun 1 22:39:26 2006 UTC (20 years, 5 months ago) by kardel
Branches: simonb-timecounters
CVS tags: simonb-timcounters-final
Diff to: previous 1.16.6.1: preferred, colored; branchpoint 1.16: preferred, colored; next MAIN 1.17: preferred, colored
Changes since revision 1.16.6.1: +7 -6 lines
Sync with head.

Revision 1.18.4.2: download - view: text, markup, annotated - select for diffs
Wed May 24 15:50:47 2006 UTC (20 years, 5 months ago) by tron
Branches: peter-altq
Diff to: previous 1.18.4.1: preferred, colored; branchpoint 1.18: preferred, colored; next MAIN 1.19: preferred, colored
Changes since revision 1.18.4.1: +14 -11 lines
Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.17.2.4: download - view: text, markup, annotated - select for diffs
Wed May 24 10:59:21 2006 UTC (20 years, 5 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.17.2.3: preferred, colored; branchpoint 1.17: preferred, colored
Changes since revision 1.17.2.3: +7 -6 lines
sync with head.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun May 14 21:36:50 2006 UTC (20 years, 6 months ago) by elad
Branches: MAIN
CVS tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, chap-midi
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +7 -6 lines
integrate kauth.

Revision 1.18.2.3: download - view: text, markup, annotated - select for diffs
Sat May 6 23:32:33 2006 UTC (20 years, 6 months ago) by christos
Branches: elad-kernelauth
Diff to: previous 1.18.2.2: preferred, colored; branchpoint 1.18: preferred, colored; next MAIN 1.19: preferred, colored
Changes since revision 1.18.2.2: +3 -2 lines
- Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
  that need it.

Approved by core.

Revision 1.16.6.1: download - view: text, markup, annotated - select for diffs
Sat Apr 22 11:40:18 2006 UTC (20 years, 6 months ago) by simonb
Branches: simonb-timecounters
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +38 -19 lines
Sync with head.

Revision 1.18.2.2: download - view: text, markup, annotated - select for diffs
Wed Apr 19 04:33:31 2006 UTC (20 years, 7 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.18.2.1: preferred, colored; branchpoint 1.18: preferred, colored
Changes since revision 1.18.2.1: +14 -12 lines
sync with head.

Revision 1.17.2.3: download - view: text, markup, annotated - select for diffs
Tue Apr 11 11:55:48 2006 UTC (20 years, 7 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.17.2.2: preferred, colored; branchpoint 1.17: preferred, colored
Changes since revision 1.17.2.2: +9 -7 lines
sync with head

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Apr 4 17:30:20 2006 UTC (20 years, 7 months ago) by christos
Branches: MAIN
CVS tags: yamt-pdpolicy-base4, elad-kernelauth-base
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +9 -7 lines
Coverity CID 1083: Avoid possible NULL pointer deref.

Revision 1.17.2.2: download - view: text, markup, annotated - select for diffs
Sat Apr 1 12:07:51 2006 UTC (20 years, 7 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.17.2.1: preferred, colored; branchpoint 1.17: preferred, colored
Changes since revision 1.17.2.1: +7 -7 lines
sync with head.

Revision 1.18.4.1: download - view: text, markup, annotated - select for diffs
Tue Mar 28 09:42:28 2006 UTC (20 years, 7 months ago) by tron
Branches: peter-altq
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +7 -7 lines
Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Fri Mar 17 23:29:11 2006 UTC (20 years, 8 months ago) by christos
Branches: MAIN
CVS tags: yamt-pdpolicy-base3
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +7 -7 lines
don't use MALLOC with a non-constant size; use malloc instead.

Revision 1.17.2.1: download - view: text, markup, annotated - select for diffs
Mon Mar 13 09:07:43 2006 UTC (20 years, 8 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +25 -7 lines
sync with head.

Revision 1.18.2.1: download - view: text, markup, annotated - select for diffs
Wed Mar 8 06:53:45 2006 UTC (20 years, 8 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +6 -6 lines
Adapt to kernel authorization changes.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Mon Mar 6 00:50:44 2006 UTC (20 years, 8 months ago) by christos
Branches: MAIN
CVS tags: yamt-pdpolicy-base2, peter-altq-base
Branch point for: peter-altq, elad-kernelauth
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +25 -7 lines
sprinkle DPRINTF()...

Revision 1.17: download - view: text, markup, annotated - select for diffs
Wed Mar 1 12:38:32 2006 UTC (20 years, 8 months ago) by yamt
Branches: MAIN
CVS tags: yamt-pdpolicy-base
Branch point for: yamt-pdpolicy
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +3 -4 lines
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.

Revision 1.16.2.1: download - view: text, markup, annotated - select for diffs
Thu Feb 2 14:45:12 2006 UTC (20 years, 9 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.16: preferred, colored; next MAIN 1.17: preferred, colored
Changes since revision 1.16: +3 -4 lines
adapt opencrypto.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sun Dec 11 12:25:20 2005 UTC (20 years, 11 months ago) by christos
Branches: MAIN
CVS tags: yamt-uio_vmspace-base5
Branch point for: yamt-uio_vmspace, simonb-timecounters, rpaulo-netinet-merge-pcb
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +20 -20 lines
merge ktrace-lwp.

Revision 1.10.4.8: download - view: text, markup, annotated - select for diffs
Sun Dec 11 10:29:36 2005 UTC (20 years, 11 months ago) by christos
Branches: ktrace-lwp
Diff to: previous 1.10.4.7: preferred, colored; branchpoint 1.10: preferred, colored; next MAIN 1.11: preferred, colored
Changes since revision 1.10.4.7: +15 -2 lines
Sync with head.

Revision 1.14.6.1: download - view: text, markup, annotated - select for diffs
Tue Nov 29 21:23:33 2005 UTC (20 years, 11 months ago) by yamt
Branches: yamt-readahead
Diff to: previous 1.14: preferred, colored; next MAIN 1.15: preferred, colored
Changes since revision 1.14: +15 -2 lines
sync with head.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Fri Nov 25 16:16:46 2005 UTC (20 years, 11 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-readahead-base3, ktrace-lwp-base
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +15 -2 lines
- De-couple the software crypto implementation from the rest of the
  framework.  There is no need to waste the space if you are only using
  algoritms provided by hardware accelerators.  To get the software
  implementations, add "pseudo-device swcr" to your kernel config.
- Lazily initialize the opencrypto framework when crypto drivers
  (either hardware or swcr) register themselves with the framework.

Revision 1.10.4.7: download - view: text, markup, annotated - select for diffs
Thu Nov 10 14:12:12 2005 UTC (21 years ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.10.4.6: preferred, colored; branchpoint 1.10: preferred, colored
Changes since revision 1.10.4.6: +6 -4 lines
Sync with HEAD. Here we go again...

Revision 1.14: download - view: text, markup, annotated - select for diffs
Mon Aug 22 23:11:47 2005 UTC (21 years, 2 months ago) by jonathan
Branches: MAIN
CVS tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base2, yamt-readahead-base, thorpej-vnode-attr-base, thorpej-vnode-attr
Branch point for: yamt-readahead
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +2 -2 lines
No change. Forced commit to record commit message for previous revision, viz:

Fix vulnerability to a denial-of-service attack which passes a
length-0 crypto op. Check for zero length and return EINVAL, taken from:

    http://cvsweb.FreeBSD.org/src/sys/opencrypto/cryptodev.c.diff?r1=1.25&r2=1.26

Original FreeBSD log mesage:

  Modified files:
    sys/opencrypto       cryptodev.c
  Log:
  Fix bogus check. It was possible to panic the kernel by giving 0 length.
  This is actually a local DoS, as every user can use /dev/crypto if there
  is crypto hardware in the system and cryptodev.ko is loaded (or compiled
  into the kernel).

  Reported by:    Mike Tancsa <mike@sentex.net>


thanks to Sam Leffler for passing on a heads-up about this issue.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Mon Aug 22 23:06:34 2005 UTC (21 years, 2 months ago) by jonathan
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +6 -4 lines
*** empty log message ***

Revision 1.10.4.6: download - view: text, markup, annotated - select for diffs
Tue Mar 8 13:53:12 2005 UTC (21 years, 8 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.10.4.5: preferred, colored; branchpoint 1.10: preferred, colored
Changes since revision 1.10.4.5: +4 -4 lines
Sync with HEAD.

Revision 1.10.4.5: download - view: text, markup, annotated - select for diffs
Sat Dec 18 09:33:17 2004 UTC (21 years, 11 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.10.4.4: preferred, colored; branchpoint 1.10: preferred, colored
Changes since revision 1.10.4.4: +7 -41 lines
Sync with HEAD.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Tue Nov 30 04:25:44 2004 UTC (21 years, 11 months ago) by christos
Branches: MAIN
CVS tags: yamt-km-base4, yamt-km-base3, yamt-km-base2, yamt-km-base, yamt-km, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, kent-audio2-base, kent-audio2, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-lazymbuf
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +7 -41 lines
Cloning cleanup:
1. make fileops const
2. add 2 new negative errno's to `officially' support the cloning hack:
    - EDUPFD (used to overload ENODEV)
    - EMOVEFD (used to overload ENXIO)
3. Created an fdclone() function to encapsulate the operations needed for
   EMOVEFD, and made all cloners use it.
4. Centralize the local noop/badop fileops functions to:
   fnullop_fcntl, fnullop_poll, fnullop_kqfilter, fbadop_stat

Revision 1.10.4.4: download - view: text, markup, annotated - select for diffs
Tue Sep 21 13:38:44 2004 UTC (22 years, 1 month ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.10.4.3: preferred, colored; branchpoint 1.10: preferred, colored
Changes since revision 1.10.4.3: +24 -24 lines
Fix the sync with head I botched.

Revision 1.10.4.3: download - view: text, markup, annotated - select for diffs
Sat Sep 18 14:56:20 2004 UTC (22 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.10.4.2: preferred, colored; branchpoint 1.10: preferred, colored
Changes since revision 1.10.4.2: +24 -24 lines
Sync with HEAD.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Fri Sep 17 14:11:27 2004 UTC (22 years, 2 months ago) by skrll
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +3 -3 lines
There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe

Revision 1.10.4.2: download - view: text, markup, annotated - select for diffs
Tue Aug 3 10:56:25 2004 UTC (22 years, 3 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.10.4.1: preferred, colored; branchpoint 1.10: preferred, colored
Changes since revision 1.10.4.1: +790 -0 lines
Sync with HEAD

Revision 1.10.4.1
Wed Nov 19 04:14:07 2003 UTC (23 years ago) by skrll
Branches: ktrace-lwp
FILE REMOVED
Changes since revision 1.10: +0 -790 lines
file cryptodev.c was added on branch ktrace-lwp on 2004-08-03 10:56:25 +0000

Revision 1.10: download - view: text, markup, annotated - select for diffs
Wed Nov 19 04:14:07 2003 UTC (23 years ago) by jonathan
Branches: MAIN
CVS tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Branch point for: ktrace-lwp
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +4 -3 lines
Wrap noisy pointless message about denied userspace requests with
`#ifdef CRYPTO_DEBUG', per Jason Thorpe's  suggestion.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Wed Nov 19 03:18:33 2003 UTC (23 years ago) by jonathan
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +7 -6 lines
Clean up userlevel access to software kernel transforms, in preparation
for using /dev/crypto for OpenSSL:

1. Add comments explaining crypto_devallowsoft, explaining the
OpenBSD-style three-way logic actully implemented in crypto_newsession().

2. Pass crypto_devallowsoft as the final argument to crypto_newsession(),
instead of a constant 0 value.

3. Set the default value of crypto_devallowsoft to 1, to allow
/dev/crypto access only for hardware-supported transforms.

Items 1-3 may be revised to match the FreeBSD two-way logic, if the
consensus is that there's no point to forcing software transforms.
But as a first step, let the description match what the code actually does.

GC unused variables usercrypto, userasmcrypto, cryptodevallowsoft from
cryptodev.c, in favour of variables crypto_usercrypto, crypto_userasmcrypto,
crypto_devallowsoft, which are used as well as defined in crypto.c.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sun Nov 16 00:16:06 2003 UTC (23 years ago) by jonathan
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +2 -4 lines
Remove '#ifdef notdef' around userspace ioctl() requests for
pure (non-HMAC) MD5 and SHA1.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Tue Aug 26 15:01:38 2003 UTC (23 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -7 lines
Remove a bunch of unnecessary includes.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Mon Aug 25 04:09:57 2003 UTC (23 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +4 -3 lines
It's bad form to use the <opencrypto/rmd160.h> header file while
using the crypto/ripemd160/rmd160.c implementation.  Remove the
opencrypto-local copies of these files entirely.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Fri Aug 22 05:07:26 2003 UTC (23 years, 3 months ago) by itojun
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -3 lines
on netbsd, major # for /dev/crypto depends on arch

Revision 1.4: download - view: text, markup, annotated - select for diffs
Thu Aug 21 16:08:05 2003 UTC (23 years, 3 months ago) by jonathan
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +4 -5 lines
Pull up `done' flag for crypto operations from FreeBSD. FreeBSD deltas:
  cryptodev.c: 1.4.2.3 -> 1.4.2.4
  cryptodev.h: 1.4.2.4 -> 1.4.2.5

Revision 1.3: download - view: text, markup, annotated - select for diffs
Wed Jul 30 18:20:15 2003 UTC (23 years, 3 months ago) by jonathan
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +2 -3 lines
Garbage-collect  references to  OpenBSD-only <dev/rndvar.h>.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Mon Jul 28 19:37:04 2003 UTC (23 years, 3 months ago) by jonathan
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +3 -3 lines
Remove vestiges of OpenBSD <sys/md5k.h> header.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Fri Jul 25 21:12:44 2003 UTC (23 years, 3 months ago) by jonathan
Branches: MAIN
Commit initial NetBSD port of the OpenCrypto Framework (OCF).  This
code is derived from Sam Leffler's FreeBSD port of OCF, which is in
turn a port of Angelos Keromytis's OpenBSD work.
Credit to Sam and Angelos, any blame for the NetBSD port to me.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>