Hello community,

here is the log from the commit of package LibVNCServer for openSUSE:Factory 
checked in at 2020-01-12 23:18:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/LibVNCServer (Old)
 and      /work/SRC/openSUSE:Factory/.LibVNCServer.new.6675 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "LibVNCServer"

Sun Jan 12 23:18:05 2020 rev:40 rq:762624 version:0.9.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/LibVNCServer/LibVNCServer.changes        
2019-11-08 15:21:53.830751767 +0100
+++ /work/SRC/openSUSE:Factory/.LibVNCServer.new.6675/LibVNCServer.changes      
2020-01-12 23:18:30.186685625 +0100
@@ -1,0 +2,7 @@
+Fri Jan 10 08:24:05 UTC 2020 - Fabian Vogt <[email protected]>
+
+- Add patches to fix crash on shutdown:
+  * avoid-pthread_join-if-backgroundLoop-is-FALSE.patch
+  * fix-crash-on-shutdown.patch
+
+-------------------------------------------------------------------

New:
----
  avoid-pthread_join-if-backgroundLoop-is-FALSE.patch
  fix-crash-on-shutdown.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ LibVNCServer.spec ++++++
--- /var/tmp/diff_new_pack.B4ggL0/_old  2020-01-12 23:18:32.442686459 +0100
+++ /var/tmp/diff_new_pack.B4ggL0/_new  2020-01-12 23:18:32.482686473 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package LibVNCServer
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -34,6 +34,10 @@
 Patch2:         LibVNCServer-CVE-2018-20749.patch
 # CVE-2019-15681 [bsc#1155419]
 Patch3:         LibVNCServer-CVE-2019-15681.patch
+# PATCH-FIX-UPSTREAM: 
https://github.com/LibVNC/libvncserver/commit/d0a76539835d11c0f4723499f8be4bc9c7724eb9
+Patch4:         avoid-pthread_join-if-backgroundLoop-is-FALSE.patch
+# PATCH-FIX-UPSTREAM: https://github.com/LibVNC/libvncserver/pull/361
+Patch5:         fix-crash-on-shutdown.patch
 BuildRequires:  cmake
 BuildRequires:  gcc-c++
 BuildRequires:  libavahi-devel
@@ -103,6 +107,8 @@
 %patch0 -p1
 %patch1 -p1
 %patch3 -p1
+%patch4 -p1
+%patch5 -p1
 #%patch2 -p1
 # fix encoding
 for file in ChangeLog ; do

++++++ avoid-pthread_join-if-backgroundLoop-is-FALSE.patch ++++++
>From d0a76539835d11c0f4723499f8be4bc9c7724eb9 Mon Sep 17 00:00:00 2001
From: Rajesh Sahoo <[email protected]>
Date: Tue, 11 Jun 2019 15:13:04 +0530
Subject: [PATCH] avoid pthread_join if backgroundLoop is FALSE

client_thread is created depending upon backgroundLoop, but joining
without checking for same condition. so we are trying to join a garbage
thread_id.
---
 libvncserver/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libvncserver/main.c b/libvncserver/main.c
index d3cd9b1e..772fb18f 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -1112,6 +1112,7 @@ void rfbShutdownServer(rfbScreenInfoPtr screen,rfbBool 
disconnectClients) {
       }
 
 #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
+    if(currentCl->screen->backgroundLoop) {
       /*
        Notify the thread. This simply writes a NULL byte to the notify pipe in 
order to get past the select()
        in clientInput(), the loop in there will then break because the 
rfbCloseClient() above has set
@@ -1120,6 +1121,7 @@ void rfbShutdownServer(rfbScreenInfoPtr screen,rfbBool 
disconnectClients) {
       write(currentCl->pipe_notify_client_thread[1], "\x00", 1);
       /* And wait for it to finish. */
       pthread_join(currentCl->client_thread, NULL);
+    }
 #else
       rfbClientConnectionGone(currentCl);
 #endif
++++++ fix-crash-on-shutdown.patch ++++++
>From 15c4f144a3783d9f1f2c976acf9f4d85988fd466 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <[email protected]>
Date: Sun, 5 Jan 2020 19:56:57 +0100
Subject: [PATCH] rfbShutdownServer: Call rfbClientConnectionGone if no
 backgroundLoop

Otherwise the servers that don't use rfbRunEventLoop don't get
notified of client disconnections
---
 libvncserver/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libvncserver/main.c b/libvncserver/main.c
index b51f0ab6..738a501d 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -1152,6 +1152,8 @@ void rfbShutdownServer(rfbScreenInfoPtr screen,rfbBool 
disconnectClients) {
       write(currentCl->pipe_notify_client_thread[1], "\x00", 1);
       /* And wait for it to finish. */
       pthread_join(currentCl->client_thread, NULL);
+    } else {
+      rfbClientConnectionGone(currentCl);
     }
 #else
       rfbClientConnectionGone(currentCl);

Reply via email to