From patchwork Thu Jul 13 17:48:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 107705 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2516279qge; Thu, 13 Jul 2017 10:48:46 -0700 (PDT) X-Received: by 10.84.215.220 with SMTP id g28mr11492948plj.281.1499968125945; Thu, 13 Jul 2017 10:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499968125; cv=none; d=google.com; s=arc-20160816; b=bnQJWfOlbjLWbZxoi/nouWRKwfW6kjKsP6gcISEN+ia1KzszKOVQNvDoXuSbGn6omi tKv9KlHDhJ5EYfiWit+u7QrSq2leTtVmMcwUl+XW9/aerxr14dOY0hS0tqmjWFlofzdk ZEm4Gf83gbxDaGpY3ug9GF723ibGDfSB3/vA6/o1SZ+k+jJd5BuD4+NwmaLO+MYGOFQK 1H1HihTkTATATJJwtl+KpNLgkH1Q19YInPk6L+1btu/hhIbJQgNmBOy41TezBnuUnANA 8ayjPf3eIAOa3n1/TTO1qTBgm4IVKcoAx3i5rEREammvSccDcHnBJzV1JZD8wFCkeo4c 0v4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=zwecVCN707pWVZvwZcXuAztrwK0m0c7ku+GntePq8fQ=; b=mo29ZSI1qyUwdmwUtu0RGd6AZZJuKMOy03vsWNDkPmBTyn8QWbrhlGLvioW4PyY3YC enTaSOGRBMImgdXkg7f4qzw/X4TPhWdLXaTLnyzGW8fWhqB//tuE7wjzbn7MuGE4N4WV atRZnPlIwkagRvGGhR/0meQ/+aBxSWUaZjEUhxt5mBDBYqotMLbOOHrLZcbQb73eS8w4 7gDAf7U/X7Dv9O0oA/EnK/iNkzABauTNcMdjqZuAY6f/EMO5wZG3kFToxVFTIo3Fg/8n /3KC6/oKIuEOivuPtN+o7ByBMnPryZAhS3SpedoxZnvx2g7IjOBhWtJw9TncZ9dWfpSS lTwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.b=hQxGAqAa; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id t22si4997750plj.269.2017.07.13.10.48.45; Thu, 13 Jul 2017 10:48:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.b=hQxGAqAa; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 81F9B780ED; Thu, 13 Jul 2017 17:48:43 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by mail.openembedded.org (Postfix) with ESMTP id EF8117197A for ; Thu, 13 Jul 2017 17:48:25 +0000 (UTC) Received: by mail-wr0-f178.google.com with SMTP id r103so56739188wrb.0 for ; Thu, 13 Jul 2017 10:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=hZILFyQRl9Qgy/KBwP+pATSqWPvrC+UPE6MLO3ckwg0=; b=hQxGAqAaoU16taI2ets6mY2f6SF4w48AY8Jaian4AMu4Qye0qXR37HUpF5gRkz1eSQ tC2CBcAPNhNAZ3syOr3RWeNspzXlv1Lw1Xn1V3CB/qNP7uBcIzkYAPUzgYFlKlxOF9OM XQ02y/nIRbh6/eI0aMXtg+8KNyo5ccU/UQgnXKwAC3DxRuI3rogneQNE2xSfBAcLfy3K 33FIybjOiXVD5cED6S8ZIV5W3AOraFAn8PlfHcqPpwUPORDC03H2AtyOTvkFQIkzd5Bx v4kgu6t1HwpOgTSmCyDoBgT+jbQhVTKMUZkDgqGtQNRNhLC+hBRUl2P+UHp5c3emTNxb qqvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hZILFyQRl9Qgy/KBwP+pATSqWPvrC+UPE6MLO3ckwg0=; b=n3+0gDCotET2MPxhXrVL2Jy5muyma+fWSJM+jqw7DmYcYHyPB6g5kNiM0OZA9UC+W8 gcK9Ivf4Wop3oU1/1qX+uafeqfP6OnPnJ0otWlH4fkn+jVlaVL81iWK6wFQBeVgBzDhc JPZqXd20g2tWWUF+uLF2zySJ6m1eTl2Dlk6asNgUmD1bxguRrqNpABgyWC+l9s56I014 RyXfrNtpoWCqyLeWI6jXvgRBINu6yD1s6Aw0QkH6SmSoajKnqv2hb/XvLlI2LPmutN6G Dehv7jfNz6VZttaRVCMsIEVztUOuJnt67iJBTu65LW5JwZ7+ndMNc0ptTA4I6VtMSmrU 3LTg== X-Gm-Message-State: AIVw113/RFWPDUvH3jK76N97bX/QrXc/+y847WjWrHX39uIkZMqIHhsy O/wznAvHGABSCoMHZAU= X-Received: by 10.223.169.51 with SMTP id u48mr2233759wrc.176.1499968106249; Thu, 13 Jul 2017 10:48:26 -0700 (PDT) Received: from flashheart.burtonini.com (home.burtonini.com. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id 185sm7228710wmn.33.2017.07.13.10.48.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 10:48:24 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Thu, 13 Jul 2017 18:48:21 +0100 Message-Id: <20170713174821.20071-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH][pyro] libgcrypt: fix CVE-2017-9526 X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org In libgcrypt before 1.7.7, an attacker who learns the EdDSA session key (from side-channel observation during the signing process) can easily recover the long-term secret key. 1.7.7 makes a cipher/ecc-eddsa.c change to store this session key in secure memory, to ensure that constant-time point operations are used in the MPI library. Signed-off-by: Ross Burton --- ...-Store-EdDSA-session-key-in-secure-memory.patch | 39 ++++++++++++++++++++++ meta/recipes-support/libgcrypt/libgcrypt.inc | 1 + 2 files changed, 40 insertions(+) create mode 100644 meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch b/meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch new file mode 100644 index 00000000000..0a4dfe67737 --- /dev/null +++ b/meta/recipes-support/libgcrypt/files/0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch @@ -0,0 +1,39 @@ +CVE: CVE-2017-9526 +Upstream-Status: Backport +Signed-off-by: Ross Burton + +From 4a1768d683f6572ad86d833508c70e6b3dc1efdc Mon Sep 17 00:00:00 2001 +From: Jo Van Bulck +Date: Thu, 19 Jan 2017 17:00:15 +0100 +Subject: [PATCH] ecc: Store EdDSA session key in secure memory. + +* cipher/ecc-eddsa.c (_gcry_ecc_eddsa_sign): use mpi_snew to allocate +session key. +-- + +An attacker who learns the EdDSA session key from side-channel +observation during the signing process, can easily revover the long- +term secret key. Storing the session key in secure memory ensures that +constant time point operations are used in the MPI library. + +Signed-off-by: Jo Van Bulck +--- + cipher/ecc-eddsa.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cipher/ecc-eddsa.c b/cipher/ecc-eddsa.c +index f91f8489..813e030d 100644 +--- a/cipher/ecc-eddsa.c ++++ b/cipher/ecc-eddsa.c +@@ -603,7 +603,7 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey, + a = mpi_snew (0); + x = mpi_new (0); + y = mpi_new (0); +- r = mpi_new (0); ++ r = mpi_snew (0); + ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect, 0, + skey->E.p, skey->E.a, skey->E.b); + b = (ctx->nbits+7)/8; +-- +2.11.0 + diff --git a/meta/recipes-support/libgcrypt/libgcrypt.inc b/meta/recipes-support/libgcrypt/libgcrypt.inc index 84c1cc018b3..e95c059c875 100644 --- a/meta/recipes-support/libgcrypt/libgcrypt.inc +++ b/meta/recipes-support/libgcrypt/libgcrypt.inc @@ -20,6 +20,7 @@ SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.gz \ file://libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \ file://fix-ICE-failure-on-mips-with-option-O-and-g.patch \ file://fix-undefined-reference-to-pthread.patch \ + file://0001-ecc-Store-EdDSA-session-key-in-secure-memory.patch \ " BINCONFIG = "${bindir}/libgcrypt-config"