Skip to content

Commit d6e9f67

Browse files
committed
Sync with 2.33.8
* maint-2.33: (27 commits) Git 2.33.8 Git 2.32.7 Git 2.31.8 tests: avoid using `test_i18ncmp` Git 2.30.9 gettext: avoid using gettext if the locale dir is not present apply --reject: overwrite existing `.rej` symlink if it exists http.c: clear the 'finished' member once we are done with it clone.c: avoid "exceeds maximum object size" error with GCC v12.x range-diff: use ssize_t for parsed "len" in read_patches() range-diff: handle unterminated lines in read_patches() range-diff: drop useless "offset" variable from read_patches() t5604: GETTEXT_POISON fix, conclusion t5604: GETTEXT_POISON fix, part 1 t5619: GETTEXT_POISON fix t0003: GETTEXT_POISON fix, conclusion t0003: GETTEXT_POISON fix, part 1 t0033: GETTEXT_POISON fix http: support CURLOPT_PROTOCOLS_STR http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT ...
2 parents 91da4a2 + 3a19048 commit d6e9f67

File tree

18 files changed

+211
-32
lines changed

18 files changed

+211
-32
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ jobs:
221221
pool: ubuntu-latest
222222
- jobname: linux-gcc
223223
cc: gcc
224-
pool: ubuntu-latest
224+
pool: ubuntu-20.04
225225
- jobname: osx-clang
226226
cc: clang
227227
pool: macos-latest
@@ -284,7 +284,7 @@ jobs:
284284
if: needs.ci-config.outputs.enabled == 'yes'
285285
env:
286286
jobname: StaticAnalysis
287-
runs-on: ubuntu-18.04
287+
runs-on: ubuntu-22.04
288288
steps:
289289
- uses: actions/checkout@v2
290290
- run: ci/install-dependencies.sh

Documentation/RelNotes/2.30.9.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Git v2.30.9 Release Notes
2+
=========================
3+
4+
This release addresses the security issues CVE-2023-25652,
5+
CVE-2023-25815, and CVE-2023-29007.
6+
7+
8+
Fixes since v2.30.8
9+
-------------------
10+
11+
* CVE-2023-25652:
12+
13+
By feeding specially crafted input to `git apply --reject`, a
14+
path outside the working tree can be overwritten with partially
15+
controlled contents (corresponding to the rejected hunk(s) from
16+
the given patch).
17+
18+
* CVE-2023-25815:
19+
20+
When Git is compiled with runtime prefix support and runs without
21+
translated messages, it still used the gettext machinery to
22+
display messages, which subsequently potentially looked for
23+
translated messages in unexpected places. This allowed for
24+
malicious placement of crafted messages.
25+
26+
* CVE-2023-29007:
27+
28+
When renaming or deleting a section from a configuration file,
29+
certain malicious configuration values may be misinterpreted as
30+
the beginning of a new configuration section, leading to arbitrary
31+
configuration injection.
32+
33+
Credit for finding CVE-2023-25652 goes to Ry0taK, and the fix was
34+
developed by Taylor Blau, Junio C Hamano and Johannes Schindelin,
35+
with the help of Linus Torvalds.
36+
37+
Credit for finding CVE-2023-25815 goes to Maxime Escourbiac and
38+
Yassine BENGANA of Michelin, and the fix was developed by Johannes
39+
Schindelin.
40+
41+
Credit for finding CVE-2023-29007 goes to André Baptista and Vítor Pinho
42+
of Ethiack, and the fix was developed by Taylor Blau, and Johannes
43+
Schindelin, with help from Jeff King, and Patrick Steinhardt.

Documentation/RelNotes/2.31.8.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Git v2.31.8 Release Notes
2+
=========================
3+
4+
This release merges the fixes that appear in v2.30.9 to address the
5+
security issues CVE-2023-25652, CVE-2023-25815, and CVE-2023-29007;
6+
see the release notes for that version for details.

Documentation/RelNotes/2.32.7.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Git v2.32.7 Release Notes
2+
=========================
3+
4+
This release merges the fixes that appear in v2.30.9 and v2.31.8 to
5+
address the security issues CVE-2023-25652, CVE-2023-25815, and
6+
CVE-2023-29007; see the release notes for these versions for
7+
details.

Documentation/RelNotes/2.33.8.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Git v2.33.8 Release Notes
2+
=========================
3+
4+
This release merges the fixes that appear in v2.30.9, v2.31.8 and
5+
v2.32.7 to address the security issues CVE-2023-25652,
6+
CVE-2023-25815, and CVE-2023-29007; see the release notes for these
7+
versions for details.

apply.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4582,7 +4582,7 @@ static int write_out_one_reject(struct apply_state *state, struct patch *patch)
45824582
FILE *rej;
45834583
char namebuf[PATH_MAX];
45844584
struct fragment *frag;
4585-
int cnt = 0;
4585+
int fd, cnt = 0;
45864586
struct strbuf sb = STRBUF_INIT;
45874587

