Subject: NetBSD Security Advisory 2005-001: Crypto leaks across HyperThreaded CPUs (i386, P4, HTT+SMP only)
To: None <email@example.com>
From: NetBSD Security-Officer <firstname.lastname@example.org>
Date: 06/30/2005 18:12:21
-----BEGIN PGP SIGNED MESSAGE-----
NetBSD Security Advisory 2005-001
Topic: Crypto leaks across HyperThreaded CPUs (i386, P4, HTT+SMP only)
Version: NetBSD-current: affected, i386 on P4 with HTT and SMP kernels
NetBSD 2.0: affected, i386 on P4 with HTT and SMP kernels
NetBSD 1.6 and earlier: not affected, i386 SMP was not in these releases
Severity: Possible exposure of cryptographic key information to local users
Fixed: Best Practices are under discussion. See below.
The Pentium CPU shares caches between HyperThreads. This permits a local
process to gain a side-channel against cryptographic processes running
on the other HyperThread. Testing for cached data can be accomplished by
timing reads. Under some circumstances, this permits the spying process
to extract bits of the key. This has been demonstrated against OpenSSL.
The full explanation of the issue can be found here:
This issue affects only a subset of i386 systems.
Your system is not affected if you are running a CPU without HyperThreading.
Your system is not affected if you are running a non-SMP kernel.
Your system is not affected if you have disabled HyperThreading in your
BIOS, and confirmed that the virtual CPUs are not detected by the kernel
Your system is affected, but probably not at risk, if you do not permit
shell access by untrusted users.
Solutions and Workarounds
This issue is fundamental to the design and implementation of
HyperThreading in Intel processors. Avoiding the problem is possible,
and two workarounds are available now. Others which may appear later are
Option 1. Disable HyperThreading in the BIOS.
Disabling HyperThreading is a complete workaround for the issue.
Option 2. Run a non-SMP kernel.
On single physical CPU systems, running a non-SMP kernel
effectively disables HyperThreading. On a multi-CPU system, this
option is not the best solution, since it will disable
additional physical CPUs as well.
Later potential workarounds:
1. Reimplement all cryptographic code to use constant time, and constant
cache-access execution patterns. There is some interest along these
lines from various groups, as a result of this issue. NetBSD's Security
Officers will monitor the availability of such code.
2. Implement some form of locking which prevents the sibling
HyperThread from running while cryptographic or other sensitive code is
active on a processor.
Additionally, FreeBSD has chosen to offer a tunable bootloader option to
disable spinup of HyperThread Virtual CPUs, without requiring a change
to BIOS settings. The NetBSD Security Officer has not seen a demand from
the NetBSD community for a similar workaround, but would discuss the
possibility in the appropriate forums, if asked to.
Jacques A. Vidrine
2005-06-30 Initial release
Advisories may be updated as new information becomes available.
The most recent version of this advisory (PGP signed) can be found at
Information about NetBSD and NetBSD security can be found at
http://www.NetBSD.org/ and http://www.NetBSD.org/Security/.
Copyright 2005, The NetBSD Foundation, Inc. All Rights Reserved.
Redistribution permitted only in full, unmodified form.
$NetBSD: NetBSD-SA2005-001.txt,v 1.3 2005/06/22 05:44:50 wiz Exp $
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)
-----END PGP SIGNATURE-----