diff options
Diffstat (limited to 'meta/recipes-devtools/go/go-1.14/CVE-2023-29404.patch')
-rw-r--r-- | meta/recipes-devtools/go/go-1.14/CVE-2023-29404.patch | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.14/CVE-2023-29404.patch b/meta/recipes-devtools/go/go-1.14/CVE-2023-29404.patch new file mode 100644 index 0000000000..61336ee9ee --- /dev/null +++ b/meta/recipes-devtools/go/go-1.14/CVE-2023-29404.patch | |||
@@ -0,0 +1,84 @@ | |||
1 | From bf3c8ce03e175e870763901a3850bca01381a828 Mon Sep 17 00:00:00 2001 | ||
2 | From: Roland Shoemaker <bracewell@google.com> | ||
3 | Date: Fri, 5 May 2023 13:10:34 -0700 | ||
4 | Subject: [PATCH] [release-branch.go1.19] cmd/go: enforce flags with | ||
5 | non-optional arguments | ||
6 | |||
7 | Enforce that linker flags which expect arguments get them, otherwise it | ||
8 | may be possible to smuggle unexpected flags through as the linker can | ||
9 | consume what looks like a flag as an argument to a preceding flag (i.e. | ||
10 | "-Wl,-O -Wl,-R,-bad-flag" is interpreted as "-O=-R -bad-flag"). Also be | ||
11 | somewhat more restrictive in the general format of some flags. | ||
12 | |||
13 | Thanks to Juho Nurminen of Mattermost for reporting this issue. | ||
14 | |||
15 | Updates #60305 | ||
16 | Fixes #60511 | ||
17 | Fixes CVE-2023-29404 | ||
18 | |||
19 | Change-Id: Icdffef2c0f644da50261cace6f43742783931cff | ||
20 | Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1876275 | ||
21 | Reviewed-by: Ian Lance Taylor <iant@google.com> | ||
22 | Reviewed-by: Damien Neil <dneil@google.com> | ||
23 | (cherry picked from commit 896779503cf754cbdac24b61d4cc953b50fe2dde) | ||
24 | Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1902225 | ||
25 | Run-TryBot: Roland Shoemaker <bracewell@google.com> | ||
26 | Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1904342 | ||
27 | Reviewed-by: Michael Knyszek <mknyszek@google.com> | ||
28 | Reviewed-on: https://go-review.googlesource.com/c/go/+/501217 | ||
29 | Auto-Submit: Michael Knyszek <mknyszek@google.com> | ||
30 | Run-TryBot: David Chase <drchase@google.com> | ||
31 | TryBot-Bypass: Michael Knyszek <mknyszek@google.com> | ||
32 | |||
33 | Upstream-Status: Backport [https://github.com/golang/go/commit/bf3c8ce03e175e870763901a3850bca01381a828] | ||
34 | CVE: CVE-2023-29404 | ||
35 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
36 | --- | ||
37 | src/cmd/go/internal/work/security.go | 6 +++--- | ||
38 | src/cmd/go/internal/work/security_test.go | 5 +++++ | ||
39 | 2 files changed, 8 insertions(+), 3 deletions(-) | ||
40 | |||
41 | diff --git a/src/cmd/go/internal/work/security.go b/src/cmd/go/internal/work/security.go | ||
42 | index a823b20..8acb6dc 100644 | ||
43 | --- a/src/cmd/go/internal/work/security.go | ||
44 | +++ b/src/cmd/go/internal/work/security.go | ||
45 | @@ -177,17 +177,17 @@ var validLinkerFlags = []*lazyregexp.Regexp{ | ||
46 | re(`-Wl,-Bdynamic`), | ||
47 | re(`-Wl,-berok`), | ||
48 | re(`-Wl,-Bstatic`), | ||
49 | - re(`-WL,-O([^@,\-][^,]*)?`), | ||
50 | + re(`-Wl,-O[0-9]+`), | ||
51 | re(`-Wl,-d[ny]`), | ||
52 | re(`-Wl,--disable-new-dtags`), | ||
53 | - re(`-Wl,-e[=,][a-zA-Z0-9]*`), | ||
54 | + re(`-Wl,-e[=,][a-zA-Z0-9]+`), | ||
55 | re(`-Wl,--enable-new-dtags`), | ||
56 | re(`-Wl,--end-group`), | ||
57 | re(`-Wl,--(no-)?export-dynamic`), | ||
58 | re(`-Wl,-framework,[^,@\-][^,]+`), | ||
59 | re(`-Wl,-headerpad_max_install_names`), | ||
60 | re(`-Wl,--no-undefined`), | ||
61 | - re(`-Wl,-R([^@\-][^,@]*$)`), | ||
62 | + re(`-Wl,-R,?([^@\-,][^,@]*$)`), | ||
63 | re(`-Wl,--just-symbols[=,]([^,@\-][^,@]+)`), | ||
64 | re(`-Wl,-rpath(-link)?[=,]([^,@\-][^,]+)`), | ||
65 | re(`-Wl,-s`), | ||
66 | diff --git a/src/cmd/go/internal/work/security_test.go b/src/cmd/go/internal/work/security_test.go | ||
67 | index bd707ff..7b0b7d3 100644 | ||
68 | --- a/src/cmd/go/internal/work/security_test.go | ||
69 | +++ b/src/cmd/go/internal/work/security_test.go | ||
70 | @@ -220,6 +220,11 @@ var badLinkerFlags = [][]string{ | ||
71 | {"-Wl,-R,@foo"}, | ||
72 | {"-Wl,--just-symbols,@foo"}, | ||
73 | {"../x.o"}, | ||
74 | + {"-Wl,-R,"}, | ||
75 | + {"-Wl,-O"}, | ||
76 | + {"-Wl,-e="}, | ||
77 | + {"-Wl,-e,"}, | ||
78 | + {"-Wl,-R,-flag"}, | ||
79 | } | ||
80 | |||
81 | func TestCheckLinkerFlags(t *testing.T) { | ||
82 | -- | ||
83 | 2.25.1 | ||
84 | |||