diff options
-rw-r--r-- | meta-multimedia/recipes-connectivity/libupnp/libupnp/CVE-2016-8863.patch | 57 | ||||
-rw-r--r-- | meta-multimedia/recipes-connectivity/libupnp/libupnp/avoid-redefining-strnlen-and-strndup.patch | 47 | ||||
-rw-r--r-- | meta-multimedia/recipes-connectivity/libupnp/libupnp/sepbuildfix.patch | 38 | ||||
-rw-r--r-- | meta-multimedia/recipes-connectivity/libupnp/libupnp_1.6.21.bb (renamed from meta-multimedia/recipes-connectivity/libupnp/libupnp_1.6.19.bb) | 6 |
4 files changed, 8 insertions, 140 deletions
diff --git a/meta-multimedia/recipes-connectivity/libupnp/libupnp/CVE-2016-8863.patch b/meta-multimedia/recipes-connectivity/libupnp/libupnp/CVE-2016-8863.patch deleted file mode 100644 index abb4a72a41..0000000000 --- a/meta-multimedia/recipes-connectivity/libupnp/libupnp/CVE-2016-8863.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | libupnp-1.6.19: Fix CVE-2016-8863 | ||
2 | |||
3 | [No upstream tracking] -- https://bugzilla.redhat.com/show_bug.cgi?id=1388771 | ||
4 | |||
5 | gena_device: Fix out-of-bound access in create_url_list() | ||
6 | |||
7 | If there is an invalid URL in URLS->buf after a valid one, uri_parse is | ||
8 | called with out pointing after the allocated memory. As uri_parse writes | ||
9 | to *out before returning an error the loop in create_url_list must be | ||
10 | stopped early to prevent an out-of-bound access | ||
11 | |||
12 | Upstream-Status: Backported [https://sourceforge.net/p/pupnp/code/ci/9c099c2923ab4d98530ab5204af1738be5bddba7] | ||
13 | CVE: CVE-2016-8863 | ||
14 | Signed-off-by: Andrej Valek <andrej.valek@siemens.com> | ||
15 | Signed-off-by: Pascal Bach <pascal.bach@siemens.com> | ||
16 | |||
17 | diff --git a/upnp/src/gena/gena_device.c b/upnp/src/gena/gena_device.c | ||
18 | index 39edc0b..0fd60ad 100644 | ||
19 | --- a/upnp/src/gena/gena_device.c | ||
20 | +++ b/upnp/src/gena/gena_device.c | ||
21 | @@ -1133,7 +1133,7 @@ static int create_url_list( | ||
22 | /*! [out] . */ | ||
23 | URL_list *out) | ||
24 | { | ||
25 | - size_t URLcount = 0; | ||
26 | + size_t URLcount = 0, URLcount2 = 0; | ||
27 | size_t i; | ||
28 | int return_code = 0; | ||
29 | uri_type temp; | ||
30 | @@ -1175,16 +1175,23 @@ static int create_url_list( | ||
31 | } | ||
32 | memcpy( out->URLs, URLS->buff, URLS->size ); | ||
33 | out->URLs[URLS->size] = 0; | ||
34 | - URLcount = 0; | ||
35 | for( i = 0; i < URLS->size; i++ ) { | ||
36 | if( ( URLS->buff[i] == '<' ) && ( i + 1 < URLS->size ) ) { | ||
37 | if( ( ( return_code = | ||
38 | parse_uri( &out->URLs[i + 1], URLS->size - i + 1, | ||
39 | - &out->parsedURLs[URLcount] ) ) == | ||
40 | + &out->parsedURLs[URLcount2] ) ) == | ||
41 | HTTP_SUCCESS ) | ||
42 | - && ( out->parsedURLs[URLcount].hostport.text.size != | ||
43 | + && ( out->parsedURLs[URLcount2].hostport.text.size != | ||
44 | 0 ) ) { | ||
45 | - URLcount++; | ||
46 | + URLcount2++; | ||
47 | + if (URLcount2 >= URLcount) | ||
48 | + /* | ||
49 | + * break early here in case there is a bogus URL that | ||
50 | + * was skipped above. This prevents to access | ||
51 | + * out->parsedURLs[URLcount] which is beyond the | ||
52 | + * allocation. | ||
53 | + */ | ||
54 | + break; | ||
55 | } else { | ||
56 | if( return_code == UPNP_E_OUTOF_MEMORY ) { | ||
57 | free( out->URLs ); | ||
diff --git a/meta-multimedia/recipes-connectivity/libupnp/libupnp/avoid-redefining-strnlen-and-strndup.patch b/meta-multimedia/recipes-connectivity/libupnp/libupnp/avoid-redefining-strnlen-and-strndup.patch deleted file mode 100644 index 3c3f230a34..0000000000 --- a/meta-multimedia/recipes-connectivity/libupnp/libupnp/avoid-redefining-strnlen-and-strndup.patch +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | From 22fba4f2765f92cd592a58e1fe5c450b187e30e1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andre McCurdy <armccurdy@gmail.com> | ||
3 | Date: Wed, 3 Jun 2015 21:39:03 -0700 | ||
4 | Subject: [PATCH] avoid redefining strnlen() and strndup() | ||
5 | |||
6 | Rely on string.h definitions instead. Workaround for compiler errors such as: | ||
7 | |||
8 | | i686-rdk-linux-libtool: compile: i686-rdk-linux-gcc -m32 -march=atom -mtune=atom -fschedule-insns -fsched-pressure -msse3 -mfpmath=sse --sysroot=/home/andre/build/tmp/sysroots/7401 -DHAVE_CONFIG_H -I. -I/home/andre/build/tmp/work/core2-32-rdk-linux/libupnp/1.6.19-r0/libupnp-1.6.19/upnp -I.. -I../upnp/inc -I/home/andre/build/tmp/work/core2-32-rdk-linux/libupnp/1.6.19-r0/libupnp-1.6.19/upnp/inc -I/home/andre/build/tmp/work/core2-32-rdk-linux/libupnp/1.6.19-r0/libupnp-1.6.19/threadutil/inc -I/home/andre/build/tmp/work/core2-32-rdk-linux/libupnp/1.6.19-r0/libupnp-1.6.19/ixml/inc -I/home/andre/build/tmp/work/core2-32-rdk-linux/libupnp/1.6.19-r0/libupnp-1.6.19/upnp/src/inc -pthread -O2 -pipe -g -feliminate-unused-debug-types -Os -Wall -c /home/andre/build/tmp/work/core2-32-rdk-linux/libupnp/1.6.19-r0/libupnp-1.6.19/upnp/src/gena/gena_callback2.c -o src/gena/libupnp_la-gena_callback2.o >/dev/null 2>&1 | ||
9 | | In file included from /home/andre/build/tmp/sysroots/7401/usr/include/string.h:634:0, | ||
10 | | from /home/andre/build/tmp/work/core2-32-rdk-linux/libupnp/1.6.19-r0/libupnp-1.6.19/upnp/src/api/UpnpString.c:23: | ||
11 | | /home/andre/build/tmp/work/core2-32-rdk-linux/libupnp/1.6.19-r0/libupnp-1.6.19/upnp/src/api/UpnpString.c:47:15: error: expected identifier or '(' before '__extension__' | ||
12 | | extern char *strndup(__const char *__string, size_t __n); | ||
13 | | ^ | ||
14 | | make[3]: *** [src/api/libupnp_la-UpnpString.lo] Error 1 | ||
15 | |||
16 | Upstream-Status: Pending | ||
17 | |||
18 | Signed-off-by: Andre McCurdy <armccurdy@gmail.com> | ||
19 | --- | ||
20 | upnp/src/api/UpnpString.c | 4 ++-- | ||
21 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/upnp/src/api/UpnpString.c b/upnp/src/api/UpnpString.c | ||
24 | index 41c9898..2fa09d7 100644 | ||
25 | --- a/upnp/src/api/UpnpString.c | ||
26 | +++ b/upnp/src/api/UpnpString.c | ||
27 | @@ -32,7 +32,7 @@ | ||
28 | /* VC has strnlen which is already included but with (potentially) different linkage */ | ||
29 | /* strnlen() is a GNU extension. */ | ||
30 | #if HAVE_STRNLEN | ||
31 | - extern size_t strnlen(const char *s, size_t maxlen); | ||
32 | +// extern size_t strnlen(const char *s, size_t maxlen); | ||
33 | #else /* HAVE_STRNLEN */ | ||
34 | static size_t strnlen(const char *s, size_t n) | ||
35 | { | ||
36 | @@ -44,7 +44,7 @@ | ||
37 | |||
38 | /* strndup() is a GNU extension. */ | ||
39 | #if HAVE_STRNDUP && !defined(WIN32) | ||
40 | - extern char *strndup(__const char *__string, size_t __n); | ||
41 | +// extern char *strndup(__const char *__string, size_t __n); | ||
42 | #else /* HAVE_STRNDUP && !defined(WIN32) */ | ||
43 | static char *strndup(const char *__string, size_t __n) | ||
44 | { | ||
45 | -- | ||
46 | 1.9.1 | ||
47 | |||
diff --git a/meta-multimedia/recipes-connectivity/libupnp/libupnp/sepbuildfix.patch b/meta-multimedia/recipes-connectivity/libupnp/libupnp/sepbuildfix.patch index cd9768d542..0493cea0e0 100644 --- a/meta-multimedia/recipes-connectivity/libupnp/libupnp/sepbuildfix.patch +++ b/meta-multimedia/recipes-connectivity/libupnp/libupnp/sepbuildfix.patch | |||
@@ -7,54 +7,28 @@ Upstream-Status: Pending | |||
7 | 7 | ||
8 | Signed-off-by: Andre McCurdy <armccurdy@gmail.com> | 8 | Signed-off-by: Andre McCurdy <armccurdy@gmail.com> |
9 | --- | 9 | --- |
10 | configure.ac | 8 ++++---- | 10 | configure.ac | 10 +++++----- |
11 | ixml/Makefile.am | 2 +- | 11 | 1 files changed, 5 insertions(+), 5 deletions(-) |
12 | threadutil/Makefile.am | 2 +- | ||
13 | 3 files changed, 6 insertions(+), 6 deletions(-) | ||
14 | 12 | ||
15 | diff --git a/configure.ac b/configure.ac | 13 | diff --git a/configure.ac b/configure.ac |
16 | index e2c3f47..11d5e22 100644 | 14 | index a8731b5..54a3c3d 100644 |
17 | --- a/configure.ac | 15 | --- a/configure.ac |
18 | +++ b/configure.ac | 16 | +++ b/configure.ac |
19 | @@ -714,8 +714,8 @@ AC_OUTPUT | 17 | @@ -744,9 +744,9 @@ AC_OUTPUT |
20 | # | 18 | # |
21 | # Files copied for windows compilation. | 19 | # Files copied for windows compilation. |
22 | # | 20 | # |
23 | -echo "configure: copying \"autoconfig.h\" to \"build/inc/autoconfig.h\"" | 21 | -echo "configure: copying \"autoconfig.h\" to \"build/inc/autoconfig.h\"" |
22 | -test -d build/inc || mkdir -p build/inc | ||
24 | -cp autoconfig.h build/inc/autoconfig.h | 23 | -cp autoconfig.h build/inc/autoconfig.h |
25 | -echo "configure: copying \"upnp/inc/upnpconfig.h\" to \"build/inc/upnpconfig.h\"" | 24 | -echo "configure: copying \"upnp/inc/upnpconfig.h\" to \"build/inc/upnpconfig.h\"" |
26 | -cp upnp/inc/upnpconfig.h build/inc/upnpconfig.h | 25 | -cp upnp/inc/upnpconfig.h build/inc/upnpconfig.h |
27 | +echo "configure: copying \"autoconfig.h\" to \"\$srcdir/build/inc/autoconfig.h\"" | 26 | +echo "configure: copying \"autoconfig.h\" to \"\$srcdir/build/inc/autoconfig.h\"" |
27 | +test -d $srcdir/build/inc || mkdir -p $srcdir/build/inc | ||
28 | +cp autoconfig.h $srcdir/build/inc/autoconfig.h | 28 | +cp autoconfig.h $srcdir/build/inc/autoconfig.h |
29 | +echo "configure: copying \"upnp/inc/upnpconfig.h\" to \"\$srcdir/build/inc/upnpconfig.h\"" | 29 | +echo "configure: copying \"upnp/inc/upnpconfig.h\" to \"\$srcdir/build/inc/upnpconfig.h\"" |
30 | +cp upnp/inc/upnpconfig.h $srcdir/build/inc/upnpconfig.h | 30 | +cp upnp/inc/upnpconfig.h $srcdir/build/inc/upnpconfig.h |
31 | 31 | ||
32 | diff --git a/ixml/Makefile.am b/ixml/Makefile.am | ||
33 | index 49da766..0e9ab2c 100644 | ||
34 | --- a/ixml/Makefile.am | ||
35 | +++ b/ixml/Makefile.am | ||
36 | @@ -7,7 +7,7 @@ | ||
37 | |||
38 | SUBDIRS = doc | ||
39 | |||
40 | -AM_CPPFLAGS = -I$(srcdir)/inc -I$(srcdir)/src/inc | ||
41 | +AM_CPPFLAGS = -I$(top_srcdir)/upnp/inc -I$(srcdir)/inc -I$(srcdir)/src/inc | ||
42 | AM_CFLAGS = | ||
43 | |||
44 | LDADD = libixml.la | ||
45 | diff --git a/threadutil/Makefile.am b/threadutil/Makefile.am | ||
46 | index a4ed325..42d0726 100644 | ||
47 | --- a/threadutil/Makefile.am | ||
48 | +++ b/threadutil/Makefile.am | ||
49 | @@ -4,7 +4,7 @@ | ||
50 | # (C) Copyright 2005 Remi Turboult <r3mi@users.sourceforge.net> | ||
51 | # | ||
52 | |||
53 | -AM_CPPFLAGS = -I$(srcdir)/inc -I$(srcdir)/src/inc | ||
54 | +AM_CPPFLAGS = -I$(top_srcdir)/upnp/inc -I$(srcdir)/inc -I$(srcdir)/src/inc | ||
55 | |||
56 | if ENABLE_DEBUG | ||
57 | AM_CPPFLAGS += -DDEBUG -DSTATS | ||
58 | -- | 32 | -- |
59 | 1.9.1 | 33 | 1.9.1 |
60 | 34 | ||
diff --git a/meta-multimedia/recipes-connectivity/libupnp/libupnp_1.6.19.bb b/meta-multimedia/recipes-connectivity/libupnp/libupnp_1.6.21.bb index 71fc70dd19..a1988295ae 100644 --- a/meta-multimedia/recipes-connectivity/libupnp/libupnp_1.6.19.bb +++ b/meta-multimedia/recipes-connectivity/libupnp/libupnp_1.6.21.bb | |||
@@ -9,12 +9,10 @@ LICENSE = "BSD" | |||
9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=b3190d5244e08e78e4c8ee78544f4863" | 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=b3190d5244e08e78e4c8ee78544f4863" |
10 | 10 | ||
11 | SRC_URI = "${SOURCEFORGE_MIRROR}/pupnp/${BP}.tar.bz2 \ | 11 | SRC_URI = "${SOURCEFORGE_MIRROR}/pupnp/${BP}.tar.bz2 \ |
12 | file://avoid-redefining-strnlen-and-strndup.patch \ | ||
13 | file://sepbuildfix.patch \ | 12 | file://sepbuildfix.patch \ |
14 | file://CVE-2016-8863.patch \ | ||
15 | " | 13 | " |
16 | 14 | ||
17 | SRC_URI[md5sum] = "ee16e5d33a3ea7506f38d71facc057dd" | 15 | SRC_URI[md5sum] = "513adadb07fa039a8aeb0ceb7b7b0f6e" |
18 | SRC_URI[sha256sum] = "b3142b39601243b50532eec90f4a27dba85eb86f58d4b849ac94edeb29d9b22a" | 16 | SRC_URI[sha256sum] = "af3f3c0846a1d75baeadae4aa5a2bda427567e2a1fb4559bf73ccff0a4f9a39b" |
19 | 17 | ||
20 | inherit autotools | 18 | inherit autotools |