summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2020-01-17 17:14:32 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-28 11:15:01 (GMT)
commit47de27d7344b07be8f6a6b48f92e6a47bb65a936 (patch)
tree2703f49e7c713170eabf62069a4d108acb22a546
parentd8da51bd3b84791d181a2844efe00d4bf2cdb02c (diff)
downloadpoky-47de27d7344b07be8f6a6b48f92e6a47bb65a936.tar.gz
go: fix CVE-2019-17596
https://github.com/golang/go/commit/2017d88dbc096381d4f348d2fb08bfb3c2b7ed73 (From OE-Core rev: a8adb7d23172acb587c259a28aa0c9e2df83f228) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/go/go-1.12.inc1
-rw-r--r--meta/recipes-devtools/go/go-1.12/0010-fix-CVE-2019-17596.patch42
2 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.12.inc b/meta/recipes-devtools/go/go-1.12.inc
index ed14b17..6aecaad 100644
--- a/meta/recipes-devtools/go/go-1.12.inc
+++ b/meta/recipes-devtools/go/go-1.12.inc
@@ -17,6 +17,7 @@ SRC_URI += "\
17 file://0007-cmd-go-make-GOROOT-precious-by-default.patch \ 17 file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
18 file://0008-use-GOBUILDMODE-to-set-buildmode.patch \ 18 file://0008-use-GOBUILDMODE-to-set-buildmode.patch \
19 file://0001-release-branch.go1.12-security-net-textproto-don-t-n.patch \ 19 file://0001-release-branch.go1.12-security-net-textproto-don-t-n.patch \
20 file://0010-fix-CVE-2019-17596.patch \
20" 21"
21SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch" 22SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
22 23
diff --git a/meta/recipes-devtools/go/go-1.12/0010-fix-CVE-2019-17596.patch b/meta/recipes-devtools/go/go-1.12/0010-fix-CVE-2019-17596.patch
new file mode 100644
index 0000000..134cfab
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.12/0010-fix-CVE-2019-17596.patch
@@ -0,0 +1,42 @@
1From f1783e1ce44a86c000a7c380a57a805c89c3efbe Mon Sep 17 00:00:00 2001
2From: Katie Hockman <katie@golang.org>
3Date: Mon, 14 Oct 2019 16:42:21 -0400
4Subject: [PATCH] crypto/dsa: prevent bad public keys from causing panic
5
6dsa.Verify might currently use a nil s inverse in a
7multiplication if the public key contains a non-prime Q,
8causing a panic. Change this to check that the mod
9inverse exists before using it.
10
11Fixes CVE-2019-17596
12
13Change-Id: I94d5f3cc38f1b5d52d38dcb1d253c71b7fd1cae7
14Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/572809
15Reviewed-by: Filippo Valsorda <valsorda@google.com>
16(cherry picked from commit 9119dfb0511326d4485b248b83d4fde19c95d0f7)
17Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/575232
18
19CVE: CVE-2019-17596
20Upstream-Status: Backport [https://github.com/golang/go/commit/2017d88dbc096381d4f348d2fb08bfb3c2b7ed73]
21Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
22---
23 src/crypto/dsa/dsa.go | 3 +++
24 1 file changed, 3 insertions(+)
25
26diff --git a/src/crypto/dsa/dsa.go b/src/crypto/dsa/dsa.go
27index 575314b..2fc4f1f 100644
28--- a/src/crypto/dsa/dsa.go
29+++ b/src/crypto/dsa/dsa.go
30@@ -279,6 +279,9 @@ func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool {
31 }
32
33 w := new(big.Int).ModInverse(s, pub.Q)
34+ if w == nil {
35+ return false
36+ }
37
38 n := pub.Q.BitLen()
39 if n&7 != 0 {
40--
412.23.0
42