Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Issue 79283002: crypto: disable NSS AES-NI support when AVX is disabled by OS. (Closed)

Created:
7 years, 1 month ago by agl
Modified:
7 years, 1 month ago
Reviewers:
wtc, awong, Ryan Sleevi
CC:
chromium-reviews, erikwright+watch_chromium.org
Visibility:
Public.

Description

crypto: disable NSS AES-NI support when AVX is disabled by OS. When running under Xen, or with certain kernel configurations, it's possible for the CPU to support AVX but for the operating system not to have configured it. In this case, CPUID indicates that AVX support exists and NSS will try to use it for AES-GCM. However, the first AVX instruction will cause an illegal instruction exception. This change works around the problem by disabling AES-NI support when AVX support exists but is not supported by the OS. Sadly this also means that plain AES instructions are also disabled in this case, but that's better than crashing. https://bugzilla.mozilla.org/show_bug.cgi?id=940794 BUG=320524 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=236794

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use base::Environment #

Total comments: 15

Patch Set 3 : Add NSS version check. #

Patch Set 4 : ... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -24 lines) Patch
M base/cpu.h View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M base/cpu.cc View 1 2 5 chunks +34 lines, -24 lines 0 comments Download
M crypto/nss_util.cc View 1 2 3 chunks +18 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
agl
7 years, 1 month ago (2013-11-20 19:52:16 UTC) #1
Ryan Sleevi
https://codereview.chromium.org/79283002/diff/1/crypto/nss_util.cc File crypto/nss_util.cc (right): https://codereview.chromium.org/79283002/diff/1/crypto/nss_util.cc#newcode638 crypto/nss_util.cc:638: // that |has_avx()| is false (which includes the XSAVE ...
7 years, 1 month ago (2013-11-20 21:46:28 UTC) #2
agl
Note that we'll only be disabling AES in rare cases (when running in some versions ...
7 years, 1 month ago (2013-11-20 22:55:53 UTC) #3
Ryan Sleevi
On 2013/11/20 22:55:53, agl wrote: > Note that we'll only be disabling AES in rare ...
7 years, 1 month ago (2013-11-21 00:41:38 UTC) #4
agl
+ajwong to review changes in base/
7 years, 1 month ago (2013-11-21 18:40:18 UTC) #5
wtc
Patch set 2 LGTM. https://codereview.chromium.org/79283002/diff/1/crypto/nss_util.cc File crypto/nss_util.cc (right): https://codereview.chromium.org/79283002/diff/1/crypto/nss_util.cc#newcode638 crypto/nss_util.cc:638: // that |has_avx()| is false ...
7 years, 1 month ago (2013-11-21 21:03:43 UTC) #6
awong
Going to rubber stamp LGTM base since there are no API changes.
7 years, 1 month ago (2013-11-22 01:02:46 UTC) #7
awong
On 2013/11/22 01:02:46, awong wrote: > Going to rubber stamp LGTM base since there are ...
7 years, 1 month ago (2013-11-22 01:03:31 UTC) #8
agl
(retrying failed upload.) https://codereview.chromium.org/79283002/diff/230001/base/cpu.cc File base/cpu.cc (right): https://codereview.chromium.org/79283002/diff/230001/base/cpu.cc#newcode129 base/cpu.cc:129: * See http://software.intel.com/en-us/blogs/2011/04/14/is-avx-enabled */ On 2013/11/21 ...
7 years, 1 month ago (2013-11-22 16:22:35 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/agl@chromium.org/79283002/490001
7 years, 1 month ago (2013-11-22 16:24:06 UTC) #10
commit-bot: I haz the power
7 years, 1 month ago (2013-11-22 18:35:08 UTC) #11
Message was sent while issue was closed.
Change committed as 236794

Powered by Google App Engine
This is Rietveld 408576698