Commit Graph

4231 Commits

Author SHA1 Message Date
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
jruoho 6232dbeb26 Use atf_pass to avoid test failure in case there are no suitable interfaces. 2020-06-27 04:15:17 +00:00
jruoho 55908713e4 Reference PRs consistently. 2020-06-26 07:50:11 +00:00
jruoho f5fa72a2a9 Test creating thousands of bridge(4)'s. Unlike with tap(4) (PR kern/55417),
this test succeeeds. It is even possible to have the ultimate ifconfig(8)
output with more than 65,000 devices.
2020-06-25 18:30:42 +00:00
jruoho 9611465bb1 Verify that PR kern/52150 is no longer present. 2020-06-25 17:08:32 +00:00
jruoho 11d78a2165 Instead of UINT_MAX + 2, test what is claimed. 2020-06-25 16:57:00 +00:00
jruoho 04cb13a856 Actually create the tap(4) with a negative device number. Doh. 2020-06-25 16:52:49 +00:00
jruoho 02dcf11b6e Reference also PR kern/52526. 2020-06-25 16:34:49 +00:00
jruoho 2a70c17495 Add a test case for PR kern/52744, which no longer appears to be present. 2020-06-25 16:16:48 +00:00
jruoho c6ea14b7ca Fix pastos. 2020-06-25 15:43:26 +00:00
jruoho 0f5766374a Add a test case for kern/52771. 2020-06-25 15:41:40 +00:00
jruoho 77e941ddd2 Add a test case for PR kern/53410. 2020-06-25 15:01:35 +00:00
jruoho 5c3bd061a3 Add test cases for PR kern/53546 and PR kern/55417. Both are skipped as
both reproduce panics.
2020-06-25 14:24:45 +00:00
jruoho 07a6f275d7 Reference also PR kern/53860. 2020-06-25 11:26:05 +00:00
jruoho bf613d3342 Reference PRs consistently. 2020-06-25 11:12:03 +00:00
jruoho b23ebd9451 Require root privileges. 2020-06-25 10:34:34 +00:00
martin daa128b211 Add input files 2020-06-24 15:05:45 +00:00
martin 4c5da4561c Fix directories 2020-06-24 14:48:47 +00:00
thorpej 492187ea09 Fix pasto; use {,U}LLONG{MIN,MAX} correctly in the {u,}llong{min,max}
range checks.

PR lib/55414
2020-06-24 14:28:10 +00:00
jruoho 547814cf8b Also install new tests. 2020-06-24 12:31:26 +00:00
jruoho 08daf067e8 Fix references in comments. 2020-06-24 10:07:13 +00:00
jruoho 55d0ca692c Check that fstat(1) works (cf. PR kern/55407). 2020-06-24 10:05:07 +00:00