All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/p7zip: fix CVE-2016-9296
@ 2020-04-10 17:31 André Hentschel
  2020-04-10 17:31 ` [Buildroot] [PATCH 2/2] package/p7zip: fix CVE-2017-17969 André Hentschel
  2020-04-10 20:41 ` [Buildroot] [PATCH 1/2] package/p7zip: fix CVE-2016-9296 Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: André Hentschel @ 2020-04-10 17:31 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Andr? Hentschel <nerv@dawncrow.de>
---
 package/p7zip/0001-CVE-2016-9296.patch | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 package/p7zip/0001-CVE-2016-9296.patch

diff --git a/package/p7zip/0001-CVE-2016-9296.patch b/package/p7zip/0001-CVE-2016-9296.patch
new file mode 100644
index 0000000000..42245c92c0
--- /dev/null
+++ b/package/p7zip/0001-CVE-2016-9296.patch
@@ -0,0 +1,23 @@
+From: Robert Luberda <robert@debian.org>
+Date: Sat, 19 Nov 2016 08:48:08 +0100
+Subject: Fix nullptr dereference (CVE-2016-9296)
+
+Patch taken from https://sourceforge.net/p/p7zip/bugs/185/
+---
+ CPP/7zip/Archive/7z/7zIn.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CPP/7zip/Archive/7z/7zIn.cpp b/CPP/7zip/Archive/7z/7zIn.cpp
+index b0c6b98..7c6dde2 100644
+--- a/CPP/7zip/Archive/7z/7zIn.cpp
++++ b/CPP/7zip/Archive/7z/7zIn.cpp
+@@ -1097,7 +1097,8 @@ HRESULT CInArchive::ReadAndDecodePackedStreams(
+       if (CrcCalc(data, unpackSize) != folders.FolderCRCs.Vals[i])
+         ThrowIncorrect();
+   }
+-  HeadersSize += folders.PackPositions[folders.NumPackStreams];
++  if (folders.PackPositions)
++      HeadersSize += folders.PackPositions[folders.NumPackStreams];
+   return S_OK;
+ }
+ 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 2/2] package/p7zip: fix CVE-2017-17969
  2020-04-10 17:31 [Buildroot] [PATCH 1/2] package/p7zip: fix CVE-2016-9296 André Hentschel
@ 2020-04-10 17:31 ` André Hentschel
  2020-04-10 20:41 ` [Buildroot] [PATCH 1/2] package/p7zip: fix CVE-2016-9296 Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: André Hentschel @ 2020-04-10 17:31 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Andr? Hentschel <nerv@dawncrow.de>
---
 package/p7zip/0002-CVE-2017-17969.patch | 35 +++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 package/p7zip/0002-CVE-2017-17969.patch

diff --git a/package/p7zip/0002-CVE-2017-17969.patch b/package/p7zip/0002-CVE-2017-17969.patch
new file mode 100644
index 0000000000..a9787c4a90
--- /dev/null
+++ b/package/p7zip/0002-CVE-2017-17969.patch
@@ -0,0 +1,35 @@
+From: =?utf-8?q?Antoine_Beaupr=C3=A9?= <anarcat@debian.org>
+Date: Fri, 2 Feb 2018 11:11:41 +0100
+Subject: Heap-based buffer overflow in 7zip/Compress/ShrinkDecoder.cpp
+
+Origin: vendor, https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/27d7/attachment/CVE-2017-17969.patch
+Forwarded: https://sourceforge.net/p/p7zip/bugs/_discuss/thread/0920f369/#27d7
+Bug: https://sourceforge.net/p/p7zip/bugs/204/
+Bug-Debian: https://bugs.debian.org/888297
+Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-17969
+Reviewed-by: Salvatore Bonaccorso <carnil@debian.org>
+Last-Update: 2018-02-01
+Applied-Upstream: 18.00-beta
+---
+ CPP/7zip/Compress/ShrinkDecoder.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/CPP/7zip/Compress/ShrinkDecoder.cpp b/CPP/7zip/Compress/ShrinkDecoder.cpp
+index 80b7e67..ca37764 100644
+--- a/CPP/7zip/Compress/ShrinkDecoder.cpp
++++ b/CPP/7zip/Compress/ShrinkDecoder.cpp
+@@ -121,8 +121,13 @@ 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;
+ 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/2] package/p7zip: fix CVE-2016-9296
  2020-04-10 17:31 [Buildroot] [PATCH 1/2] package/p7zip: fix CVE-2016-9296 André Hentschel
  2020-04-10 17:31 ` [Buildroot] [PATCH 2/2] package/p7zip: fix CVE-2017-17969 André Hentschel
@ 2020-04-10 20:41 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2020-04-10 20:41 UTC (permalink / raw)
  To: buildroot

On Fri, 10 Apr 2020 19:31:17 +0200
Andr? Hentschel <nerv@dawncrow.de> wrote:

> Signed-off-by: Andr? Hentschel <nerv@dawncrow.de>
> ---
>  package/p7zip/0001-CVE-2016-9296.patch | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>  create mode 100644 package/p7zip/0001-CVE-2016-9296.patch

Thanks, but we need you to add your Signed-off-by *inside* the patches
you're adding. Could you send a v2 with that fixed?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-10 20:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10 17:31 [Buildroot] [PATCH 1/2] package/p7zip: fix CVE-2016-9296 André Hentschel
2020-04-10 17:31 ` [Buildroot] [PATCH 2/2] package/p7zip: fix CVE-2017-17969 André Hentschel
2020-04-10 20:41 ` [Buildroot] [PATCH 1/2] package/p7zip: fix CVE-2016-9296 Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.