45884588
for (cnt = 0, frag = patch->fragments; frag; frag = frag->next) {
@@ -4622,7 +4622,17 @@ static int write_out_one_reject(struct apply_state *state, struct patch *patch)
46224622
memcpy(namebuf, patch->new_name, cnt);
46234623
memcpy(namebuf + cnt, ".rej", 5);
46244624

4625-
rej = fopen(namebuf, "w");
4625+
fd = open(namebuf, O_CREAT | O_EXCL | O_WRONLY, 0666);
4626+
if (fd < 0) {
4627+
if (errno != EEXIST)
4628+
return error_errno(_("cannot open %s"), namebuf);
4629+
if (unlink(namebuf))
4630+
return error_errno(_("cannot unlink '%s'"), namebuf);
4631+
fd = open(namebuf, O_CREAT | O_EXCL | O_WRONLY, 0666);
4632+
if (fd < 0)
4633+
return error_errno(_("cannot open %s"), namebuf);
4634+
}
4635+
rej = fdopen(fd, "w");
46264636
if (!rej)
46274637
return error_errno(_("cannot open %s"), namebuf);
46284638

ci/install-dependencies.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
. ${0%/*}/lib.sh
77

8-
P4WHENCE=http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION
8+
P4WHENCE=https://cdist2.perforce.com/perforce/r21.2
99
LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
1010
UBUNTU_COMMON_PKGS="make libssl-dev libcurl4-openssl-dev libexpat-dev
1111
tcl tk gettext zlib1g-dev perl-modules liberror-perl libauthen-sasl-perl
@@ -16,7 +16,7 @@ linux-clang|linux-gcc|linux-leaks)
1616
sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
1717
sudo apt-get -q update
1818
sudo apt-get -q -y install language-pack-is libsvn-perl apache2 \
19-
$UBUNTU_COMMON_PKGS
19+
$UBUNTU_COMMON_PKGS $PYTHON_PACKAGE
2020
case "$jobname" in
2121
linux-gcc)
2222
sudo apt-get -q -y install gcc-8
@@ -44,13 +44,15 @@ osx-clang|osx-gcc)
4444
test -z "$BREW_INSTALL_PACKAGES" ||
4545
brew install $BREW_INSTALL_PACKAGES
4646
brew link --force gettext
47-
brew install --cask --no-quarantine perforce || {
48-
# Update the definitions and try again
49-
cask_repo="$(brew --repository)"/Library/Taps/homebrew/homebrew-cask &&
50-
git -C "$cask_repo" pull --no-stat --ff-only &&
51-
brew install --cask --no-quarantine perforce
52-
} ||
53-
brew install homebrew/cask/perforce
47+
mkdir -p $HOME/bin
48+
(
49+
cd $HOME/bin
50+
wget -q "$P4WHENCE/bin.macosx1015x86_64/helix-core-server.tgz" &&
51+
tar -xf helix-core-server.tgz &&
52+
sudo xattr -d com.apple.quarantine p4 p4d 2>/dev/null || true
53+
)
54+
PATH="$PATH:${HOME}/bin"
55+
export PATH
5456
case "$jobname" in
5557
osx-gcc)
5658
brew install gcc@9
@@ -86,9 +88,9 @@ esac
8688
if type p4d >/dev/null && type p4 >/dev/null
8789
then
8890
echo "$(tput setaf 6)Perforce Server Version$(tput sgr0)"
89-
p4d -V | grep Rev.
91+
p4d -V
9092
echo "$(tput setaf 6)Perforce Client Version$(tput sgr0)"
91-
p4 -V | grep Rev.
93+
p4 -V
9294
fi
9395
if type git-lfs >/dev/null
9496
then

ci/lib.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ export SKIP_DASHED_BUILT_INS=YesPlease
184184

185185
case "$jobname" in
186186
linux-clang|linux-gcc|linux-leaks)
187+
PYTHON_PACKAGE=python2
187188
if [ "$jobname" = linux-gcc ]
188189
then
189190
export CC=gcc-8
190-
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python3"
191-
else
192-
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/python2"
191+
PYTHON_PACKAGE=python3
193192
fi
193+
MAKEFLAGS="$MAKEFLAGS PYTHON_PATH=/usr/bin/$PYTHON_PACKAGE"
194194

195195
export GIT_TEST_HTTPD=true
196196

@@ -199,7 +199,6 @@ linux-clang|linux-gcc|linux-leaks)
199199
# were recorded in the Homebrew database upon creating the OS X
200200
# image.
201201
# Keep that in mind when you encounter a broken OS X build!
202-
export LINUX_P4_VERSION="16.2"
203202
export LINUX_GIT_LFS_VERSION="1.5.2"
204203

205204
P4_PATH="$HOME/custom/p4"

compat/nedmalloc/nedmalloc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ static NOINLINE void RemoveCacheEntries(nedpool *p, threadcache *tc, unsigned in
323323
}
324324
static void DestroyCaches(nedpool *p) THROWSPEC
325325
{
326-
if(p->caches)
327326
{
328327
threadcache *tc;
329328
int n;

compat/win32/syslog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ void syslog(int priority, const char *fmt, ...)
4343
va_end(ap);
4444

4545
while ((pos = strstr(str, "%1")) != NULL) {
46+
size_t offset = pos - str;
4647
char *oldstr = str;
4748
str = realloc(str, st_add(++str_len, 1));
4849
if (!str) {
4950
free(oldstr);
5051
warning_errno("realloc failed");
5152
return;
5253
}
54+
pos = str + offset;
5355
memmove(pos + 2, pos + 1, strlen(pos));
5456
pos[1] = ' ';
5557
}

0 commit comments

Comments
 (0)