Browse code

git: update to version 2.26.2, Fix CVE-2020-11008

Change-Id: Ia4f9c73b4ff55b00b967d742015b4cc88aca7068
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/10130
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Tapas Kundu <tkundu@vmware.com>

Prashant Singh Chauhan authored on 2020/05/20 01:00:29
Showing 2 changed files
1 1
deleted file mode 100644
... ...
@@ -1,58 +0,0 @@
1
-From 9a6bbee8006c24b46a85d29e7b38cfa79e9ab21b Mon Sep 17 00:00:00 2001
2
-From: Jeff King <peff@peff.net>
3
-Date: Wed, 11 Mar 2020 17:53:41 -0400
4
-Subject: [PATCH] credential: avoid writing values with newlines
5
-
6
-The credential protocol that we use to speak to helpers can't represent
7
-values with newlines in them. This was an intentional design choice to
8
-keep the protocol simple, since none of the values we pass should
9
-generally have newlines.
10
-
11
-However, if we _do_ encounter a newline in a value, we blindly transmit
12
-it in credential_write(). Such values may break the protocol syntax, or
13
-worse, inject new valid lines into the protocol stream.
14
-
15
-The most likely way for a newline to end up in a credential struct is by
16
-decoding a URL with a percent-encoded newline. However, since the bug
17
-occurs at the moment we write the value to the protocol, we'll catch it
18
-there. That should leave no possibility of accidentally missing a code
19
-path that can trigger the problem.
20
-
21
-At this level of the code we have little choice but to die(). However,
22
-since we'd not ever expect to see this case outside of a malicious URL,
23
-that's an acceptable outcome.
24
-
25
-Reported-by: Felix Wilhelm <fwilhelm@google.com>
26
- credential.c           | 2 ++
27
- t/t0300-credentials.sh | 6 ++++++
28
- 2 files changed, 8 insertions(+)
29
-
30
-diff --git a/credential.c b/credential.c
31
-index 9747f47b18bf2..00ee4d62db121 100644
32
-+++ b/credential.c
33
-@@ -194,6 +194,8 @@ static void credential_write_item(FILE *fp, const char *key, const char *value)
34
- {
35
- 	if (!value)
36
- 		return;
37
-+	if (strchr(value, '\n'))
38
-+		die("credential value for %s contains newline", key);
39
- 	fprintf(fp, "%s=%s\n", key, value);
40
- }
41
- 
42
-diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
43
-index 03bd31e9f22a1..15cc3c5abb5b1 100755
44
-+++ b/t/t0300-credentials.sh
45
-@@ -309,4 +309,10 @@ test_expect_success 'empty helper spec resets helper list' '
46
- 	EOF
47
- '
48
- 
49
-+test_expect_success 'url parser rejects embedded newlines' '
50
-+	test_must_fail git credential fill <<-\EOF
51
-+	url=https://one.example.com?%0ahost=two.example.com/
52
-+	EOF
53
-+'
54
-+
55
- test_done
... ...
@@ -1,15 +1,14 @@
1 1
 Summary:        Fast distributed version control system
2 2
 Name:           git
3
-Version:        2.26.0
4
-Release:        2%{?dist}
3
+Version:        2.26.2
4
+Release:        1%{?dist}
5 5
 License:        GPLv2
6 6
 URL:            http://git-scm.com/
7 7
 Group:          System Environment/Programming
8 8
 Vendor:         VMware, Inc.
9 9
 Distribution:   Photon
10 10
 Source0:        https://www.kernel.org/pub/software/scm/git/%{name}-%{version}.tar.xz
11
-%define sha1    git=1580df90eecae21664646ac6eb7eba4af4934fe4
12
-Patch0:         CVE-2020-5260.patch
11
+%define sha1    git=bdb5eb6c014d7c372be70782a5155d964abe2c08
13 12
 BuildRequires:  curl-devel
14 13
 BuildRequires:  python2
15 14
 BuildRequires:  openssl-devel
... ...
@@ -42,7 +41,6 @@ These are the additional language files of git.
42 42
 
43 43
 %prep
44 44
 %setup -q
45
-%patch0 -p1
46 45
 %build
47 46
 %configure \
48 47
     CFLAGS="%{optflags}" \
... ...
@@ -93,6 +91,8 @@ rm -rf %{buildroot}/*
93 93
 %defattr(-,root,root)
94 94
 
95 95
 %changelog
96
+*   Tue May 19 2020 Prashant S Chauhan <psinghchauhan@vmware.com> 2.26.2-1
97
+-   Updated to version 2.26.2, fix CVE-2020-11008, CVE-2020-5260
96 98
 *   Mon Apr 27 2020 Prashant S Chauhan <psinghchauha@vmware.com> 2.26.0-2
97 99
 -   Added patch, Fixes CVE-2020-5260
98 100
 *   Wed Apr 01 2020 Susant Sahani <ssahani@vmware.com> 2.26.0-1