diff options
| -rw-r--r-- | recipes-core/glibc/glibc/CVE-2018-11237.patch | 74 | ||||
| -rw-r--r-- | recipes-core/glibc/glibc_2.27.bbappend | 6 |
2 files changed, 80 insertions, 0 deletions
diff --git a/recipes-core/glibc/glibc/CVE-2018-11237.patch b/recipes-core/glibc/glibc/CVE-2018-11237.patch new file mode 100644 index 0000000..41bd002 --- /dev/null +++ b/recipes-core/glibc/glibc/CVE-2018-11237.patch | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | From 9aaaab7c6e4176e61c59b0a63c6ba906d875dc0e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andreas Schwab <schwab@suse.de> | ||
| 3 | Date: Tue, 22 May 2018 10:37:59 +0200 | ||
| 4 | Subject: [PATCH] Don't write beyond destination in | ||
| 5 | __mempcpy_avx512_no_vzeroupper (bug 23196) | ||
| 6 | |||
| 7 | When compiled as mempcpy, the return value is the end of the destination | ||
| 8 | buffer, thus it cannot be used to refer to the start of it. | ||
| 9 | |||
| 10 | CVE: CVE-2018-11237 | ||
| 11 | Upstream-Status: Backport | ||
| 12 | |||
| 13 | Signed-off-by: Adrian Mangeac <Adrian.Mangeac@enea.com> | ||
| 14 | --- | ||
| 15 | ChangeLog | 9 +++++++++ | ||
| 16 | string/test-mempcpy.c | 1 + | ||
| 17 | sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S | 5 +++-- | ||
| 18 | 3 files changed, 13 insertions(+), 2 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/ChangeLog b/ChangeLog | ||
| 21 | index 252b099..8032adf 100644 | ||
| 22 | --- a/ChangeLog | ||
| 23 | +++ b/ChangeLog | ||
| 24 | @@ -1,3 +1,12 @@ | ||
| 25 | +2018-05-23 Andreas Schwab <schwab@suse.de> | ||
| 26 | + | ||
| 27 | + [BZ #23196] | ||
| 28 | + CVE-2018-11237 | ||
| 29 | + * sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S | ||
| 30 | + (L(preloop_large)): Save initial destination pointer in %r11 and | ||
| 31 | + use it instead of %rax after the loop. | ||
| 32 | + * string/test-mempcpy.c (MIN_PAGE_SIZE): Define. | ||
| 33 | + | ||
| 34 | 2018-05-09 Paul Pluzhnikov <ppluzhnikov@google.com> | ||
| 35 | |||
| 36 | [BZ #22786] | ||
| 37 | diff --git a/string/test-mempcpy.c b/string/test-mempcpy.c | ||
| 38 | index c08fba8..d98ecdd 100644 | ||
| 39 | --- a/string/test-mempcpy.c | ||
| 40 | +++ b/string/test-mempcpy.c | ||
| 41 | @@ -18,6 +18,7 @@ | ||
| 42 | <http://www.gnu.org/licenses/>. */ | ||
| 43 | |||
| 44 | #define MEMCPY_RESULT(dst, len) (dst) + (len) | ||
| 45 | +#define MIN_PAGE_SIZE 131072 | ||
| 46 | #define TEST_MAIN | ||
| 47 | #define TEST_NAME "mempcpy" | ||
| 48 | #include "test-string.h" | ||
| 49 | diff --git a/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S b/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S | ||
| 50 | index 23c0f7a..effc3ac 100644 | ||
| 51 | --- a/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S | ||
| 52 | +++ b/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S | ||
| 53 | @@ -336,6 +336,7 @@ L(preloop_large): | ||
| 54 | vmovups (%rsi), %zmm4 | ||
| 55 | vmovups 0x40(%rsi), %zmm5 | ||
| 56 | |||
| 57 | + mov %rdi, %r11 | ||
| 58 | /* Align destination for access with non-temporal stores in the loop. */ | ||
| 59 | mov %rdi, %r8 | ||
| 60 | and $-0x80, %rdi | ||
| 61 | @@ -366,8 +367,8 @@ L(gobble_256bytes_nt_loop): | ||
| 62 | cmp $256, %rdx | ||
| 63 | ja L(gobble_256bytes_nt_loop) | ||
| 64 | sfence | ||
| 65 | - vmovups %zmm4, (%rax) | ||
| 66 | - vmovups %zmm5, 0x40(%rax) | ||
| 67 | + vmovups %zmm4, (%r11) | ||
| 68 | + vmovups %zmm5, 0x40(%r11) | ||
| 69 | jmp L(check) | ||
| 70 | |||
| 71 | L(preloop_large_bkw): | ||
| 72 | -- | ||
| 73 | 2.9.3 | ||
| 74 | |||
diff --git a/recipes-core/glibc/glibc_2.27.bbappend b/recipes-core/glibc/glibc_2.27.bbappend new file mode 100644 index 0000000..1ab2d4a --- /dev/null +++ b/recipes-core/glibc/glibc_2.27.bbappend | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | # look for files in the layer first | ||
| 2 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
| 3 | |||
| 4 | SRC_URI += " \ | ||
| 5 | file://CVE-2018-11237.patch \ | ||
| 6 | " | ||
