Yocto 2.5

Move OpenBMC to Yocto 2.5(sumo)

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5c5ad6904a16e14c1c397f0baf10c9d465594a78
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files/0001-Fix-narrowing-errors-Wc-11-narrowing.patch
new file mode 100644
index 0000000..ae27517
--- /dev/null
+++ b/import-layers/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 <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+---
+ 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/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files/CVE-2017-17969.patch b/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/files/CVE-2017-17969.patch
new file mode 100644
index 0000000..177d145
--- /dev/null
+++ b/import-layers/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 <radovan.scasny@siemens.com>
+
+--- 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/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/p7zip_16.02.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/p7zip_16.02.bb
index 67ffbc6..d986da9 100644
--- a/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/p7zip_16.02.bb
+++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/p7zip/p7zip_16.02.bb
@@ -6,7 +6,10 @@
                     file://DOC/License.txt;md5=879598edf1f54dddb6930d7581357f8b"
 
 SRC_URI = "http://downloads.sourceforge.net/p7zip/p7zip/${PV}/p7zip_${PV}_src_all.tar.bz2 \
-          file://do_not_override_compiler_and_do_not_strip.patch"
+           file://do_not_override_compiler_and_do_not_strip.patch \
+           file://CVE-2017-17969.patch \
+           file://0001-Fix-narrowing-errors-Wc-11-narrowing.patch \
+           "
 
 SRC_URI[md5sum] = "a0128d661cfe7cc8c121e73519c54fbf"
 SRC_URI[sha256sum] = "5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f"