summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rsync/files/CVE-2016-9843.patch
diff options
context:
space:
mode:
authorAnuj Mittal <anuj.mittal@intel.com>2019-11-06 17:37:58 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-07 19:47:27 +0000
commit95d6d83772813f25afe1e48cb38fd47bbaaa0f96 (patch)
tree227bf781f0717e5e66dde369065c1b4a35f30515 /meta/recipes-devtools/rsync/files/CVE-2016-9843.patch
parent376ff1ce4c70054f2237a1bb55a32424d34d5488 (diff)
downloadpoky-95d6d83772813f25afe1e48cb38fd47bbaaa0f96.tar.gz
rsync: fix CVEs for included zlib
rsync includes its own copy of zlib and doesn't recommend linking with the system version [1]. Import CVE fixes that impact zlib version 1.2.8 [2] that is currently used by rsync. [1] https://git.samba.org/rsync.git/?p=rsync.git;a=blob;f=zlib/README.rsync [2] https://nvd.nist.gov/vuln/search/results?form_type=Advanced&cves=on&cpe_version=cpe%3a%2fa%3agnu%3azlib%3a1.2.8 (From OE-Core rev: a55fbb4cb489853dfb0b4553f6e187c3f3633f48) (From OE-Core rev: 1ce0a922853b6136a019763b64e58194bb0df00f) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Conflicts: meta/recipes-devtools/rsync/rsync_3.1.3.bb
Diffstat (limited to 'meta/recipes-devtools/rsync/files/CVE-2016-9843.patch')
-rw-r--r--meta/recipes-devtools/rsync/files/CVE-2016-9843.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rsync/files/CVE-2016-9843.patch b/meta/recipes-devtools/rsync/files/CVE-2016-9843.patch
new file mode 100644
index 0000000000..ea2e42fe76
--- /dev/null
+++ b/meta/recipes-devtools/rsync/files/CVE-2016-9843.patch
@@ -0,0 +1,53 @@
1From d1d577490c15a0c6862473d7576352a9f18ef811 Mon Sep 17 00:00:00 2001
2From: Mark Adler <madler@alumni.caltech.edu>
3Date: Wed, 28 Sep 2016 20:20:25 -0700
4Subject: [PATCH] Avoid pre-decrement of pointer in big-endian CRC calculation.
5
6There was a small optimization for PowerPCs to pre-increment a
7pointer when accessing a word, instead of post-incrementing. This
8required prefacing the loop with a decrement of the pointer,
9possibly pointing before the object passed. This is not compliant
10with the C standard, for which decrementing a pointer before its
11allocated memory is undefined. When tested on a modern PowerPC
12with a modern compiler, the optimization no longer has any effect.
13Due to all that, and per the recommendation of a security audit of
14the zlib code by Trail of Bits and TrustInSoft, in support of the
15Mozilla Foundation, this "optimization" was removed, in order to
16avoid the possibility of undefined behavior.
17
18CVE: CVE-2016-9843
19Upstream-Status: Backport
20Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
21---
22 crc32.c | 4 +---
23 1 file changed, 1 insertion(+), 3 deletions(-)
24
25diff --git a/zlib/crc32.c b/zlib/crc32.c
26index 979a7190..05733f4e 100644
27--- a/zlib/crc32.c
28+++ b/zlib/crc32.c
29@@ -278,7 +278,7 @@ local unsigned long crc32_little(crc, buf, len)
30 }
31
32 /* ========================================================================= */
33-#define DOBIG4 c ^= *++buf4; \
34+#define DOBIG4 c ^= *buf4++; \
35 c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
36 crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
37 #define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
38@@ -300,7 +300,6 @@ local unsigned long crc32_big(crc, buf, len)
39 }
40
41 buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
42- buf4--;
43 while (len >= 32) {
44 DOBIG32;
45 len -= 32;
46@@ -309,7 +308,6 @@ local unsigned long crc32_big(crc, buf, len)
47 DOBIG4;
48 len -= 4;
49 }
50- buf4++;
51 buf = (const unsigned char FAR *)buf4;
52
53 if (len) do {