diff --git a/.gitignore b/.gitignore index 3070f5b..31a3cc3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libvdpau-1.1.tar.bz2 +SOURCES/libvdpau-1.1.1.tar.bz2 diff --git a/.libvdpau.metadata b/.libvdpau.metadata index bba2640..f9b16e0 100644 --- a/.libvdpau.metadata +++ b/.libvdpau.metadata @@ -1 +1 @@ -dad18f0c70a0f2ba18aa9654ac6a83ec6e00ccd6 SOURCES/libvdpau-1.1.tar.bz2 +d0158f403be87d0ff554e95ddfcce6d4b2b5f3b8 SOURCES/libvdpau-1.1.1.tar.bz2 diff --git a/SOURCES/0001-mesa_dri2-Add-missing-include-of-config.h-to-define-.patch b/SOURCES/0001-mesa_dri2-Add-missing-include-of-config.h-to-define-.patch new file mode 100644 index 0000000..5598410 --- /dev/null +++ b/SOURCES/0001-mesa_dri2-Add-missing-include-of-config.h-to-define-.patch @@ -0,0 +1,31 @@ +From 1cda354bdfd0c9ca107293b84b52f4464fdbedcc Mon Sep 17 00:00:00 2001 +From: Rico Tzschichholz +Date: Tue, 1 Sep 2015 10:45:11 +0200 +Subject: [PATCH 1/3] mesa_dri2: Add missing include of config.h to define _GNU_SOURCE + +Fix build with -Wimplicit-function-declaration while secure_getenv() is +guarded by __USE_GNU. + +Reviewed-by: Aaron Plattner +Tested-by: Stefan Dirsch +--- + src/mesa_dri2.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/src/mesa_dri2.c b/src/mesa_dri2.c +index 51e8794..420ccee 100644 +--- a/src/mesa_dri2.c ++++ b/src/mesa_dri2.c +@@ -33,6 +33,9 @@ + * and José Hiram Soltren (jsoltren@nvidia.com) + */ + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif + + #define NEED_REPLIES + #include +-- +1.7.2.1 + diff --git a/SOURCES/0002-util.h-Make-getenv_wrapper-static-inline.patch b/SOURCES/0002-util.h-Make-getenv_wrapper-static-inline.patch new file mode 100644 index 0000000..63a0648 --- /dev/null +++ b/SOURCES/0002-util.h-Make-getenv_wrapper-static-inline.patch @@ -0,0 +1,31 @@ +From fb5362be7a6d6f89f76c5e171c339f5fa1916d38 Mon Sep 17 00:00:00 2001 +From: Aaron Plattner +Date: Mon, 7 Sep 2015 21:16:58 -0700 +Subject: [PATCH 2/3] util.h: Make getenv_wrapper() static inline +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Otherwise, GCC generates a "‘getenv_wrapper’ defined but not used" warning. + +Signed-off-by: Aaron Plattner +--- + src/util.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/util.h b/src/util.h +index 1452c06..39227ea 100644 +--- a/src/util.h ++++ b/src/util.h +@@ -28,7 +28,7 @@ + #include + #include + +-static char * getenv_wrapper(const char *name) ++static inline char * getenv_wrapper(const char *name) + { + if (getuid() == geteuid() && getgid() == getegid()) { + return getenv(name); +-- +1.7.2.1 + diff --git a/SOURCES/0003-Fix-doc-error-on-displayable-surface-types.patch b/SOURCES/0003-Fix-doc-error-on-displayable-surface-types.patch new file mode 100644 index 0000000..1aac262 --- /dev/null +++ b/SOURCES/0003-Fix-doc-error-on-displayable-surface-types.patch @@ -0,0 +1,30 @@ +From a21bf7aa438f5dd40d0a300a3167aa3d6f26dccc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Hiram=20Soltren?= +Date: Wed, 9 Sep 2015 15:05:01 -0500 +Subject: [PATCH 3/3] Fix doc error on displayable surface types + +VdpVideoSurface is not directly displayable in the current +implementation of VDPAU. VdpOutputSurface is. Make the documentation +consistent with reality. + +Signed-off-by: Aaron Plattner +--- + include/vdpau/vdpau.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/include/vdpau/vdpau.h b/include/vdpau/vdpau.h +index 8cc4524..0bc5b60 100644 +--- a/include/vdpau/vdpau.h ++++ b/include/vdpau/vdpau.h +@@ -1704,7 +1704,7 @@ typedef VdpStatus VdpVideoSurfacePutBitsYCbCr( + * - The Hardware that implements \ref VdpPresentationQueue + * "VdpPresentationQueue" functionality, + * +- * VdpVideoSurfaces are directly displayable using a \ref ++ * VdpOutputSurfaces are directly displayable using a \ref + * VdpPresentationQueue "VdpPresentationQueue" object. + * + * @{ +-- +1.7.2.1 + diff --git a/SOURCES/Use-secure_getenv-3-to-improve-security.patch b/SOURCES/Use-secure_getenv-3-to-improve-security.patch deleted file mode 100644 index 566acd0..0000000 --- a/SOURCES/Use-secure_getenv-3-to-improve-security.patch +++ /dev/null @@ -1,260 +0,0 @@ -From a7b5a5b8a1d7bbee50a4a82c0a2e3be4186c486b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Hiram=20Soltren?= -Date: Mon, 17 Aug 2015 16:01:44 -0500 -Subject: [PATCH] Use secure_getenv(3) to improve security - -This patch is in response to the following security vulnerabilities -(CVEs) reported to NVIDIA against libvdpau: - -CVE-2015-5198 -CVE-2015-5199 -CVE-2015-5200 - -To address these CVEs, this patch: - -- replaces all uses of getenv(3) with secure_getenv(3); -- uses secure_getenv(3) when available, with a fallback option; -- protects VDPAU_DRIVER against directory traversal by checking for '/' - -On platforms where secure_getenv(3) is not available, the C preprocessor -will print a warning at compile time. Then, a preprocessor macro will -replace secure_getenv(3) with our getenv_wrapper(), which utilizes the check: - - getuid() == geteuid() && getgid() == getegid() - -See getuid(2) and getgid(2) for further details. - -NVIDIA internal bug ID 1675564 ---- - configure.ac | 4 ++++ - src/Makefile.am | 1 + - src/mesa_dri2.c | 6 ++++-- - src/util.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ - src/vdpau_wrapper.c | 28 ++++++++++++++++------------ - trace/vdpau_trace.cpp | 8 +++++--- - 6 files changed, 79 insertions(+), 17 deletions(-) - create mode 100644 src/util.h - -diff --git a/configure.ac b/configure.ac -index f1f6229..4422961 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -5,6 +5,10 @@ AM_INIT_AUTOMAKE([dist-bzip2 foreign]) - - AC_CONFIG_HEADERS(config.h) - -+# Check for secure_getenv -+AC_USE_SYSTEM_EXTENSIONS -+AC_CHECK_FUNCS([__secure_getenv secure_getenv]) -+ - # Disable static libraries by default. Use --enable-static if you really want - # them. - AC_DISABLE_STATIC -diff --git a/src/Makefile.am b/src/Makefile.am -index 0ce8460..8d28bb4 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -9,6 +9,7 @@ lib_LTLIBRARIES = libvdpau.la - - libvdpau_la_SOURCES = \ - vdpau_wrapper.c \ -+ util.h \ - $(DRI2_SOURCES) - - if DRI2 -diff --git a/src/mesa_dri2.c b/src/mesa_dri2.c -index 5f7146a..51e8794 100644 ---- a/src/mesa_dri2.c -+++ b/src/mesa_dri2.c -@@ -1,6 +1,6 @@ - /* - * Copyright © 2008 Red Hat, Inc. -- * Copyright © 2010 NVIDIA Corporation -+ * Copyright © 2010-2015 NVIDIA Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Soft- -@@ -30,6 +30,7 @@ - * Authors: - * Kristian Høgsberg (krh@redhat.com) - * Modified for VDPAU by Aaron Plattner (aplattner@nvidia.com) -+ * and José Hiram Soltren (jsoltren@nvidia.com) - */ - - -@@ -39,6 +40,7 @@ - #include - #include - #include "mesa_dri2.h" -+#include "util.h" - - static char dri2ExtensionName[] = DRI2_NAME; - static XExtensionInfo *dri2Info; -@@ -130,7 +132,7 @@ _vdp_DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName - req->driverType = DRI2DriverVDPAU; - #ifdef DRI2DriverPrimeShift - { -- char *prime = getenv("DRI_PRIME"); -+ char *prime = secure_getenv("DRI_PRIME"); - if (prime) { - unsigned int primeid; - errno = 0; -diff --git a/src/util.h b/src/util.h -new file mode 100644 -index 0000000..7bc62fe ---- /dev/null -+++ b/src/util.h -@@ -0,0 +1,49 @@ -+/* -+ * Copyright (c) 2015 NVIDIA, Corporation -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a copy -+ * of this software and associated documentation files (the "Software"), to deal -+ * in the Software without restriction, including without limitation the rights -+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -+ * copies of the Software, and to permit persons to whom the Software is -+ * furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ -+#include -+#include -+ -+static char * getenv_wrapper(const char *name) -+{ -+ if(getuid() == geteuid() && getgid() == getegid()) { -+ return getenv(name); -+ } -+ else { -+ return NULL; -+ } -+} -+ -+#ifndef HAVE_SECURE_GETENV -+# ifdef HAVE___SECURE_GETENV -+# define secure_getenv __secure_getenv -+# else -+# warning Neither secure_getenv nor __secure_getenv is available. -+# define secure_getenv getenv_wrapper -+# endif -+#endif -+ -diff --git a/src/vdpau_wrapper.c b/src/vdpau_wrapper.c -index 8efbd39..1daaacd 100644 ---- a/src/vdpau_wrapper.c -+++ b/src/vdpau_wrapper.c -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2008-2009 NVIDIA, Corporation -+ * Copyright (c) 2008-2015 NVIDIA, Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal -@@ -37,6 +37,7 @@ - #include "mesa_dri2.h" - #include - #endif -+#include "util.h" - - typedef void SetDllHandle( - void * driver_dll_handle -@@ -117,7 +118,12 @@ static VdpStatus _vdp_open_driver( - char const * vdpau_trace; - char const * func_name; - -- vdpau_driver = getenv("VDPAU_DRIVER"); -+ vdpau_driver = secure_getenv("VDPAU_DRIVER"); -+ if (vdpau_driver) { -+ if (strchr(vdpau_driver, '/')) { -+ vdpau_driver = NULL; -+ } -+ } - if (!vdpau_driver) { - vdpau_driver = vdpau_driver_dri2 = - _vdp_get_driver_name_from_dri2(display, screen); -@@ -126,15 +132,13 @@ static VdpStatus _vdp_open_driver( - vdpau_driver = "nvidia"; - } - -- if (geteuid() == getuid()) { -- /* don't allow setuid apps to use VDPAU_DRIVER_PATH */ -- vdpau_driver_path = getenv("VDPAU_DRIVER_PATH"); -- if (vdpau_driver_path && -- snprintf(vdpau_driver_lib, sizeof(vdpau_driver_lib), -- DRIVER_LIB_FORMAT, vdpau_driver_path, vdpau_driver) < -- sizeof(vdpau_driver_lib)) { -- _vdp_driver_dll = dlopen(vdpau_driver_lib, RTLD_NOW | RTLD_GLOBAL); -- } -+ /* Don't allow setuid apps to use VDPAU_DRIVER_PATH */ -+ vdpau_driver_path = secure_getenv("VDPAU_DRIVER_PATH"); -+ if (vdpau_driver_path && -+ snprintf(vdpau_driver_lib, sizeof(vdpau_driver_lib), -+ DRIVER_LIB_FORMAT, vdpau_driver_path, vdpau_driver) < -+ sizeof(vdpau_driver_lib)) { -+ _vdp_driver_dll = dlopen(vdpau_driver_lib, RTLD_NOW | RTLD_GLOBAL); - } - - /* Fallback to VDPAU_MODULEDIR when VDPAU_DRIVER_PATH is not set, -@@ -177,7 +181,7 @@ static VdpStatus _vdp_open_driver( - - _vdp_backend_dll = _vdp_driver_dll; - -- vdpau_trace = getenv("VDPAU_TRACE"); -+ vdpau_trace = secure_getenv("VDPAU_TRACE"); - if (vdpau_trace && atoi(vdpau_trace)) { - SetDllHandle * set_dll_handle; - -diff --git a/trace/vdpau_trace.cpp b/trace/vdpau_trace.cpp -index 6e204b8..2c3e8c5 100644 ---- a/trace/vdpau_trace.cpp -+++ b/trace/vdpau_trace.cpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 2008-2009 NVIDIA, Corporation -+ * Copyright (c) 2008-2015 NVIDIA, Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal -@@ -31,6 +31,8 @@ - #include - #include - -+#include "../src/util.h" -+ - #define _VDP_TRACE_ARSIZE(_x_) ((sizeof (_x_)) / (sizeof ((_x_)[0]))) - - #if DEBUG -@@ -4795,13 +4797,13 @@ VdpStatus vdp_trace_device_create_x11( - } - else { - _vdp_cap_data.level = 0; -- char const * vdpau_trace = getenv("VDPAU_TRACE"); -+ char const * vdpau_trace = secure_getenv("VDPAU_TRACE"); - if (vdpau_trace) { - _vdp_cap_data.level = atoi(vdpau_trace); - } - - _vdp_cap_data.fp = 0; -- char const * vdpau_trace_file = getenv("VDPAU_TRACE_FILE"); -+ char const * vdpau_trace_file = secure_getenv("VDPAU_TRACE_FILE"); - if (vdpau_trace_file && strlen(vdpau_trace_file)) { - if (vdpau_trace_file[0] == '&') { - int fd = atoi(&vdpau_trace_file[1]); --- -1.7.10.4 - diff --git a/SPECS/libvdpau.spec b/SPECS/libvdpau.spec index d7faf72..d3002b8 100644 --- a/SPECS/libvdpau.spec +++ b/SPECS/libvdpau.spec @@ -1,10 +1,13 @@ Name: libvdpau -Version: 1.1 -Release: 2%{?dist} +Version: 1.1.1 +Release: 3%{?dist} Summary: Wrapper library for the Video Decode and Presentation API License: MIT URL: http://freedesktop.org/wiki/Software/VDPAU -Source0: http://cgit.freedesktop.org/~aplattner/%{name}/snapshot/%{name}-%{version}.tar.bz2 +Source0: http://cgit.freedesktop.org/vdpau/libvdpau/snapshot/%{name}-%{version}.tar.bz2 +Patch0: 0001-mesa_dri2-Add-missing-include-of-config.h-to-define-.patch +Patch1: 0002-util.h-Make-getenv_wrapper-static-inline.patch +Patch2: 0003-Fix-doc-error-on-displayable-surface-types.patch BuildRequires: autoconf BuildRequires: automake @@ -20,8 +23,6 @@ BuildRequires: tetex-latex %endif BuildRequires: xorg-x11-proto-devel -Patch0: Use-secure_getenv-3-to-improve-security.patch - %description VDPAU is the Video Decode and Presentation API for UNIX. It provides an interface to video decode acceleration and presentation hardware present in @@ -48,7 +49,9 @@ applications that use %{name}. %prep %setup -q -%patch0 -p1 -b .cve20155198-5199-5200 +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build autoreconf -vif @@ -83,12 +86,29 @@ mv doc/html-out html %{_libdir}/pkgconfig/vdpau.pc %changelog -* Thu Aug 27 2015 Benjamin Tissoires 1.1-2 +* Thu Feb 04 2016 Fedora Release Engineering - 1.1.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Oct 02 2015 Nicolas Chauvet - 1.1.1-2 +- Backport current patches +- Switch to new upstream git repository on freedesktop.org + +* Tue Sep 01 2015 Nicolas Chauvet - 1.1.1-1 +- Update to 1.1.1 + Security fix for CVE-2015-5198, CVE-2015-5199, CVE-2015-5200 + +* Thu Aug 27 2015 Benjamin Tissoires - Resolves rhbz #1253829 - fix 3 CVEs: - CVE-2015-5198: libvdpau incorrect check for security transition - CVE-2015-5199: libvdpau directory traversal in dlopen - CVE-2015-5200: libvdpau vulnerability in trace functionality +* Wed Jun 17 2015 Fedora Release Engineering - 1.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat May 02 2015 Kalev Lember - 1.1-2 +- Rebuilt for GCC 5 C++11 ABI change + * Tue Mar 17 2015 Nicolas Chauvet - 1.1-1 - Update to 1.1