From 83ca71dc73f5fc3de48e01d432a0ceec458a837c Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Fri, 29 May 2020 15:56:45 -0400 Subject: [PATCH] revert to protocol v0 by default The default fetch protocol was changed to v2 in 2.26.0. Subsequently, users of the linux-next and other kernel repositories have reported significantly higher than expected sizes when fetching. The cause was tracked down and 2.27.0 will include a fix this issue. Revert the protocol v0 by default in 2.26.0 using the patch from Jonathan Nieder. References: https://github.com/git/git/commit/11c7f2a30b https://lore.kernel.org/git/20200422084254.GA27502@furthur.local/ --- ...-fetch-default-to-protocol-version-2.patch | 48 +++++++++++++++++++ git.spec | 9 +++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 0001-Revert-fetch-default-to-protocol-version-2.patch diff --git a/0001-Revert-fetch-default-to-protocol-version-2.patch b/0001-Revert-fetch-default-to-protocol-version-2.patch new file mode 100644 index 0000000..3efbbdf --- /dev/null +++ b/0001-Revert-fetch-default-to-protocol-version-2.patch @@ -0,0 +1,48 @@ +From 11c7f2a30b9dadcccc7bde66a34e0cb0cb5cf52c Mon Sep 17 00:00:00 2001 +From: Jonathan Nieder +Date: Wed, 22 Apr 2020 08:50:47 -0700 +Subject: [PATCH] Revert "fetch: default to protocol version 2" + +This reverts commit 684ceae32dae726c6a5c693b257b156926aba8b7. + +Users fetching from linux-next and other kernel remotes are reporting +that the limited ref advertisement causes negotiation to reach +MAX_IN_VAIN, resulting in too-large fetches. + +Reported-by: Lubomir Rintel +Reported-by: "Dixit, Ashutosh" +Reported-by: Jiri Slaby +Reported-by: Konstantin Ryabitsev +Signed-off-by: Jonathan Nieder +Signed-off-by: Junio C Hamano +--- + Documentation/config/protocol.txt | 2 +- + protocol.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Documentation/config/protocol.txt b/Documentation/config/protocol.txt +index 756591d77b080..0b40141613e3d 100644 +--- a/Documentation/config/protocol.txt ++++ b/Documentation/config/protocol.txt +@@ -48,7 +48,7 @@ protocol.version:: + If set, clients will attempt to communicate with a server + using the specified protocol version. If the server does + not support it, communication falls back to version 0. +- If unset, the default is `2`. ++ If unset, the default is `0`. + Supported versions: + + + -- +diff --git a/protocol.c b/protocol.c +index 803bef5c87e00..d390391ebac80 100644 +--- a/protocol.c ++++ b/protocol.c +@@ -39,7 +39,7 @@ enum protocol_version get_protocol_version_config(void) + return env; + } + +- return protocol_v2; ++ return protocol_v0; + } + + enum protocol_version determine_protocol_version_server(void) diff --git a/git.spec b/git.spec index bebca5a..c9412e4 100644 --- a/git.spec +++ b/git.spec @@ -85,7 +85,7 @@ Name: git Version: 2.26.2 -Release: 1%{?rcrev}%{?dist} +Release: 2%{?rcrev}%{?dist} Summary: Fast Version Control System License: GPLv2 URL: https://git-scm.com/ @@ -124,6 +124,10 @@ Patch1: 0001-sequencer-don-t-abbreviate-a-command-if-it-doesn-t-h.patch # https://github.com/git/git/commit/de9f1d3ef4 Patch2: 0002-t3432-test-merge-with-rebase.abbreviateCommands-true.patch +# Revert to protocol v0. Discussion in the thread starting at: +# https://lore.kernel.org/git/20200422084254.GA27502@furthur.local/ +Patch3: https://github.com/git/git/commit/11c7f2a30b.patch#/0001-Revert-fetch-default-to-protocol-version-2.patch + %if %{with docs} # pod2man is needed to build Git.3pm BuildRequires: %{_bindir}/pod2man @@ -1060,6 +1064,9 @@ rmdir --ignore-fail-on-non-empty "$testdir" %{?with_docs:%{_pkgdocdir}/git-svn.html} %changelog +* Fri May 29 2020 Todd Zullinger - 2.26.2-2 +- revert to protocol v0 by default + * Mon Apr 20 2020 Todd Zullinger - 2.26.2-1 - update to 2.26.2 (CVE-2020-11008)