From 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd Mon Sep 17 00:00:00 2001 From: ToshikazuOhiwa Date: Mon, 30 Mar 2020 09:24:26 +0900 Subject: agl-basesystem --- ...0001-Fix-narrowing-errors-Wc-11-narrowing.patch | 48 ++++++++++++++++++++++ .../p7zip/files/CVE-2017-17969.patch | 31 ++++++++++++++ ...do_not_override_compiler_and_do_not_strip.patch | 30 ++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/CVE-2017-17969.patch create mode 100644 external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/do_not_override_compiler_and_do_not_strip.patch (limited to 'external/meta-openembedded/meta-oe/recipes-extended/p7zip/files') diff --git a/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch b/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch new file mode 100644 index 00000000..ae275174 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch @@ -0,0 +1,48 @@ +From b6b1782af4aa7f9084d32e4144738dc2535c8d6f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 23 Apr 2018 23:07:21 -0700 +Subject: [PATCH] Fix narrowing errors -Wc++11-narrowing + +Clang 6.x finds these errors + + ../../../../CPP/Windows/ErrorMsg.cpp:24:10: error: case value evaluates to -2147024809, which cannot be narrowed to type 'DWORD' (aka 'unsigned int') [-Wc++11-narrowing] + case E_INVALIDARG : txt = "E_INVALIDARG"; break ; + ^ + +HRESULT causes the macro to be parsed as a signed long, so we need to force it +to be checked as an unsigned long instead. + +also reported here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224930 + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + CPP/Windows/ErrorMsg.cpp | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/CPP/Windows/ErrorMsg.cpp b/CPP/Windows/ErrorMsg.cpp +index 99684ae..78a64ba 100644 +--- a/CPP/Windows/ErrorMsg.cpp ++++ b/CPP/Windows/ErrorMsg.cpp +@@ -15,13 +15,13 @@ UString MyFormatMessage(DWORD errorCode) + + switch(errorCode) { + case ERROR_NO_MORE_FILES : txt = "No more files"; break ; +- case E_NOTIMPL : txt = "E_NOTIMPL"; break ; +- case E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; +- case E_ABORT : txt = "E_ABORT"; break ; +- case E_FAIL : txt = "E_FAIL"; break ; +- case STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; +- case E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; +- case E_INVALIDARG : txt = "E_INVALIDARG"; break ; ++ case (DWORD) E_NOTIMPL : txt = "E_NOTIMPL"; break ; ++ case (DWORD) E_NOINTERFACE : txt = "E_NOINTERFACE"; break ; ++ case (DWORD) E_ABORT : txt = "E_ABORT"; break ; ++ case (DWORD) E_FAIL : txt = "E_FAIL"; break ; ++ case (DWORD) STG_E_INVALIDFUNCTION : txt = "STG_E_INVALIDFUNCTION"; break ; ++ case (DWORD) E_OUTOFMEMORY : txt = "E_OUTOFMEMORY"; break ; ++ case (DWORD) E_INVALIDARG : txt = "E_INVALIDARG"; break ; + case ERROR_DIRECTORY : txt = "Error Directory"; break ; + default: + txt = strerror(errorCode); diff --git a/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/CVE-2017-17969.patch b/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/CVE-2017-17969.patch new file mode 100644 index 00000000..177d1455 --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/CVE-2017-17969.patch @@ -0,0 +1,31 @@ +p7zip: Fix CVE-2017-17969 + +[No upstream tracking] -- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888297 + +Heap-based buffer overflow in 7zip + +Compress/ShrinkDecoder.cpp: Heap-based buffer overflow +in the NCompress::NShrink::CDecoder::CodeReal method +in 7-Zip before 18.00 and p7zip allows remote attackers +to cause a denial of service (out-of-bounds write) +or potentially execute arbitrary code via a crafted ZIP archive. + +Upstream-Status: Backport [https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/8316/attachment/CVE-2017-17969.patch] +CVE: CVE-2017-17969 +Signed-off-by: Radovan Scasny + +--- a/CPP/7zip/Compress/ShrinkDecoder.cpp ++++ b/CPP/7zip/Compress/ShrinkDecoder.cpp +@@ -121,7 +121,12 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream * + { + _stack[i++] = _suffixes[cur]; + cur = _parents[cur]; ++ if (cur >= kNumItems || i >= kNumItems) ++ break; + } ++ ++ if (cur >= kNumItems || i >= kNumItems) ++ break; + + _stack[i++] = (Byte)cur; + lastChar2 = (Byte)cur; diff --git a/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/do_not_override_compiler_and_do_not_strip.patch b/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/do_not_override_compiler_and_do_not_strip.patch new file mode 100644 index 00000000..b0a560fe --- /dev/null +++ b/external/meta-openembedded/meta-oe/recipes-extended/p7zip/files/do_not_override_compiler_and_do_not_strip.patch @@ -0,0 +1,30 @@ +do not override compiler and do not strip + +The default makefile sets the compiler to g++ or gcc. This leads to a wrong architecture when cross-compiling. +Remove the hardcoded compiler and just append the flags to CXX and CC. + +Upstream-Status: Pending +Signed-off-by: Raphael Freudiger +Reviewed-By: Pascal Bach + +diff -Nurp p7zip_15.14.1_orig/makefile.machine p7zip_15.14.1/makefile.machine +--- p7zip_15.14.1_orig/makefile.machine 2016-03-23 20:37:47.000000000 +0100 ++++ p7zip_15.14.1/makefile.machine 2016-06-17 15:33:39.720454477 +0200 +@@ -2,7 +2,7 @@ + # makefile for Linux (x86, PPC, alpha ...) + # + +-OPTFLAGS=-O -s ++OPTFLAGS=-O + + ALLFLAGS=${OPTFLAGS} -pipe \ + -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ +@@ -10,8 +10,6 @@ ALLFLAGS=${OPTFLAGS} -pipe \ + -D_7ZIP_LARGE_PAGES \ + $(LOCAL_FLAGS) + +-CXX=g++ +-CC=gcc + CC_SHARED=-fPIC + LINK_SHARED=-fPIC -shared + -- cgit 1.2.3-korg