Re: AES leaks, cgd ciphers, and vector units in the kernel

2020-06-29 Thread Taylor R Campbell
> Date: Tue, 30 Jun 2020 00:43:15 +
> From: Taylor R Campbell 
> 
> - bitsliced AES four blocks at a time with SSE2 on all x86

Correction: all amd64, but not all x86 -- there are i386 CPUs without
SSE2, of course, but they are mostly >=20 years old at this point.


Re: AES leaks, cgd ciphers, and vector units in the kernel

2020-06-29 Thread Taylor R Campbell
> Date: Wed, 17 Jun 2020 23:36:11 +
> From: Taylor R Campbell 
> 
> [bcc tech-crypto, tech-security; followups to tech-kern]
> 
> It's been well-known since 2005[1] that naive AES software, like we
> use today in the NetBSD kernel, is vulnerable to cache-timing attacks
> (CVE-2005-1797).  These attacks have gotten progressively better over
> time, and over a decade ago were even applied to Linux dm-crypt disk
> encryption[2].
> [...]
> The attached patch set provides a three-pronged approach to addressing
> the problem:

FYI, I committed this today.  The NetBSD kernel has no more vulnerable
AES software -- all architectures at least have BearSSL's bitsliced
32-bit aes_ct software to fall back to if there's no faster MD AES
implementation.

Aside from adding Adiantum to cgd(4) in order to provide better
software performance and security than AES-CBC or AES-XTS can, I also
added:

- AES-NI on amd64 for most high-end x86 <=10 years old
- bitsliced AES four blocks at a time with SSE2 on all x86
- permutation-based AES (vpaes) with SSSE3 on most x86 <=15 years old
- VIA ACE AES on VIA CPUs (not just via opencrypto as we had before)
- ARMv8.0-AES on aarch64 for all but the cheapest aarch64 CPUs
- permutation-based AES (vpaes) with ARM NEON on most armv7-a and
  aarch64, even cheap aarch64 like rpi

I left in the complicated legacy rijndael_* API -- implemented in
terms of the new aes_* API which takes advantage of any CPU support --
because it is still used in net80211.  Once the wifi branch is done,
or if the wifi branch is rebased on HEAD, we can delete it there too.

Let me know if there's any fallout, or if you're interested in
extending it to other CPUs or vector units!


Re: pg_jobc going negative?

2020-06-29 Thread Kamil Rytarowski
On 09.06.2020 20:11, Robert Elz wrote:
> Date:Tue, 9 Jun 2020 17:04:54 +0200
> From:Kamil Rytarowski 
> Message-ID:  
> 
> 
>   | Yes... syzkaller had like 12 different ways to reproduce it.
> 
> OK, thanks.
> 
>   | There is still a race and we randomly go to negative pg_jobc.
> 
> I am not at all surprised...
> 
> I will look at it over the next couple of days.   No guarantees...
> 

Ping? This kernel crash is blocking GDB/etc and it is an instant crash.

> kre
>