diff options
author | Sinan Kaya <okaya@kernel.org> | 2018-10-05 03:55:15 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-18 11:08:53 +0100 |
commit | fbc735796f473d85055feb9c3927cd5293061bf6 (patch) | |
tree | 14e95a758a49ca93b19aeea965e4e4e4383fdbd8 /meta/recipes-devtools/git/files/CVE-2018-11233.patch | |
parent | 97ee1f80870745bf6c542ee2f184c9e468672714 (diff) | |
download | poky-fbc735796f473d85055feb9c3927cd5293061bf6.tar.gz |
git: CVE-2018-11233
* CVE-2018-11233
Code to sanity-check pathnames on NTFS can result in reading
out-of-bounds memory.
Affects < 2.17.1
CVE: CVE-2018-11233
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1583888
(From OE-Core rev: d145f605c274386baf0dde023f15cddf37523f3b)
Signed-off-by: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/git/files/CVE-2018-11233.patch')
-rw-r--r-- | meta/recipes-devtools/git/files/CVE-2018-11233.patch | 44 |
1 files changed, 44 insertions, 0 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 @@ | |||
1 | From 014281e62b7920a6d710a85089e00ca012b0744c Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff King <peff@peff.net> | ||
3 | Date: Sun, 13 May 2018 12:09:42 -0400 | ||
4 | Subject: [PATCH] is_ntfs_dotgit: use a size_t for traversing string | ||
5 | |||
6 | We walk through the "name" string using an int, which can | ||
7 | wrap to a negative value and cause us to read random memory | ||
8 | before our array (e.g., by creating a tree with a name >2GB, | ||
9 | since "int" is still 32 bits even on most 64-bit platforms). | ||
10 | Worse, this is easy to trigger during the fsck_tree() check, | ||
11 | which is supposed to be protecting us from malicious | ||
12 | garbage. | ||
13 | |||
14 | Note one bit of trickiness in the existing code: we | ||
15 | sometimes assign -1 to "len" at the end of the loop, and | ||
16 | then rely on the "len++" in the for-loop's increment to take | ||
17 | it back to 0. This is still legal with a size_t, since | ||
18 | assigning -1 will turn into SIZE_MAX, which then wraps | ||
19 | around to 0 on increment. | ||
20 | |||
21 | Signed-off-by: Jeff King <peff@peff.net> | ||
22 | CVE: CVE-2018-11233 | ||
23 | Upstream-Status: Backport[https://github.com/git/git/commit/11a9f4d807a0d71dc6eff51bb87baf4ca2cccf1d] | ||
24 | Signed-off-by: Sinan Kaya <okaya@kernel.org> | ||
25 | --- | ||
26 | path.c | 2 +- | ||
27 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
28 | |||
29 | diff --git a/path.c b/path.c | ||
30 | index 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 | -- | ||
43 | 2.19.0 | ||
44 | |||