diff options
Diffstat (limited to 'meta/recipes-devtools/git/git-2.3.0/CVE-2015-7545_5.patch')
-rw-r--r-- | meta/recipes-devtools/git/git-2.3.0/CVE-2015-7545_5.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/meta/recipes-devtools/git/git-2.3.0/CVE-2015-7545_5.patch b/meta/recipes-devtools/git/git-2.3.0/CVE-2015-7545_5.patch new file mode 100644 index 0000000000..32dfbaedbe --- /dev/null +++ b/meta/recipes-devtools/git/git-2.3.0/CVE-2015-7545_5.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From b258116462399b318c86165c61a5c7123043cfd4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Blake Burkhart <bburky@bburky.com> | ||
3 | Date: Tue, 22 Sep 2015 18:06:20 -0400 | ||
4 | Subject: [PATCH] http: limit redirection depth | ||
5 | |||
6 | By default, libcurl will follow circular http redirects | ||
7 | forever. Let's put a cap on this so that somebody who can | ||
8 | trigger an automated fetch of an arbitrary repository (e.g., | ||
9 | for CI) cannot convince git to loop infinitely. | ||
10 | |||
11 | The value chosen is 20, which is the same default that | ||
12 | Firefox uses. | ||
13 | |||
14 | Signed-off-by: Jeff King <peff@peff.net> | ||
15 | Signed-off-by: Junio C Hamano <gitster@pobox.com> | ||
16 | |||
17 | Upstream-Status: Backport | ||
18 | https://kernel.googlesource.com/pub/scm/git/git/+/b258116462399b318c86165c61a5c7123043cfd4%5E%21/ | ||
19 | CVE: CVE-2015-7545 patch #1 | ||
20 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
21 | |||
22 | --- | ||
23 | http.c | 1 + | ||
24 | t/lib-httpd/apache.conf | 3 +++ | ||
25 | t/t5812-proto-disable-http.sh | 4 ++++ | ||
26 | 3 files changed, 8 insertions(+) | ||
27 | |||
28 | Index: git-2.3.0/http.c | ||
29 | =================================================================== | ||
30 | --- git-2.3.0.orig/http.c | ||
31 | +++ git-2.3.0/http.c | ||
32 | @@ -349,6 +349,7 @@ static CURL *get_curl_handle(void) | ||
33 | } | ||
34 | |||
35 | curl_easy_setopt(result, CURLOPT_FOLLOWLOCATION, 1); | ||
36 | + curl_easy_setopt(result, CURLOPT_MAXREDIRS, 20); | ||
37 | #if LIBCURL_VERSION_NUM >= 0x071301 | ||
38 | curl_easy_setopt(result, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL); | ||
39 | #elif LIBCURL_VERSION_NUM >= 0x071101 | ||
40 | Index: git-2.3.0/t/lib-httpd/apache.conf | ||
41 | =================================================================== | ||
42 | --- git-2.3.0.orig/t/lib-httpd/apache.conf | ||
43 | +++ git-2.3.0/t/lib-httpd/apache.conf | ||
44 | @@ -120,6 +120,9 @@ RewriteRule ^/smart-redir-auth/(.*)$ /au | ||
45 | RewriteRule ^/smart-redir-limited/(.*)/info/refs$ /smart/$1/info/refs [R=301] | ||
46 | RewriteRule ^/ftp-redir/(.*)$ ftp://localhost:1000/$1 [R=302] | ||
47 | |||
48 | +RewriteRule ^/loop-redir/x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-(.*) /$1 [R=302] | ||
49 | +RewriteRule ^/loop-redir/(.*)$ /loop-redir/x-$1 [R=302] | ||
50 | + | ||
51 | <IfDefine SSL> | ||
52 | LoadModule ssl_module modules/mod_ssl.so | ||
53 | |||
54 | Index: git-2.3.0/t/t5812-proto-disable-http.sh | ||
55 | =================================================================== | ||
56 | --- git-2.3.0.orig/t/t5812-proto-disable-http.sh | ||
57 | +++ git-2.3.0/t/t5812-proto-disable-http.sh | ||
58 | @@ -25,5 +25,9 @@ test_expect_success 'curl redirects resp | ||
59 | } | ||
60 | ' | ||
61 | |||
62 | +test_expect_success 'curl limits redirects' ' | ||
63 | + test_must_fail git clone "$HTTPD_URL/loop-redir/smart/repo.git" | ||
64 | +' | ||
65 | + | ||
66 | stop_httpd | ||
67 | test_done | ||