Commit Graph

4252 Commits

Author SHA1 Message Date
knakahara 57870677c1 Fix missing "-m tranport" options. Pointed out by k-goda@IIJ.
Using any mode SA causes unepected call path, that is,
ipsec4_common_input_cb() calls ip_input() directly instead of
ipsecif4_input().
2020-08-05 01:10:50 +00:00
riastradh 7a8eb9a111 Implement 4-way vectorization of ChaCha for armv7 NEON.
cgd performance is not as good as I was hoping (~4% improvement over
chacha_ref.c) but it should improve substantially more if we let the
cgd worker thread keep fpu state so we don't have to pay the cost of
isb and zero-the-fpu on every 512-byte cgd block.
2020-07-28 20:08:48 +00:00
riastradh dadf58c832 It's __ARM_NEON, not __ARM_NEON__, sometimes, apparently. 2020-07-27 20:59:53 +00:00
riastradh f7b532dd9f Enable ChaCha NEON code on armv7 too.
The 4-blocks-at-a-time assembly helper is disabled for now; adapting
it to armv7 is going to be a little annoying with only 16 128-bit
vector registers.

(Should also do a fifth block in the integer registers for 320 bytes
at a time.)
2020-07-27 20:51:29 +00:00
gson e665c975ab Skip the repeated_link_addr test by default as it causes the
evbarm-aarch64 testbed to hang (PR port-evbarm/55521), and will not be
safe to run by default even after that bug is fixed, for similar
reasons as t_repeated_updown.
2020-07-27 16:57:44 +00:00
jruoho 3f94c7658e Use the new "run_unsafe" atf_config_get() option also with a couple of other
tests that are known to be unsafe.
2020-07-27 07:36:19 +00:00
gson 7836998153 Instead of just skipping interfaces that are "up", skip the whole
repeated_updown test case unless explicitly enabled with "atf-run -v
run_unsafe=yes".  Gratuitously configuring interfaces "up" is no more
safe than gratuitously configuring them "down"; for example, it could
lead to accidentally connecting to an insecure network or diverting
traffic from the desired route.
2020-07-27 06:52:48 +00:00
riastradh ed8eacd373 Sort includes. 2020-07-26 14:01:14 +00:00
martin 9c03d654a9 Add missing include to fix the build on architectures w/o any special
accelerated AES implementation.
2020-07-26 12:43:27 +00:00
riastradh 59613b8a1a Add kernel ChaCha test to exercise all available implementations. 2020-07-25 22:53:38 +00:00
riastradh 36d44afd5a Implement AES-CCM with ARMv8.5-AES. 2020-07-25 22:33:04 +00:00
martin e6ac0f80fe Skip interfaces that are already UP before the test starts. We can
not change state of the test host this way, it breaks e.g. test systems
with the root filesystem on NFS.
2020-07-22 05:47:24 +00:00
maxv d3713544b3 Compile USER_LDT by default, but, put it behind a privileged sysctl that
defaults to disabled. To enable:

	# sysctl -w machdep.user_ldt=1
