diff options
author | Hitendra Prajapati <hprajapati@mvista.com> | 2022-09-29 18:09:36 +0530 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-09-30 16:34:52 +0100 |
commit | 95ba88b93546bbea9dd958b3d02c937835c4f9ce (patch) | |
tree | b717ab00d095b26fd825bdc9d479ab4991cfa386 /meta | |
parent | f50439feb5bd5bb9ff45048f208be5120855a622 (diff) | |
download | poky-95ba88b93546bbea9dd958b3d02c937835c4f9ce.tar.gz |
golang: CVE-2022-27664 net/http: handle server errors after sending GOAWAY
Source: https://github.com/golang/go
MR: 121912
Type: Security Fix
Disposition: Backport from https://github.com/golang/go/commit/5bc9106458fc07851ac324a4157132a91b1f3479
ChangeID: 0b76a92a774279d7bffc9d6fa05564dfd8371e8c
Description:
CVE-2022-27664 golang: net/http: handle server errors after sending GOAWAY.
(From OE-Core rev: 4e2f723a4288ad4839fac2769e487612252b1d40)
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/go/go-1.14.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-1.14/CVE-2022-27664.patch | 68 |
2 files changed, 69 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.14.inc b/meta/recipes-devtools/go/go-1.14.inc index af6345205e..540ea4e62d 100644 --- a/meta/recipes-devtools/go/go-1.14.inc +++ b/meta/recipes-devtools/go/go-1.14.inc | |||
@@ -36,6 +36,7 @@ SRC_URI += "\ | |||
36 | file://CVE-2021-36221.patch \ | 36 | file://CVE-2021-36221.patch \ |
37 | file://CVE-2021-39293.patch \ | 37 | file://CVE-2021-39293.patch \ |
38 | file://CVE-2021-41771.patch \ | 38 | file://CVE-2021-41771.patch \ |
39 | file://CVE-2022-27664.patch \ | ||
39 | " | 40 | " |
40 | 41 | ||
41 | SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch" | 42 | SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch" |
diff --git a/meta/recipes-devtools/go/go-1.14/CVE-2022-27664.patch b/meta/recipes-devtools/go/go-1.14/CVE-2022-27664.patch new file mode 100644 index 0000000000..238c3eac5b --- /dev/null +++ b/meta/recipes-devtools/go/go-1.14/CVE-2022-27664.patch | |||
@@ -0,0 +1,68 @@ | |||
1 | From 48c9076dcfc2dc894842ff758c8cfae7957c9565 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hitendra Prajapati <hprajapati@mvista.com> | ||
3 | Date: Thu, 29 Sep 2022 17:06:18 +0530 | ||
4 | Subject: [PATCH] CVE-2022-27664 | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/golang/go/commit/5bc9106458fc07851ac324a4157132a91b1f3479] | ||
7 | CVE: CVE-2022-27664 | ||
8 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
9 | --- | ||
10 | src/net/http/h2_bundle.go | 21 +++++++++++++-------- | ||
11 | 1 file changed, 13 insertions(+), 8 deletions(-) | ||
12 | |||
13 | diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go | ||
14 | index 65d851d..83f2a72 100644 | ||
15 | --- a/src/net/http/h2_bundle.go | ||
16 | +++ b/src/net/http/h2_bundle.go | ||
17 | @@ -3254,10 +3254,11 @@ var ( | ||
18 | // name (key). See httpguts.ValidHeaderName for the base rules. | ||
19 | // | ||
20 | // Further, http2 says: | ||
21 | -// "Just as in HTTP/1.x, header field names are strings of ASCII | ||
22 | -// characters that are compared in a case-insensitive | ||
23 | -// fashion. However, header field names MUST be converted to | ||
24 | -// lowercase prior to their encoding in HTTP/2. " | ||
25 | +// | ||
26 | +// "Just as in HTTP/1.x, header field names are strings of ASCII | ||
27 | +// characters that are compared in a case-insensitive | ||
28 | +// fashion. However, header field names MUST be converted to | ||
29 | +// lowercase prior to their encoding in HTTP/2. " | ||
30 | func http2validWireHeaderFieldName(v string) bool { | ||
31 | if len(v) == 0 { | ||
32 | return false | ||
33 | @@ -3446,8 +3447,8 @@ func (s *http2sorter) SortStrings(ss []string) { | ||
34 | // validPseudoPath reports whether v is a valid :path pseudo-header | ||
35 | // value. It must be either: | ||
36 | // | ||
37 | -// *) a non-empty string starting with '/' | ||
38 | -// *) the string '*', for OPTIONS requests. | ||
39 | +// *) a non-empty string starting with '/' | ||
40 | +// *) the string '*', for OPTIONS requests. | ||
41 | // | ||
42 | // For now this is only used a quick check for deciding when to clean | ||
43 | // up Opaque URLs before sending requests from the Transport. | ||
44 | @@ -4897,6 +4898,9 @@ func (sc *http2serverConn) startGracefulShutdownInternal() { | ||
45 | func (sc *http2serverConn) goAway(code http2ErrCode) { | ||
46 | sc.serveG.check() | ||
47 | if sc.inGoAway { | ||
48 | + if sc.goAwayCode == http2ErrCodeNo { | ||
49 | + sc.goAwayCode = code | ||
50 | + } | ||
51 | return | ||
52 | } | ||
53 | sc.inGoAway = true | ||
54 | @@ -6091,8 +6095,9 @@ func (rws *http2responseWriterState) writeChunk(p []byte) (n int, err error) { | ||
55 | // prior to the headers being written. If the set of trailers is fixed | ||
56 | // or known before the header is written, the normal Go trailers mechanism | ||
57 | // is preferred: | ||
58 | -// https://golang.org/pkg/net/http/#ResponseWriter | ||
59 | -// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers | ||
60 | +// | ||
61 | +// https://golang.org/pkg/net/http/#ResponseWriter | ||
62 | +// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers | ||
63 | const http2TrailerPrefix = "Trailer:" | ||
64 | |||
65 | // promoteUndeclaredTrailers permits http.Handlers to set trailers | ||
66 | -- | ||
67 | 2.25.1 | ||
68 | |||