aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2020-12-07 17:08:37 -0300
committerLeo <thinkabit.ukim@gmail.com>2020-12-07 17:08:37 -0300
commit0b2353932ca872b2f50451c3823bc424f2895892 (patch)
tree5da44aaae1fde8e3e0c3f4617bb4dcb3d3c9c679
parent80c7996fbd94cff4f9750554bed622c7dac1119d (diff)
downloadaports-0b2353932ca872b2f50451c3823bc424f2895892.tar.gz
aports-0b2353932ca872b2f50451c3823bc424f2895892.tar.bz2
aports-0b2353932ca872b2f50451c3823bc424f2895892.tar.xz
community/x11vnc: fix CVE-2020-29074 and build with -fno-common
See: #12173
-rw-r--r--community/x11vnc/APKBUILD15
-rw-r--r--community/x11vnc/CVE-2020-29074.patch22
-rw-r--r--community/x11vnc/gcc-10.patch44
3 files changed, 78 insertions, 3 deletions
diff --git a/community/x11vnc/APKBUILD b/community/x11vnc/APKBUILD
index c3d5039698..acf06e85b4 100644
--- a/community/x11vnc/APKBUILD
+++ b/community/x11vnc/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Tuan M. Hoang <tmhoang@flatglobe.org>
pkgname=x11vnc
pkgver=0.9.16
-pkgrel=1
+pkgrel=2
pkgdesc="VNC server for real X displays"
url="http://www.karlrunge.com/x11vnc/"
arch="all"
@@ -11,7 +11,14 @@ makedepends="openssl-dev libjpeg-turbo-dev avahi-dev libvncserver-dev
automake autoconf"
subpackages="$pkgname-doc"
source="x11vnc-$pkgver.tar.gz::https://github.com/LibVNC/x11vnc/archive/$pkgver.tar.gz
- 0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch"
+ 0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch
+ CVE-2020-29074.patch
+ gcc-10.patch
+ "
+
+# secfixes:
+# 0.9.16-r2:
+# - CVE-2020-29074
prepare() {
default_prepare
@@ -39,4 +46,6 @@ check() {
}
sha512sums="69f65ee312f8dede6051b401304987502a213c6c28c7f41e855734f11de1fae14d5d493dc9c28b2e4b7c0be55f8dbd3b35dd2610aae910183772c3e626736fec x11vnc-0.9.16.tar.gz
-7752f125b083ec2d8c778dcc460853d29cf62cd354dc454aa132d3eb1671ad4592923cca5360884cf86f25d989fa04db04120d5d70782d65164821d463107e2e 0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch"
+7752f125b083ec2d8c778dcc460853d29cf62cd354dc454aa132d3eb1671ad4592923cca5360884cf86f25d989fa04db04120d5d70782d65164821d463107e2e 0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch
+d2ee26414451a7e92b3c687c51abe74637cff247a264ebd46080dd570e05db3231425441e56b7ed4a39aa01b6f6ab600cf1b4c9a0216e8030983b43e1f609bda CVE-2020-29074.patch
+594c364c21ae7274e521dd44ee265f0330be788e7ec6995fc0fce09f3cfa9e1f3340931490df77a42bb7f6d8a6d67eb918174599a901b26b30df59cf20ab6af5 gcc-10.patch"
diff --git a/community/x11vnc/CVE-2020-29074.patch b/community/x11vnc/CVE-2020-29074.patch
new file mode 100644
index 0000000000..fcafb9fb79
--- /dev/null
+++ b/community/x11vnc/CVE-2020-29074.patch
@@ -0,0 +1,22 @@
+From 69eeb9f7baa14ca03b16c9de821f9876def7a36a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gu=C3=A9nal=20DAVALAN?= <guenal.davalan@uca.fr>
+Date: Wed, 18 Nov 2020 08:40:45 +0100
+Subject: [PATCH] scan: limit access to shared memory segments to current user
+
+---
+ src/scan.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/scan.c b/src/scan.c
+index 43e00d2..12994d5 100644
+--- a/src/scan.c
++++ b/src/scan.c
+@@ -320,7 +320,7 @@ static int shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
+
+ #if HAVE_XSHM
+ shm->shmid = shmget(IPC_PRIVATE,
+- xim->bytes_per_line * xim->height, IPC_CREAT | 0777);
++ xim->bytes_per_line * xim->height, IPC_CREAT | 0600);
+
+ if (shm->shmid == -1) {
+ rfbErr("shmget(%s) failed.\n", name);
diff --git a/community/x11vnc/gcc-10.patch b/community/x11vnc/gcc-10.patch
new file mode 100644
index 0000000000..95ba9b6de3
--- /dev/null
+++ b/community/x11vnc/gcc-10.patch
@@ -0,0 +1,44 @@
+From a48b0b1cd887d7f3ae67f525d7d334bd2feffe60 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Tue, 28 Jan 2020 22:21:01 +0300
+Subject: [PATCH] Fix build with -fno-common
+
+GCC 10 defaults to -fno-common
+---
+ src/util.c | 3 +++
+ src/util.h | 6 +++---
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/util.c b/src/util.c
+index a82a1a4..6a52ebf 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -47,6 +47,9 @@ int hxl = 0;
+ #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
+ MUTEX(x11Mutex);
+ MUTEX(scrollMutex);
++MUTEX(clientMutex);
++MUTEX(inputMutex);
++MUTEX(pointerMutex);
+ #endif
+
+ int nfix(int i, int n);
+diff --git a/src/util.h b/src/util.h
+index 35c1afd..99b5dd1 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -102,9 +102,9 @@ extern struct timeval _mysleep;
+ #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
+ extern MUTEX(x11Mutex);
+ extern MUTEX(scrollMutex);
+-MUTEX(clientMutex);
+-MUTEX(inputMutex);
+-MUTEX(pointerMutex);
++extern MUTEX(clientMutex);
++extern MUTEX(inputMutex);
++extern MUTEX(pointerMutex);
+ #endif
+
+ #define X_INIT INIT_MUTEX(x11Mutex)
+--
+2.24.1