2020-07-19 14:31:31 +00:00
kamil 07e8492e26 Add ppoll() a compatibility wrapper around pollts(2)
Submitted by Apurva Nandan.
2020-07-17 15:34:16 +00:00
jruoho 0a95079b4a Do not allow disabling interrupts on the primary CPU. Fixes PR kern/45117. 2020-07-13 13:16:07 +00:00
jruoho 50e485342b Sleep even more. 2020-07-11 09:55:26 +00:00
jruoho eaede56dac Skip this test as it may cause a panic. Point to PR kern/55481. 2020-07-11 09:35:22 +00:00
christos a314e6f743 add a test for v4 mapped addresses 2020-07-06 18:45:25 +00:00
christos 8049036801 don't open the socket twice. 2020-07-06 16:24:06 +00:00
jruoho 671da32626 Remove the expected timeout; there is something more sinister behind the
timeouts seen on the Qemu/evbarm-aarch64 runs.
2020-07-06 10:35:00 +00:00
jruoho 28b2e2ce1b Sleep more. 2020-07-06 10:32:18 +00:00
maxv 66af4cddad more 2020-07-03 16:07:52 +00:00
jruoho 7b69662fe9 Skip these also for Qemu runs as they cause panics. Point to PR kern/55451. 2020-07-03 07:03:14 +00:00
jruoho 9cb1df3cd3 Add a check for PR bin/54692. 2020-07-03 04:25:28 +00:00
jruoho 7bd1b83147 Add a check for the overflow noted in PR lib/46542. 2020-07-03 03:59:18 +00:00
jruoho 04c087f823 Verify that PR lib/55041 is no longer an issue. 2020-07-03 03:13:10 +00:00
jruoho f62e6216a7 Expect a timeout for evbarm-aarch64, as seen in the recent Qemu runs. 2020-07-03 02:51:13 +00:00
jruoho 4704e28c3f Add basic checks for magic symlink(7)'s. These include a case for PR lib/55361,
although it seems that realpath(3) has bigger problems with these symlinks.
2020-07-01 13:49:26 +00:00
riastradh 341c574011 Pass the requisite -msse options for i386. 2020-07-01 09:58:29 +00:00
jruoho 55abcd082f Add basic checks for a64l(3), l64a(3), and l64a_r(3). 2020-07-01 07:16:37 +00:00
jruoho 7fed543511 Add basic tests for the rest of the mktemp(3) family of functions, including
a case for PR lib/55441.
2020-07-01 05:37:25 +00:00
riastradh bd9707e06e New test sys/crypto/aes/t_aes.
Runs aes_selftest on all kernel AES implementations supported on the
current hardware, not just the preferred one.
2020-06-30 20:32:10 +00:00
jruoho 2ba250a115 After a comedy of errors, move t_mbtowc to its final resting place. 2020-06-30 16:09:40 +00:00
jruoho 8b2d29b6bf Check that DTrace's execsnoop and opensnoop work (cf. PR kern/53417). 2020-06-30 14:30:49 +00:00
jruoho 6d91546d37 Skip a few more nodes, and enable this test for Qemu runs. 2020-06-30 11:49:26 +00:00
jruoho e643f0ea97 Add a couple of tests for sequential ifconfig(8) options, incl. PR kern/41912. 2020-06-30 11:48:20 +00:00
riastradh 64af5d547a Missed a spot -- one more 32-bit sign-compare issue. 2020-06-30 04:17:31 +00:00
riastradh 6a40410cdc Fix sign-compare issue on 32-bit systems.
Built fine on amd64, where all unsigned values are representable in
ssize_t, but I didn't try building on i386, where they're not.
2020-06-30 04:15:46 +00:00
riastradh 04a6492d1e New cgd cipher adiantum.
Adiantum is a wide-block cipher, built out of AES, XChaCha12,
Poly1305, and NH, defined in

   Paul Crowley and Eric Biggers, `Adiantum: length-preserving
   encryption for entry-level processors', IACR Transactions on
   Symmetric Cryptology 2018(4), pp. 39--61.

Adiantum provides better security than a narrow-block cipher with CBC
or XTS, because every bit of each sector affects every other bit,
whereas with CBC each block of plaintext only affects the following
blocks of ciphertext in the disk sector, and with XTS each block of
plaintext only affects its own block of ciphertext and nothing else.

Adiantum generally provides much better performance than
constant-time AES-CBC or AES-XTS software do without hardware
support, and performance comparable to or better than the
variable-time (i.e., leaky) AES-CBC and AES-XTS software we had
before.  (Note: Adiantum also uses AES as a subroutine, but only once
per disk sector.  It takes only a small fraction of the time spent by
Adiantum, so there's relatively little performance impact to using
constant-time AES software over using variable-time AES software for
it.)

Adiantum naturally scales to essentially arbitrary disk sector sizes;
sizes >=1024-bytes take the most advantage of Adiantum's design for
performance, so 4096-byte sectors would be a natural choice if we
taught cgd to change the disk sector size.  (However, it's a
different cipher for each disk sector size, so it _must_ be a cgd
parameter.)

The paper presents a similar construction HPolyC.  The salient
difference is that HPolyC uses Poly1305 directly, whereas Adiantum
uses Poly1395(NH(...)).  NH is annoying because it requires a
1072-byte key, which means the test vectors are ginormous, and
changing keys is costly; HPolyC avoids these shortcomings by using
Poly1305 directly, but HPolyC is measurably slower, costing about
1.5x what Adiantum costs on 4096-byte sectors.

For the purposes of cgd, we will reuse each key for many messages,
and there will be very few keys in total (one per cgd volume) so --
except for the annoying verbosity of test vectors -- the tradeoff
weighs in the favour of Adiantum, especially if we teach cgd to do
>>512-byte sectors.

For now, everything that Adiantum needs beyond what's already in the
kernel is gathered into a single file, including NH, Poly1305, and
XChaCha12.  We can split those out -- and reuse them, and provide MD
tuned implementations, and so on -- as needed; this is just a first
pass to get Adiantum implemented for experimentation.
2020-06-29 23:44:01 +00:00
maya f728d212f0 Avoid copyright issues and name the listed author as the copyright holder.
In a private email, Miloslav had agreed that if they had written the
test, then it can be licensed bsd-2-clause. I am going to assume this
is true as the file names Miloslav as the author.

This test was likely sent to tcsh (not netbsd) that had changed bug
report systems since.
2020-06-29 20:53:40 +00:00
jruoho db34f12f88 Use -Wl,--no-fatal-warnings for the mktemp(3) test. 2020-06-29 14:22:11 +00:00
jruoho 3e2e2a93b9 Ups. Fix shell parameter. 2020-06-27 14:04:17 +00:00
jruoho 7725c11dd6 Add also a test that writes random garbage to every ifconfig(8) option that
takes parameters. Based on quick testing, iwn(4) and wm(4) pass, but
urtwn(4) panics. Use at your own risk; in some cases, it may be possible
that horrors are written directly to the hardware.
2020-06-27 13:53:43 +00:00
jruoho a4f7315844 Add the default TNF copyright (2005), cf. PR misc/55419. 2020-06-27 10:19:43 +00:00
jruoho 21c7d294a2 Start moving the remaining tests from src/regress to src/tests. 2020-06-27 10:14:10 +00:00
jruoho f60c53b495 Move the test for mktemp(3) to the right place. 2020-06-27 09:45:57 +00:00
jruoho 313072e773 Add a simple test case that writes random garbage to (almost) every sysctl node.
This test reproduced already at least five unique panics in a few quick runs.
The test is skipped by default as it is not likely safe even without the panics.
2020-06-27 08:50:46 +00:00
jruoho b61f0fee17 Add a basic test for enabling/disabling network interface capabilities. 2020-06-27 06:57:44 +00:00
jruoho 78bd8e59f5 Add a test case for PR kern/53767. 2020-06-27 05:20:34 +00:00
jruoho dc018d6b62 Add test cases for different 802.11 options. These include cases for
PR kern/35045, PR kern/45745, and PR kern/55424.
2020-06-27 05:07:07 +00:00