summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/git/files/CVE-2018-11233.patch44
-rw-r--r--meta/recipes-devtools/git/git.inc3
2 files changed, 46 insertions, 1 deletions
diff --git a/meta/recipes-devtools/git/files/CVE-2018-11233.patch b/meta/recipes-devtools/git/files/CVE-2018-11233.patch
new file mode 100644
index 0000000000..f4468cf2fd
--- /dev/null
+++ b/meta/recipes-devtools/git/files/CVE-2018-11233.patch
@@ -0,0 +1,44 @@
1From 014281e62b7920a6d710a85089e00ca012b0744c Mon Sep 17 00:00:00 2001
2From: Jeff King <peff@peff.net>
3Date: Sun, 13 May 2018 12:09:42 -0400
4Subject: [PATCH] is_ntfs_dotgit: use a size_t for traversing string
5
6We walk through the "name" string using an int, which can
7wrap to a negative value and cause us to read random memory
8before our array (e.g., by creating a tree with a name >2GB,
9since "int" is still 32 bits even on most 64-bit platforms).
10Worse, this is easy to trigger during the fsck_tree() check,
11which is supposed to be protecting us from malicious
12garbage.
13
14Note one bit of trickiness in the existing code: we
15sometimes assign -1 to "len" at the end of the loop, and
16then rely on the "len++" in the for-loop's increment to take
17it back to 0. This is still legal with a size_t, since
18assigning -1 will turn into SIZE_MAX, which then wraps
19around to 0 on increment.
20
21Signed-off-by: Jeff King <peff@peff.net>
22CVE: CVE-2018-11233
23Upstream-Status: Backport[https://github.com/git/git/commit/11a9f4d807a0d71dc6eff51bb87baf4ca2cccf1d]
24Signed-off-by: Sinan Kaya <okaya@kernel.org>
25---
26 path.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29diff --git a/path.c b/path.c
30index da8b65573..d31c795ff 100644
31--- a/path.c
32+++ b/path.c
33@@ -1305,7 +1305,7 @@ static int only_spaces_and_periods(const char *path, size_t len, size_t skip)
34
35 int is_ntfs_dotgit(const char *name)
36 {
37- int len;
38+ size_t len;
39
40 for (len = 0; ; len++)
41 if (!name[len] || name[len] == '\\' || is_dir_sep(name[len])) {
42--
432.19.0
44
diff --git a/meta/recipes-devtools/git/git.inc b/meta/recipes-devtools/git/git.inc
index bea23ec783..8603c045cc 100644
--- a/meta/recipes-devtools/git/git.inc
+++ b/meta/recipes-devtools/git/git.inc
@@ -8,7 +8,8 @@ PROVIDES_append_class-native = " git-replacement-native"
8 8
9SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \ 9SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
10 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages \ 10 ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages \
11 file://CVE-2018-11235.patch" 11 file://CVE-2018-11235.patch \
12 file://CVE-2018-11233.patch"
12 13
13S = "${WORKDIR}/git-${PV}" 14S = "${WORKDIR}/git-${PV}"
14 15