From 040204c2615271a853bf8846eb9e78e4bec35fc0 Mon Sep 17 00:00:00 2001 From: "Mark W. Krentel" Date: Tue, 2 Feb 2021 14:40:24 -0600 Subject: [PATCH] intel-xed: add patch to 12.0.1 to fix segfault (#21436) Fix segfault due to uninitialized data when trying to decode some cases of data that aren't a valid instruction. --- .../builtin/packages/intel-xed/1201-segv.patch | 18 ++++++++++++++++++ .../builtin/packages/intel-xed/package.py | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 var/spack/repos/builtin/packages/intel-xed/1201-segv.patch diff --git a/var/spack/repos/builtin/packages/intel-xed/1201-segv.patch b/var/spack/repos/builtin/packages/intel-xed/1201-segv.patch new file mode 100644 index 0000000000..a1ff15d5c9 --- /dev/null +++ b/var/spack/repos/builtin/packages/intel-xed/1201-segv.patch @@ -0,0 +1,18 @@ +Fix segfault due to uninitialized data when trying to decode some cases +of data that aren't a valid instruction. + +https://github.com/intelxed/xed/commit/5c54699f78ba1e3ce7e0cc6dead0088a8dd09c56 + + +diff --git a/src/dec/xed-decoded-init.c b/src/dec/xed-decoded-init.c +index b0d4db1..fc226d2 100644 +--- a/src/dec/xed-decoded-init.c ++++ b/src/dec/xed-decoded-init.c +@@ -46,6 +46,7 @@ xed_decoded_inst_zero_keep_mode_from_operands( + xed_operand_values_init_keep_mode(p, operands); + p->_decoded_length = 0; + p->_inst = 0; ++ p->u.user_data = 0; + } + + XED_DLL_EXPORT void diff --git a/var/spack/repos/builtin/packages/intel-xed/package.py b/var/spack/repos/builtin/packages/intel-xed/package.py index 1e3c4f6330..06ee2791e6 100644 --- a/var/spack/repos/builtin/packages/intel-xed/package.py +++ b/var/spack/repos/builtin/packages/intel-xed/package.py @@ -38,6 +38,8 @@ class IntelXed(Package): # The current mfile uses python3 by name. depends_on('python@3.4:', type='build') + patch('1201-segv.patch', when='@12.0.1') + conflicts('target=ppc64:', msg='intel-xed only runs on x86') conflicts('target=ppc64le:', msg='intel-xed only runs on x86') conflicts('target=aarch64:', msg='intel-xed only runs on x86')