Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
From e64fa928170f22a2e21b5bbd6d46c8f8e7dd7a96 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Matti=20Lehtim=C3=A4ki?= <matti.lehtimaki@jolla.com>
|
||||
Date: Tue, 13 May 2025 08:37:07 +0300
|
||||
Subject: [PATCH] CMake: require at least CMake 3.5
|
||||
|
||||
CMake 4 dropped support for version requirements < 3.5.
|
||||
|
||||
Fixes building with CMake >= 4.
|
||||
|
||||
Upstream: https://github.com/LibVNC/libvncserver/commit/e64fa928170f22a2e21b5bbd6d46c8f8e7dd7a96
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||||
---
|
||||
CMakeLists.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 205f3928..9b8118c8 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1,3 +1,3 @@
|
||||
-cmake_minimum_required(VERSION 3.4)
|
||||
+cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
set(PROJECT_LANGUAGES C)
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
From 009008e2f4d5a54dd71f422070df3af7b3dbc931 Mon Sep 17 00:00:00 2001
|
||||
From: Kazuma Matsumoto <269371721+y637F9QQ2x@users.noreply.github.com>
|
||||
Date: Sun, 22 Mar 2026 20:35:49 +0100
|
||||
Subject: [PATCH] libvncclient: add bounds checks to UltraZip subrectangle
|
||||
parsing
|
||||
|
||||
HandleUltraZipBPP() iterates over sub-rectangles using numCacheRects
|
||||
(derived from the attacker-controlled rect.r.x) without validating
|
||||
that the pointer stays within the decompressed data buffer. A malicious
|
||||
server can set a large numCacheRects value, causing heap out-of-bounds
|
||||
reads via the memcpy calls in the parsing loop.
|
||||
|
||||
Add bounds checks before reading the 12-byte subrect header and before
|
||||
advancing the pointer by the raw pixel data size. Use uint64_t for the
|
||||
raw data size calculation to prevent integer overflow on 32-bit platforms.
|
||||
|
||||
Upstream: https://github.com/LibVNC/libvncserver/commit/009008e2f4d5a54dd71f422070df3af7b3dbc931
|
||||
CVE: CVE-2026-32853
|
||||
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
||||
---
|
||||
src/libvncclient/ultra.c | 16 +++++++++++++++-
|
||||
1 file changed, 15 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libvncclient/ultra.c b/src/libvncclient/ultra.c
|
||||
index 1d3aaba6a..5633b8cbb 100644
|
||||
--- a/src/libvncclient/ultra.c
|
||||
+++ b/src/libvncclient/ultra.c
|
||||
@@ -126,6 +126,7 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
|
||||
int toRead=0;
|
||||
int inflateResult=0;
|
||||
unsigned char *ptr=NULL;
|
||||
+ unsigned char *ptr_end=NULL;
|
||||
lzo_uint uncompressedBytes = ry + (rw * 65535);
|
||||
unsigned int numCacheRects = rx;
|
||||
|
||||
@@ -194,11 +195,18 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
|
||||
|
||||
/* Put the uncompressed contents of the update on the screen. */
|
||||
ptr = (unsigned char *)client->raw_buffer;
|
||||
+ ptr_end = ptr + uncompressedBytes;
|
||||
for (i=0; i<numCacheRects; i++)
|
||||
{
|
||||
unsigned short sx, sy, sw, sh;
|
||||
unsigned int se;
|
||||
|
||||
+ /* subrect header: sx(2) + sy(2) + sw(2) + sh(2) + se(4) = 12 bytes */
|
||||
+ if (ptr + 12 > ptr_end) {
|
||||
+ rfbClientLog("UltraZip: subrect %d header exceeds decompressed data bounds\n", i);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
memcpy((char *)&sx, ptr, 2); ptr += 2;
|
||||
memcpy((char *)&sy, ptr, 2); ptr += 2;
|
||||
memcpy((char *)&sw, ptr, 2); ptr += 2;
|
||||
@@ -213,8 +221,13 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
|
||||
|
||||
if (se == rfbEncodingRaw)
|
||||
{
|
||||
+ uint64_t rawBytes = (uint64_t)sw * sh * (BPP / 8);
|
||||
+ if (rawBytes > (size_t)(ptr_end - ptr)) {
|
||||
+ rfbClientLog("UltraZip: subrect %d raw data exceeds decompressed data bounds\n", i);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
client->GotBitmap(client, (unsigned char *)ptr, sx, sy, sw, sh);
|
||||
- ptr += ((sw * sh) * (BPP / 8));
|
||||
+ ptr += (size_t)rawBytes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,3 +235,4 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
|
||||
}
|
||||
|
||||
#undef CARDBPP
|
||||
+
|
||||
@@ -0,0 +1,64 @@
|
||||
From dc78dee51a7e270e537a541a17befdf2073f5314 Mon Sep 17 00:00:00 2001
|
||||
From: Kazuma Matsumoto <269371721+y637F9QQ2x@users.noreply.github.com>
|
||||
Date: Thu, 19 Mar 2026 17:42:00 +0900
|
||||
Subject: [PATCH] libvncserver: fix NULL pointer dereferences in httpd proxy
|
||||
handlers
|
||||
|
||||
httpProcessInput() passes the return value of strchr() to atoi()
|
||||
and strncmp() without checking for NULL. If a CONNECT request
|
||||
contains no colon, or a GET request contains no slash, strchr()
|
||||
returns NULL, leading to a segmentation fault.
|
||||
|
||||
Add NULL checks before using the strchr() return values.
|
||||
|
||||
CVE: CVE-2026-32854
|
||||
Upstream: https://github.com/LibVNC/libvncserver/commit/dc78dee51a7e270e537a541a17befdf2073f5314
|
||||
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
||||
---
|
||||
src/libvncserver/httpd.c | 24 ++++++++++++++----------
|
||||
1 file changed, 14 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/libvncserver/httpd.c b/src/libvncserver/httpd.c
|
||||
index f4fe51c9..7cefadc4 100644
|
||||
--- a/src/libvncserver/httpd.c
|
||||
+++ b/src/libvncserver/httpd.c
|
||||
@@ -337,10 +337,11 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
|
||||
|
||||
|
||||
/* Process the request. */
|
||||
- if(rfbScreen->httpEnableProxyConnect) {
|
||||
+if(rfbScreen->httpEnableProxyConnect) {
|
||||
const static char* PROXY_OK_STR = "HTTP/1.0 200 OK\r\nContent-Type: octet-stream\r\nPragma: no-cache\r\n\r\n";
|
||||
if(!strncmp(buf, "CONNECT ", 8)) {
|
||||
- if(atoi(strchr(buf, ':')+1)!=rfbScreen->port) {
|
||||
+ char *colon = strchr(buf, ':');
|
||||
+ if(colon == NULL || atoi(colon+1)!=rfbScreen->port) {
|
||||
rfbErr("httpd: CONNECT format invalid.\n");
|
||||
rfbWriteExact(&cl,INVALID_REQUEST_STR, strlen(INVALID_REQUEST_STR));
|
||||
httpCloseSock(rfbScreen);
|
||||
@@ -353,14 +354,17 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
|
||||
rfbScreen->httpSock = RFB_INVALID_SOCKET;
|
||||
return;
|
||||
}
|
||||
- if (!strncmp(buf, "GET ",4) && !strncmp(strchr(buf,'/'),"/proxied.connection HTTP/1.", 27)) {
|
||||
- /* proxy connection */
|
||||
- rfbLog("httpd: client asked for /proxied.connection\n");
|
||||
- rfbWriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR));
|
||||
- rfbNewClientConnection(rfbScreen,rfbScreen->httpSock);
|
||||
- rfbScreen->httpSock = RFB_INVALID_SOCKET;
|
||||
- return;
|
||||
- }
|
||||
+ if (!strncmp(buf, "GET ",4)) {
|
||||
+ char *slash = strchr(buf, '/');
|
||||
+ if (slash != NULL && !strncmp(slash,"/proxied.connection HTTP/1.", 27)) {
|
||||
+ /* proxy connection */
|
||||
+ rfbLog("httpd: client asked for /proxied.connection\n");
|
||||
+ rfbWriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR));
|
||||
+ rfbNewClientConnection(rfbScreen,rfbScreen->httpSock);
|
||||
+ rfbScreen->httpSock = RFB_INVALID_SOCKET;
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
if (strncmp(buf, "GET ", 4)) {
|
||||
38
package/libvncserver/Config.in
Normal file
38
package/libvncserver/Config.in
Normal file
@@ -0,0 +1,38 @@
|
||||
config BR2_PACKAGE_LIBVNCSERVER
|
||||
bool "libvncserver"
|
||||
depends on BR2_USE_MMU # VNCommand.c uses fork()
|
||||
depends on !BR2_STATIC_LIBS
|
||||
select BR2_PACKAGE_LZO
|
||||
select BR2_PACKAGE_LIBOPENSSL_ENABLE_DES if BR2_PACKAGE_LIBOPENSSL
|
||||
help
|
||||
libvncserver is a VNC server/client library.
|
||||
|
||||
https://libvnc.github.io/
|
||||
|
||||
if BR2_PACKAGE_LIBVNCSERVER
|
||||
|
||||
config BR2_PACKAGE_LIBVNCSERVER_TIGHTPNG
|
||||
bool "TightPNG encoding support"
|
||||
select BR2_PACKAGE_JPEG
|
||||
select BR2_PACKAGE_LIBPNG
|
||||
help
|
||||
TightPNG encoding speeds up HTML5 based VNC clients like
|
||||
noVNC.
|
||||
|
||||
http://wiki.qemu.org/VNC_Tight_PNG
|
||||
|
||||
config BR2_PACKAGE_LIBVNCSERVER_WEBSOCKETS
|
||||
bool "WebSockets support"
|
||||
help
|
||||
Enable WebSocket support (e.g. for noVNC)
|
||||
|
||||
config BR2_PACKAGE_LIBVNCSERVER_INSTALL_STOREPASSSWD
|
||||
bool "storepasswd tool"
|
||||
help
|
||||
Install storepasswd tool used to create VNC passwords
|
||||
|
||||
endif
|
||||
|
||||
comment "libvncserver needs a toolchain w/ dynamic library"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_STATIC_LIBS
|
||||
3
package/libvncserver/libvncserver.hash
Normal file
3
package/libvncserver/libvncserver.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally computed:
|
||||
sha256 62352c7795e231dfce044beb96156065a05a05c974e5de9e023d688d8ff675d7 libvncserver-0.9.15.tar.gz
|
||||
sha256 4d23c8c814e5baf007d854f01d8502e77dc56a41144934e003fb32c4e052d20f COPYING
|
||||
110
package/libvncserver/libvncserver.mk
Normal file
110
package/libvncserver/libvncserver.mk
Normal file
@@ -0,0 +1,110 @@
|
||||
################################################################################
|
||||
#
|
||||
# libvncserver
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LIBVNCSERVER_VERSION = 0.9.15
|
||||
LIBVNCSERVER_SITE = $(call github,LibVNC,libvncserver,LibVNCServer-$(LIBVNCSERVER_VERSION))
|
||||
LIBVNCSERVER_LICENSE = GPL-2.0+
|
||||
LIBVNCSERVER_LICENSE_FILES = COPYING
|
||||
LIBVNCSERVER_CPE_ID_VALID = YES
|
||||
LIBVNCSERVER_INSTALL_STAGING = YES
|
||||
LIBVNCSERVER_DEPENDENCIES = host-pkgconf lzo
|
||||
LIBVNCSERVER_CONF_OPTS = -DWITH_LZO=ON
|
||||
|
||||
# 0002-add-bounds-checks-to-UltraZip-subrectangle-parsing.patch
|
||||
LIBVNCSERVER_IGNORE_CVES += CVE-2026-32853
|
||||
|
||||
# 0003-fix-NULL-pointer-dereferences-in-httpd-proxy-handlers.patch
|
||||
LIBVNCSERVER_IGNORE_CVES += CVE-2026-32854
|
||||
|
||||
# only used for examples
|
||||
LIBVNCSERVER_CONF_OPTS += \
|
||||
-DWITH_FFMPEG=OFF \
|
||||
-DWITH_GTK=OFF \
|
||||
-DWITH_SDL=OFF \
|
||||
-DWITH_TESTS=OFF
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_THREADS=ON
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_THREADS=OFF
|
||||
endif
|
||||
|
||||
# openssl supports needs NPTL thread support
|
||||
ifeq ($(BR2_PACKAGE_OPENSSL)$(BR2_TOOLCHAIN_HAS_THREADS_NPTL),yy)
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_OPENSSL=ON
|
||||
LIBVNCSERVER_DEPENDENCIES += openssl
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_OPENSSL=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_GCRYPT=ON
|
||||
LIBVNCSERVER_DEPENDENCIES += libgcrypt
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_GCRYPT=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_GNUTLS)$(BR2_PACKAGE_LIBGCRYPT),yy)
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_GNUTLS=ON
|
||||
LIBVNCSERVER_DEPENDENCIES += gnutls
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_GNUTLS=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_JPEG),y)
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_JPEG=ON
|
||||
LIBVNCSERVER_DEPENDENCIES += jpeg
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_JPEG=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBPNG),y)
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_PNG=ON
|
||||
LIBVNCSERVER_DEPENDENCIES += libpng
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_PNG=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_SYSTEMD=ON
|
||||
LIBVNCSERVER_DEPENDENCIES += systemd
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_SYSTEMD=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ZLIB),y)
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_ZLIB=ON
|
||||
LIBVNCSERVER_DEPENDENCIES += zlib
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_ZLIB=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBVNCSERVER_WEBSOCKETS),y)
|
||||
HBT_LIBVNCSERVER_CONF_OPTS += -DWITH_WEBSOCKETS=ON
|
||||
|
||||
define LIBVNCSERVER_INSTALL_VNC
|
||||
$(INSTALL) -D -m 644 $(@D)/webclients/index.vnc \
|
||||
$(TARGET_DIR)/usr/share/vnc/index.vnc
|
||||
endef
|
||||
|
||||
LIBVNCSERVER_POST_INSTALL_TARGET_HOOKS += LIBVNCSERVER_INSTALL_VNC
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_WEBSOCKETS=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBVNCSERVER_INSTALL_STOREPASSSWD),y)
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_EXAMPLES=ON
|
||||
define LIBVNCSERVER_INSTALL_STOREPASSWD
|
||||
$(INSTALL) -D -m 0755 $(@D)/examples/server/storepasswd \
|
||||
$(TARGET_DIR)/usr/bin/storepasswd
|
||||
endef
|
||||
|
||||
LIBVNCSERVER_POST_INSTALL_TARGET_HOOKS += LIBVNCSERVER_INSTALL_STOREPASSWD
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPTS += -DWITH_EXAMPLES=OFF
|
||||
endif
|
||||
|
||||
$(eval $(cmake-package))
|
||||
Reference in New Issue
Block a user