[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: gnu: rpm: Fix CVE-2014-8118.
From: |
Leo Famulari |
Subject: |
02/02: gnu: rpm: Fix CVE-2014-8118. |
Date: |
Sun, 29 May 2016 18:02:39 +0000 (UTC) |
lfam pushed a commit to branch master
in repository guix.
commit 65da8dd01ed02b8bf4499b175a49345633f56451
Author: Leo Famulari <address@hidden>
Date: Sun May 29 13:57:56 2016 -0400
gnu: rpm: Fix CVE-2014-8118.
* gnu/packages/patches/rpm-CVE-2014-8118.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/package-management.scm (rpm): Use it.
---
gnu/local.mk | 1 +
gnu/packages/package-management.scm | 3 ++-
gnu/packages/patches/rpm-CVE-2014-8118.patch | 25 +++++++++++++++++++++++++
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 3f595b4..dade736 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -716,6 +716,7 @@ dist_patch_DATA =
\
%D%/packages/patches/ratpoison-shell.patch \
%D%/packages/patches/readline-link-ncurses.patch \
%D%/packages/patches/ripperx-missing-file.patch \
+ %D%/packages/patches/rpm-CVE-2014-8118.patch \
%D%/packages/patches/rsem-makefile.patch \
%D%/packages/patches/ruby-symlinkfix.patch \
%D%/packages/patches/rush-CVE-2013-6889.patch \
diff --git a/gnu/packages/package-management.scm
b/gnu/packages/package-management.scm
index fdc25a5..46743fe 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -334,7 +334,8 @@ symlinks to the files in a common directory such as
/usr/local.")
version ".tar.bz2"))
(sha256
(base32
- "0a82ym8phx7g0f3k6smvxnvzh7yv857l42xafk49689kzhld5pbp"))))
+ "0a82ym8phx7g0f3k6smvxnvzh7yv857l42xafk49689kzhld5pbp"))
+ (patches (search-patches "rpm-CVE-2014-8118.patch"))))
(build-system gnu-build-system)
(arguments
'(#:configure-flags '("--with-external-db" ;use the system's bdb
diff --git a/gnu/packages/patches/rpm-CVE-2014-8118.patch
b/gnu/packages/patches/rpm-CVE-2014-8118.patch
new file mode 100644
index 0000000..5fdb0f0
--- /dev/null
+++ b/gnu/packages/patches/rpm-CVE-2014-8118.patch
@@ -0,0 +1,25 @@
+Fix CVE-2014-8118 (integer overflow allowing arbitrary remote code
+execution via crafted CPIO header).
+
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-8118
+
+Source:
+https://bugzilla.redhat.com/attachment.cgi?id=962159&action=diff
+
+Adopted by Debian:
+http://anonscm.debian.org/cgit/collab-maint/rpm.git/plain/debian/patches/CVE-2014-8118.patch
+
+diff --git a/lib/cpio.c b/lib/cpio.c
+index 253ff0f..600633a 100644
+--- a/lib/cpio.c
++++ b/lib/cpio.c
+@@ -399,6 +399,9 @@ int rpmcpioHeaderRead(rpmcpio_t cpio, char ** path, int *
fx)
+
+ GET_NUM_FIELD(hdr.filesize, fsize);
+ GET_NUM_FIELD(hdr.namesize, nameSize);
++ if (nameSize <= 0 || nameSize > 4096) {
++ return RPMERR_BAD_HEADER;
++ }
+
+ char name[nameSize + 1];
+ read = Fread(name, nameSize, 1, cpio->fd);