NetBSD Security Advisory 2005-001: Crypto leaks across HyperThreaded CPUs (i386, P4, HTT+SMP only)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

Abstract
========

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.

Technical Details
=================

The full explanation of the issue can be found here:

http://www.daemonology.net/papers/htt.pdf

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
during boot.

Your system is affected, but probably not at risk, if you do not permit
shell access by untrusted users.

Additional resources:

http://www.daemonology.net/hyperthreading-considered-harmful/
ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-05:09.htt.asc

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
also discussed.

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.

Thanks To
=========

Colin Percival

Jacques A. Vidrine

Revision History
================

2005-06-30 Initial release

More Information
================

Advisories may be updated as new information becomes available.
The most recent version of this advisory (PGP signed) can be found at
ftp://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2005-001.tx...

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)

iQCVAwUBQsQHlj5Ru2/4N2IFAQI6egQAoUSxClcXFCSwtO1e5DFRu+QhKVR3cczl
TBh4i7nGYKiZqJiV5N1EnfGMFgwRgR1pvaVpt+0f7/BaibqYd0LOE4QOJx2usIuZ
vjxcP3IT8MUXpi3jDnzsamst1hIc14i35nquGGKmBV1L71qBqv6bDp5QWj2U5XUw
pnsE1AJBPeY=
=JklU
-----END PGP SIGNATURE-----

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
NetBSD now has native pthreads!, Jan Schaumann, (Sun Jan 19, 6:14 pm)
NetBSD Security Advisory 2007-007: BIND cryptographically we..., NetBSD Security-Officer, (Thu Sep 13, 5:56 pm)
The pkgsrc-2008Q2 Release, Alistair Crooks, (Sat Jul 26, 3:45 am)
Summer of Code student applications period extended, Jan Schaumann, (Wed Apr 2, 1:36 am)
NetBSD Security Advisory 2008-003: IPsec in IPv6 Denial of S..., NetBSD Security-Officer, (Thu Feb 28, 7:37 pm)
Announcing NetBSD 5.0, Soren Jacobsen, (Wed Apr 29, 5:49 pm)
anoncvs service unavailable until further notice, Christos Zoulas, (Thu Dec 23, 2:27 pm)
Timelines for upcoming releases, James Chacon, (Mon May 2, 6:51 pm)
NetBSD Security Advisory 2005-001: Crypto leaks across Hyper..., NetBSD Security-Officer, (Thu Jun 30, 6:12 pm)
cvsweb offline, SODA Noriyuki, (Thu Aug 11, 10:46 am)
Announcing update 2.0.3 - source only, James Chacon, (Mon Oct 31, 11:52 am)
[ANNOUNCE] pkgsrc-users mailing list, Johnny C. Lam, (Thu Feb 23, 7:47 pm)
NetBSD Security Advisory 2006-007: mail(1) creates record fi..., NetBSD Security-Officer, (Wed Mar 29, 9:31 pm)
NetBSD Security Advisory 2006-011: IPSec replay attack, NetBSD Security-Officer, (Wed Apr 12, 10:33 pm)
Promote BSD and Share the Wealth, Chris Coleman, (Thu Apr 18, 7:38 pm)
New Developers, Jan Schaumann, (Mon Jul 1, 5:55 pm)
Announcing the release of NetBSD 3.0.1, Matthias Scheler, (Mon Jul 24, 2:02 pm)
Organizational Changes to the NetBSD Project, Alistair Crooks, (Fri Sep 1, 3:36 am)
NetBSD 5.0_RC2 binaries available for download, Soren Jacobsen, (Tue Feb 10, 11:43 pm)
NetBSD developer's summit and hackathon, Jan Schaumann, (Sat Oct 4, 2:02 pm)
NetBSD Security Advisory 2009-010: ISC dhclient subnet-mask ..., NetBSD Security Officer, (Tue Jul 14, 5:31 pm)