import CS freerdp-3.10.3-5.el10
This commit is contained in:
parent
327256c363
commit
540193191c
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
FreeRDP-3.6.3-repack.tar.gz
|
||||
FreeRDP-3.10.3-repack.tar.gz
|
||||
|
||||
52
Default-minimum-thread-count.patch
Normal file
52
Default-minimum-thread-count.patch
Normal file
@ -0,0 +1,52 @@
|
||||
From 0e6c921b206259474b1c14bb26b183a8b2089cdb Mon Sep 17 00:00:00 2001
|
||||
From: akallabeth <akallabeth@posteo.net>
|
||||
Date: Fri, 12 Sep 2025 08:25:16 +0200
|
||||
Subject: [PATCH 082/100] [winpr,threadpool] default minimum thread count
|
||||
|
||||
Set a default minimum of 4 threads in a pool. Avoids issues with system
|
||||
running with a single processor (might lead to deadlocks if the code
|
||||
assumes > 1 thread handling stuff)
|
||||
---
|
||||
winpr/libwinpr/pool/CMakeLists.txt | 2 ++
|
||||
winpr/libwinpr/pool/pool.c | 9 +++++++--
|
||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/winpr/libwinpr/pool/CMakeLists.txt b/winpr/libwinpr/pool/CMakeLists.txt
|
||||
index cfa9bc891..6b5938fd0 100644
|
||||
--- a/winpr/libwinpr/pool/CMakeLists.txt
|
||||
+++ b/winpr/libwinpr/pool/CMakeLists.txt
|
||||
@@ -16,7 +16,9 @@
|
||||
# limitations under the License.
|
||||
|
||||
set(WINPR_THREADPOOL_DEFAULT_MAX_COUNT "16" CACHE STRING "The maximum (default) number of threads in a pool")
|
||||
+set(WINPR_THREADPOOL_DEFAULT_MIN_COUNT "4" CACHE STRING "The minimum (default) number of threads in a pool")
|
||||
winpr_definition_add(WINPR_THREADPOOL_DEFAULT_MAX_COUNT=${WINPR_THREADPOOL_DEFAULT_MAX_COUNT})
|
||||
+winpr_definition_add(WINPR_THREADPOOL_DEFAULT_MIN_COUNT=${WINPR_THREADPOOL_DEFAULT_MIN_COUNT})
|
||||
winpr_module_add(
|
||||
synch.c
|
||||
work.c
|
||||
diff --git a/winpr/libwinpr/pool/pool.c b/winpr/libwinpr/pool/pool.c
|
||||
index 96db6b247..cbfc274c5 100644
|
||||
--- a/winpr/libwinpr/pool/pool.c
|
||||
+++ b/winpr/libwinpr/pool/pool.c
|
||||
@@ -127,10 +127,15 @@ static BOOL InitializeThreadpool(PTP_POOL pool)
|
||||
obj = ArrayList_Object(pool->Threads);
|
||||
obj->fnObjectFree = threads_close;
|
||||
|
||||
+#if !defined(WINPR_THREADPOOL_DEFAULT_MIN_COUNT)
|
||||
+#error "WINPR_THREADPOOL_DEFAULT_MIN_COUNT must be defined"
|
||||
+#endif
|
||||
+
|
||||
SYSTEM_INFO info = { 0 };
|
||||
GetSystemInfo(&info);
|
||||
- if (info.dwNumberOfProcessors < 1)
|
||||
- info.dwNumberOfProcessors = 1;
|
||||
+ if (info.dwNumberOfProcessors < WINPR_THREADPOOL_DEFAULT_MIN_COUNT)
|
||||
+ info.dwNumberOfProcessors = WINPR_THREADPOOL_DEFAULT_MIN_COUNT;
|
||||
+
|
||||
if (!SetThreadpoolThreadMinimum(pool, info.dwNumberOfProcessors))
|
||||
goto fail;
|
||||
|
||||
--
|
||||
2.51.0
|
||||
|
||||
64
Initialize-function-pointers-after-resource-allocation.patch
Normal file
64
Initialize-function-pointers-after-resource-allocation.patch
Normal file
@ -0,0 +1,64 @@
|
||||
From a4bb702aa62e4fad91ca99142de075265555ec18 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
|
||||
Date: Tue, 13 May 2025 10:34:08 +0200
|
||||
Subject: [PATCH] transport: Initialize function pointers after resource
|
||||
allocation
|
||||
|
||||
The transport instance is freed when an error occurs.
|
||||
If the TransportDisconnect function pointer is initialized it
|
||||
causes SIGSEGV during free.
|
||||
|
||||
CVE: CVE-2025-4478
|
||||
---
|
||||
libfreerdp/core/transport.c | 28 ++++++++++++++--------------
|
||||
1 file changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c
|
||||
index d199c31be..2ca146f65 100644
|
||||
--- a/libfreerdp/core/transport.c
|
||||
+++ b/libfreerdp/core/transport.c
|
||||
@@ -1646,20 +1646,6 @@ rdpTransport* transport_new(rdpContext* context)
|
||||
if (!transport->log)
|
||||
goto fail;
|
||||
|
||||
- // transport->io.DataHandler = transport_data_handler;
|
||||
- transport->io.TCPConnect = freerdp_tcp_default_connect;
|
||||
- transport->io.TLSConnect = transport_default_connect_tls;
|
||||
- transport->io.TLSAccept = transport_default_accept_tls;
|
||||
- transport->io.TransportAttach = transport_default_attach;
|
||||
- transport->io.TransportDisconnect = transport_default_disconnect;
|
||||
- transport->io.ReadPdu = transport_default_read_pdu;
|
||||
- transport->io.WritePdu = transport_default_write;
|
||||
- transport->io.ReadBytes = transport_read_layer;
|
||||
- transport->io.GetPublicKey = transport_default_get_public_key;
|
||||
- transport->io.SetBlockingMode = transport_default_set_blocking_mode;
|
||||
- transport->io.ConnectLayer = transport_default_connect_layer;
|
||||
- transport->io.AttachLayer = transport_default_attach_layer;
|
||||
-
|
||||
transport->context = context;
|
||||
transport->ReceivePool = StreamPool_New(TRUE, BUFFER_SIZE);
|
||||
|
||||
@@ -1698,6 +1684,20 @@ rdpTransport* transport_new(rdpContext* context)
|
||||
if (!InitializeCriticalSectionAndSpinCount(&(transport->WriteLock), 4000))
|
||||
goto fail;
|
||||
|
||||
+ // transport->io.DataHandler = transport_data_handler;
|
||||
+ transport->io.TCPConnect = freerdp_tcp_default_connect;
|
||||
+ transport->io.TLSConnect = transport_default_connect_tls;
|
||||
+ transport->io.TLSAccept = transport_default_accept_tls;
|
||||
+ transport->io.TransportAttach = transport_default_attach;
|
||||
+ transport->io.TransportDisconnect = transport_default_disconnect;
|
||||
+ transport->io.ReadPdu = transport_default_read_pdu;
|
||||
+ transport->io.WritePdu = transport_default_write;
|
||||
+ transport->io.ReadBytes = transport_read_layer;
|
||||
+ transport->io.GetPublicKey = transport_default_get_public_key;
|
||||
+ transport->io.SetBlockingMode = transport_default_set_blocking_mode;
|
||||
+ transport->io.ConnectLayer = transport_default_connect_layer;
|
||||
+ transport->io.AttachLayer = transport_default_attach_layer;
|
||||
+
|
||||
return transport;
|
||||
fail:
|
||||
WINPR_PRAGMA_DIAG_PUSH
|
||||
--
|
||||
2.49.0
|
||||
|
||||
51
Limit-minimum-threadpool-size.patch
Normal file
51
Limit-minimum-threadpool-size.patch
Normal file
@ -0,0 +1,51 @@
|
||||
From 8fc7acbfd0a1892bc9237ae25e99d32270812dcc Mon Sep 17 00:00:00 2001
|
||||
From: akallabeth <akallabeth@posteo.net>
|
||||
Date: Mon, 29 Sep 2025 08:37:06 +0200
|
||||
Subject: [PATCH] [winpr,pool] limit minimum threadpool size
|
||||
|
||||
---
|
||||
winpr/libwinpr/pool/pool.c | 20 ++++++++++++--------
|
||||
1 file changed, 12 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/winpr/libwinpr/pool/pool.c b/winpr/libwinpr/pool/pool.c
|
||||
index cbfc274c5..2cbe9a4fa 100644
|
||||
--- a/winpr/libwinpr/pool/pool.c
|
||||
+++ b/winpr/libwinpr/pool/pool.c
|
||||
@@ -129,22 +129,26 @@ static BOOL InitializeThreadpool(PTP_POOL pool)
|
||||
|
||||
#if !defined(WINPR_THREADPOOL_DEFAULT_MIN_COUNT)
|
||||
#error "WINPR_THREADPOOL_DEFAULT_MIN_COUNT must be defined"
|
||||
+#endif
|
||||
+#if !defined(WINPR_THREADPOOL_DEFAULT_MAX_COUNT)
|
||||
+#error "WINPR_THREADPOOL_DEFAULT_MAX_COUNT must be defined"
|
||||
#endif
|
||||
|
||||
SYSTEM_INFO info = { 0 };
|
||||
GetSystemInfo(&info);
|
||||
+
|
||||
+ DWORD min = info.dwNumberOfProcessors;
|
||||
+ DWORD max = info.dwNumberOfProcessors;
|
||||
if (info.dwNumberOfProcessors < WINPR_THREADPOOL_DEFAULT_MIN_COUNT)
|
||||
- info.dwNumberOfProcessors = WINPR_THREADPOOL_DEFAULT_MIN_COUNT;
|
||||
+ min = WINPR_THREADPOOL_DEFAULT_MIN_COUNT;
|
||||
+ if (info.dwNumberOfProcessors > WINPR_THREADPOOL_DEFAULT_MAX_COUNT)
|
||||
+ max = WINPR_THREADPOOL_DEFAULT_MAX_COUNT;
|
||||
+ if (min > max)
|
||||
+ min = max;
|
||||
|
||||
- if (!SetThreadpoolThreadMinimum(pool, info.dwNumberOfProcessors))
|
||||
+ if (!SetThreadpoolThreadMinimum(pool, min))
|
||||
goto fail;
|
||||
|
||||
-#if !defined(WINPR_THREADPOOL_DEFAULT_MAX_COUNT)
|
||||
-#error "WINPR_THREADPOOL_DEFAULT_MAX_COUNT must be defined"
|
||||
-#endif
|
||||
- DWORD max = info.dwNumberOfProcessors;
|
||||
- if (max > WINPR_THREADPOOL_DEFAULT_MAX_COUNT)
|
||||
- max = WINPR_THREADPOOL_DEFAULT_MAX_COUNT;
|
||||
SetThreadpoolThreadMaximum(pool, max);
|
||||
|
||||
rc = TRUE;
|
||||
--
|
||||
2.51.0
|
||||
|
||||
60
Limit-threadpool-to-16-threads.patch
Normal file
60
Limit-threadpool-to-16-threads.patch
Normal file
@ -0,0 +1,60 @@
|
||||
From c2fc455d8f2dc60de35ed98cb300b7e6a84fe383 Mon Sep 17 00:00:00 2001
|
||||
From: Armin Novak <armin.novak@thincast.com>
|
||||
Date: Wed, 3 Sep 2025 14:03:10 +0200
|
||||
Subject: [PATCH 066/100] [winpr,pool] limit threadpool to 16 threads by
|
||||
default
|
||||
|
||||
Initialize the threadpool to minimum of number of processors and 16 by
|
||||
default.
|
||||
---
|
||||
winpr/libwinpr/pool/CMakeLists.txt | 2 ++
|
||||
winpr/libwinpr/pool/pool.c | 13 +++++++++----
|
||||
2 files changed, 11 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/winpr/libwinpr/pool/CMakeLists.txt b/winpr/libwinpr/pool/CMakeLists.txt
|
||||
index fb2dee58f..cfa9bc891 100644
|
||||
--- a/winpr/libwinpr/pool/CMakeLists.txt
|
||||
+++ b/winpr/libwinpr/pool/CMakeLists.txt
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
+set(WINPR_THREADPOOL_DEFAULT_MAX_COUNT "16" CACHE STRING "The maximum (default) number of threads in a pool")
|
||||
+winpr_definition_add(WINPR_THREADPOOL_DEFAULT_MAX_COUNT=${WINPR_THREADPOOL_DEFAULT_MAX_COUNT})
|
||||
winpr_module_add(
|
||||
synch.c
|
||||
work.c
|
||||
diff --git a/winpr/libwinpr/pool/pool.c b/winpr/libwinpr/pool/pool.c
|
||||
index 39bbaaac9..96db6b247 100644
|
||||
--- a/winpr/libwinpr/pool/pool.c
|
||||
+++ b/winpr/libwinpr/pool/pool.c
|
||||
@@ -133,7 +133,14 @@ static BOOL InitializeThreadpool(PTP_POOL pool)
|
||||
info.dwNumberOfProcessors = 1;
|
||||
if (!SetThreadpoolThreadMinimum(pool, info.dwNumberOfProcessors))
|
||||
goto fail;
|
||||
- SetThreadpoolThreadMaximum(pool, info.dwNumberOfProcessors);
|
||||
+
|
||||
+#if !defined(WINPR_THREADPOOL_DEFAULT_MAX_COUNT)
|
||||
+#error "WINPR_THREADPOOL_DEFAULT_MAX_COUNT must be defined"
|
||||
+#endif
|
||||
+ DWORD max = info.dwNumberOfProcessors;
|
||||
+ if (max > WINPR_THREADPOOL_DEFAULT_MAX_COUNT)
|
||||
+ max = WINPR_THREADPOOL_DEFAULT_MAX_COUNT;
|
||||
+ SetThreadpoolThreadMaximum(pool, max);
|
||||
|
||||
rc = TRUE;
|
||||
|
||||
@@ -143,9 +150,7 @@ fail:
|
||||
|
||||
PTP_POOL GetDefaultThreadpool(void)
|
||||
{
|
||||
- PTP_POOL pool = NULL;
|
||||
-
|
||||
- pool = &DEFAULT_POOL;
|
||||
+ PTP_POOL pool = &DEFAULT_POOL;
|
||||
|
||||
if (!InitializeThreadpool(pool))
|
||||
return NULL;
|
||||
--
|
||||
2.51.0
|
||||
|
||||
321
Use-default-threadpool.patch
Normal file
321
Use-default-threadpool.patch
Normal file
@ -0,0 +1,321 @@
|
||||
From 00968fd6e647af286e67bbd616168c4de7a39208 Mon Sep 17 00:00:00 2001
|
||||
From: Armin Novak <armin.novak@thincast.com>
|
||||
Date: Wed, 3 Sep 2025 14:40:47 +0200
|
||||
Subject: [PATCH 067/100] [codec] use default threadpool
|
||||
|
||||
Backported together with these commits to be applicable:
|
||||
[codec,yuv] fix thread count calculation
|
||||
- 17315c593655d476cccfb9a1b56e41f37030f8e1
|
||||
[codec,yuv] fix worker object handling
|
||||
- 1cc64eb58b2f5ce9e4ad8aa8610e085f696e578c
|
||||
Fix YUV conversion for systems with lots of CPUs
|
||||
- 774ee652a9c73c0bc3cdba26eba0c112f079cee4
|
||||
|
||||
---
|
||||
libfreerdp/codec/progressive.c | 5 ++-
|
||||
libfreerdp/codec/rfx.c | 56 +++++++---------------------------
|
||||
libfreerdp/codec/rfx_types.h | 6 ----
|
||||
libfreerdp/codec/yuv.c | 32 ++-----------------
|
||||
4 files changed, 16 insertions(+), 83 deletions(-)
|
||||
|
||||
diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c
|
||||
index 6396e0f2a..8b5200546 100644
|
||||
--- a/libfreerdp/codec/progressive.c
|
||||
+++ b/libfreerdp/codec/progressive.c
|
||||
@@ -1698,9 +1698,8 @@ static INLINE SSIZE_T progressive_process_tiles(
|
||||
|
||||
if (progressive->rfx_context->priv->UseThreads)
|
||||
{
|
||||
- progressive->work_objects[idx] =
|
||||
- CreateThreadpoolWork(progressive_process_tiles_tile_work_callback, (void*)param,
|
||||
- &progressive->rfx_context->priv->ThreadPoolEnv);
|
||||
+ progressive->work_objects[idx] = CreateThreadpoolWork(
|
||||
+ progressive_process_tiles_tile_work_callback, (void*)param, NULL);
|
||||
if (!progressive->work_objects[idx])
|
||||
{
|
||||
WLog_Print(progressive->log, WLOG_ERROR,
|
||||
diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c
|
||||
index 8832cd740..2ec4eb521 100644
|
||||
--- a/libfreerdp/codec/rfx.c
|
||||
+++ b/libfreerdp/codec/rfx.c
|
||||
@@ -205,16 +205,8 @@ RFX_CONTEXT* rfx_context_new(BOOL encoder)
|
||||
|
||||
RFX_CONTEXT* rfx_context_new_ex(BOOL encoder, UINT32 ThreadingFlags)
|
||||
{
|
||||
- HKEY hKey = NULL;
|
||||
- LONG status = 0;
|
||||
- DWORD dwType = 0;
|
||||
- DWORD dwSize = 0;
|
||||
- DWORD dwValue = 0;
|
||||
- SYSTEM_INFO sysinfo;
|
||||
- RFX_CONTEXT* context = NULL;
|
||||
- wObject* pool = NULL;
|
||||
RFX_CONTEXT_PRIV* priv = NULL;
|
||||
- context = (RFX_CONTEXT*)winpr_aligned_calloc(1, sizeof(RFX_CONTEXT), 32);
|
||||
+ RFX_CONTEXT* context = (RFX_CONTEXT*)winpr_aligned_calloc(1, sizeof(RFX_CONTEXT), 32);
|
||||
|
||||
if (!context)
|
||||
return NULL;
|
||||
@@ -233,7 +225,7 @@ RFX_CONTEXT* rfx_context_new_ex(BOOL encoder, UINT32 ThreadingFlags)
|
||||
if (!priv->TilePool)
|
||||
goto fail;
|
||||
|
||||
- pool = ObjectPool_Object(priv->TilePool);
|
||||
+ wObject* pool = ObjectPool_Object(priv->TilePool);
|
||||
pool->fnObjectInit = rfx_tile_init;
|
||||
|
||||
if (context->encoder)
|
||||
@@ -267,29 +259,22 @@ RFX_CONTEXT* rfx_context_new_ex(BOOL encoder, UINT32 ThreadingFlags)
|
||||
|
||||
if (!(ThreadingFlags & THREADING_FLAGS_DISABLE_THREADS))
|
||||
{
|
||||
+ HKEY hKey = NULL;
|
||||
priv->UseThreads = TRUE;
|
||||
|
||||
- GetNativeSystemInfo(&sysinfo);
|
||||
- priv->MinThreadCount = sysinfo.dwNumberOfProcessors;
|
||||
- priv->MaxThreadCount = 0;
|
||||
- status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, RFX_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
|
||||
+ const LONG status =
|
||||
+ RegOpenKeyExA(HKEY_LOCAL_MACHINE, RFX_KEY, 0, KEY_READ | KEY_WOW64_64KEY, &hKey);
|
||||
|
||||
if (status == ERROR_SUCCESS)
|
||||
{
|
||||
- dwSize = sizeof(dwValue);
|
||||
+ DWORD dwType = 0;
|
||||
+ DWORD dwValue = 0;
|
||||
+ DWORD dwSize = sizeof(dwValue);
|
||||
|
||||
if (RegQueryValueEx(hKey, _T("UseThreads"), NULL, &dwType, (BYTE*)&dwValue, &dwSize) ==
|
||||
ERROR_SUCCESS)
|
||||
priv->UseThreads = dwValue ? 1 : 0;
|
||||
|
||||
- if (RegQueryValueEx(hKey, _T("MinThreadCount"), NULL, &dwType, (BYTE*)&dwValue,
|
||||
- &dwSize) == ERROR_SUCCESS)
|
||||
- priv->MinThreadCount = dwValue;
|
||||
-
|
||||
- if (RegQueryValueEx(hKey, _T("MaxThreadCount"), NULL, &dwType, (BYTE*)&dwValue,
|
||||
- &dwSize) == ERROR_SUCCESS)
|
||||
- priv->MaxThreadCount = dwValue;
|
||||
-
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
}
|
||||
@@ -304,20 +289,6 @@ RFX_CONTEXT* rfx_context_new_ex(BOOL encoder, UINT32 ThreadingFlags)
|
||||
/* from multiple threads. This call will initialize all function pointers correctly */
|
||||
/* before any decoding threads are started */
|
||||
primitives_get();
|
||||
- priv->ThreadPool = CreateThreadpool(NULL);
|
||||
-
|
||||
- if (!priv->ThreadPool)
|
||||
- goto fail;
|
||||
-
|
||||
- InitializeThreadpoolEnvironment(&priv->ThreadPoolEnv);
|
||||
- SetThreadpoolCallbackPool(&priv->ThreadPoolEnv, priv->ThreadPool);
|
||||
-
|
||||
- if (priv->MinThreadCount)
|
||||
- if (!SetThreadpoolThreadMinimum(priv->ThreadPool, priv->MinThreadCount))
|
||||
- goto fail;
|
||||
-
|
||||
- if (priv->MaxThreadCount)
|
||||
- SetThreadpoolThreadMaximum(priv->ThreadPool, priv->MaxThreadCount);
|
||||
}
|
||||
|
||||
/* initialize the default pixel format */
|
||||
@@ -370,9 +341,6 @@ void rfx_context_free(RFX_CONTEXT* context)
|
||||
ObjectPool_Free(priv->TilePool);
|
||||
if (priv->UseThreads)
|
||||
{
|
||||
- if (priv->ThreadPool)
|
||||
- CloseThreadpool(priv->ThreadPool);
|
||||
- DestroyThreadpoolEnvironment(&priv->ThreadPoolEnv);
|
||||
winpr_aligned_free((void*)priv->workObjects);
|
||||
winpr_aligned_free(priv->tileWorkParams);
|
||||
#ifdef WITH_PROFILER
|
||||
@@ -1086,9 +1054,8 @@ static INLINE BOOL rfx_process_message_tileset(RFX_CONTEXT* WINPR_RESTRICT conte
|
||||
params[i].context = context;
|
||||
params[i].tile = message->tiles[i];
|
||||
|
||||
- if (!(work_objects[i] =
|
||||
- CreateThreadpoolWork(rfx_process_message_tile_work_callback,
|
||||
- (void*)¶ms[i], &context->priv->ThreadPoolEnv)))
|
||||
+ if (!(work_objects[i] = CreateThreadpoolWork(rfx_process_message_tile_work_callback,
|
||||
+ (void*)¶ms[i], NULL)))
|
||||
{
|
||||
WLog_Print(context->priv->log, WLOG_ERROR, "CreateThreadpoolWork failed.");
|
||||
rc = FALSE;
|
||||
@@ -1829,8 +1796,7 @@ RFX_MESSAGE* rfx_encode_message(RFX_CONTEXT* WINPR_RESTRICT context,
|
||||
workParam->tile = tile;
|
||||
|
||||
if (!(*workObject = CreateThreadpoolWork(rfx_compose_message_tile_work_callback,
|
||||
- (void*)workParam,
|
||||
- &context->priv->ThreadPoolEnv)))
|
||||
+ (void*)workParam, NULL)))
|
||||
{
|
||||
goto skip_encoding_loop;
|
||||
}
|
||||
diff --git a/libfreerdp/codec/rfx_types.h b/libfreerdp/codec/rfx_types.h
|
||||
index a9cd314da..c5a62259b 100644
|
||||
--- a/libfreerdp/codec/rfx_types.h
|
||||
+++ b/libfreerdp/codec/rfx_types.h
|
||||
@@ -69,11 +69,11 @@ struct S_RFX_CONTEXT_PRIV
|
||||
PTP_WORK* workObjects;
|
||||
RFX_TILE_COMPOSE_WORK_PARAM* tileWorkParams;
|
||||
|
||||
- DWORD MinThreadCount;
|
||||
+ DWORD MinThreadCount; /* Kept only to silence abidiff */
|
||||
- DWORD MaxThreadCount;
|
||||
+ DWORD MaxThreadCount; /* Kept only to silence abidiff */
|
||||
|
||||
- PTP_POOL ThreadPool;
|
||||
+ PTP_POOL ThreadPool; /* Kept only to silence abidiff */
|
||||
- TP_CALLBACK_ENVIRON ThreadPoolEnv;
|
||||
+ TP_CALLBACK_ENVIRON ThreadPoolEnv; /* Kept only to silence abidiff */
|
||||
|
||||
wBufferPool* BufferPool;
|
||||
|
||||
diff --git a/libfreerdp/codec/yuv.c b/libfreerdp/codec/yuv.c
|
||||
index 75d8a6a89..4025782dd 100644
|
||||
--- a/libfreerdp/codec/yuv.c
|
||||
+++ b/libfreerdp/codec/yuv.c
|
||||
@@ -55,11 +55,11 @@ struct S_YUV_CONTEXT
|
||||
UINT32 width, height;
|
||||
BOOL useThreads;
|
||||
BOOL encoder;
|
||||
- UINT32 nthreads;
|
||||
+ UINT32 nthreads; /* Kept only to silence abidiff */
|
||||
UINT32 heightStep;
|
||||
|
||||
- PTP_POOL threadPool;
|
||||
+ PTP_POOL threadPool; /* Kept only to silence abidiff */
|
||||
- TP_CALLBACK_ENVIRON ThreadPoolEnv;
|
||||
+ TP_CALLBACK_ENVIRON ThreadPoolEnv; /* Kept only to silence abidiff */
|
||||
|
||||
UINT32 work_object_count;
|
||||
PTP_WORK* work_objects;
|
||||
@@ -166,16 +162,21 @@ BOOL yuv_context_reset(YUV_CONTEXT* WINPR_RESTRICT context, UINT32 width, UINT32
|
||||
|
||||
context->width = width;
|
||||
context->height = height;
|
||||
- context->heightStep = (height / context->nthreads);
|
||||
+
|
||||
+ context->heightStep = height;
|
||||
|
||||
if (context->useThreads)
|
||||
{
|
||||
- const UINT32 pw = (width + TILE_SIZE - width % TILE_SIZE) / TILE_SIZE;
|
||||
- const UINT32 ph = (height + TILE_SIZE - height % TILE_SIZE) / TILE_SIZE;
|
||||
+ context->heightStep = 16;
|
||||
+ /* Preallocate workers for 16x16 tiles.
|
||||
+ * this is overallocation for most cases.
|
||||
+ *
|
||||
+ * ~2MB total for a 4k resolution, so negligible.
|
||||
+ */
|
||||
+ const size_t pw = (width + TILE_SIZE - width % TILE_SIZE) / 16;
|
||||
+ const size_t ph = (height + TILE_SIZE - height % TILE_SIZE) / 16;
|
||||
|
||||
- /* We´ve calculated the amount of workers for 64x64 tiles, but the decoder
|
||||
- * might get 16x16 tiles mixed in. */
|
||||
- const UINT32 count = pw * ph * 16;
|
||||
+ const size_t count = pw * ph;
|
||||
|
||||
context->work_object_count = 0;
|
||||
if (context->encoder)
|
||||
@@ -237,33 +234,13 @@ YUV_CONTEXT* yuv_context_new(BOOL encoder, UINT32 ThreadingFlags)
|
||||
primitives_get();
|
||||
|
||||
ret->encoder = encoder;
|
||||
- ret->nthreads = 1;
|
||||
if (!(ThreadingFlags & THREADING_FLAGS_DISABLE_THREADS))
|
||||
{
|
||||
GetNativeSystemInfo(&sysInfos);
|
||||
ret->useThreads = (sysInfos.dwNumberOfProcessors > 1);
|
||||
- if (ret->useThreads)
|
||||
- {
|
||||
- ret->nthreads = sysInfos.dwNumberOfProcessors;
|
||||
- ret->threadPool = CreateThreadpool(NULL);
|
||||
- if (!ret->threadPool)
|
||||
- {
|
||||
- goto error_threadpool;
|
||||
- }
|
||||
-
|
||||
- InitializeThreadpoolEnvironment(&ret->ThreadPoolEnv);
|
||||
- SetThreadpoolCallbackPool(&ret->ThreadPoolEnv, ret->threadPool);
|
||||
- }
|
||||
}
|
||||
|
||||
return ret;
|
||||
-
|
||||
-error_threadpool:
|
||||
- WINPR_PRAGMA_DIAG_PUSH
|
||||
- WINPR_PRAGMA_DIAG_IGNORED_MISMATCHED_DEALLOC
|
||||
- yuv_context_free(ret);
|
||||
- WINPR_PRAGMA_DIAG_POP
|
||||
- return NULL;
|
||||
}
|
||||
|
||||
void yuv_context_free(YUV_CONTEXT* context)
|
||||
@@ -272,9 +249,6 @@ void yuv_context_free(YUV_CONTEXT* context)
|
||||
return;
|
||||
if (context->useThreads)
|
||||
{
|
||||
- if (context->threadPool)
|
||||
- CloseThreadpool(context->threadPool);
|
||||
- DestroyThreadpoolEnvironment(&context->ThreadPoolEnv);
|
||||
winpr_aligned_free((void*)context->work_objects);
|
||||
winpr_aligned_free(context->work_combined_params);
|
||||
winpr_aligned_free(context->work_enc_params);
|
||||
@@ -330,7 +304,7 @@ static BOOL submit_object(PTP_WORK* WINPR_RESTRICT work_object, PTP_WORK_CALLBAC
|
||||
if (!param || !context)
|
||||
return FALSE;
|
||||
|
||||
- *work_object = CreateThreadpoolWork(cb, cnv.pv, &context->ThreadPoolEnv);
|
||||
+ *work_object = CreateThreadpoolWork(cb, cnv.pv, NULL);
|
||||
if (!*work_object)
|
||||
return FALSE;
|
||||
|
||||
@@ -439,11 +417,8 @@ static BOOL pool_decode(YUV_CONTEXT* WIN
|
||||
|
||||
if (context->work_object_count <= waitCount)
|
||||
{
|
||||
- WLog_ERR(TAG,
|
||||
- "YUV decoder: invalid number of tiles, only support less than %" PRIu32
|
||||
- ", got %" PRIu32,
|
||||
- context->work_object_count, waitCount);
|
||||
- goto fail;
|
||||
+ free_objects(context->work_objects, context->work_object_count);
|
||||
+ waitCount = 0;
|
||||
}
|
||||
|
||||
YUV_PROCESS_WORK_PARAM* cur = &context->work_dec_params[waitCount];
|
||||
@@ -586,11 +561,8 @@ static BOOL pool_decode_rect(YUV_CONTEXT
|
||||
|
||||
if (context->work_object_count <= waitCount)
|
||||
{
|
||||
- WLog_ERR(TAG,
|
||||
- "YUV rect decoder: invalid number of tiles, only support less than %" PRIu32
|
||||
- ", got %" PRIu32,
|
||||
- context->work_object_count, waitCount);
|
||||
- goto fail;
|
||||
+ free_objects(context->work_objects, context->work_object_count);
|
||||
+ waitCount = 0;
|
||||
}
|
||||
current = &context->work_combined_params[waitCount];
|
||||
*current = pool_decode_rect_param(®ionRects[waitCount], context, type, pYUVData, iStride,
|
||||
@@ -848,11 +820,8 @@ static BOOL pool_encode(YUV_CONTEXT* WIN
|
||||
|
||||
if (context->work_object_count <= waitCount)
|
||||
{
|
||||
- WLog_ERR(TAG,
|
||||
- "YUV encoder: invalid number of tiles, only support less than %" PRIu32
|
||||
- ", got %" PRIu32,
|
||||
- context->work_object_count, waitCount);
|
||||
- goto fail;
|
||||
+ free_objects(context->work_objects, context->work_object_count);
|
||||
+ waitCount = 0;
|
||||
}
|
||||
|
||||
current = &context->work_enc_params[waitCount];
|
||||
--
|
||||
2.51.0
|
||||
|
||||
64
freerdp.spec
64
freerdp.spec
@ -27,13 +27,10 @@
|
||||
# Disable support for AAD WebView popup since it uses webkit2gtk-4.0
|
||||
#global _with_webview 1
|
||||
|
||||
# FIXME: GCC 14.x says there's lots of incompatible pointer casts going on...
|
||||
%global build_type_safety_c 2
|
||||
|
||||
Name: freerdp
|
||||
Version: 3.6.3
|
||||
Release: 1%{?dist}
|
||||
Epoch: 2
|
||||
Version: 3.10.3
|
||||
Release: 5%{?dist}
|
||||
Summary: Free implementation of the Remote Desktop Protocol (RDP)
|
||||
|
||||
# The effective license is Apache-2.0 but:
|
||||
@ -50,6 +47,15 @@ URL: http://www.freerdp.com/
|
||||
Source0: FreeRDP-%{version}-repack.tar.gz
|
||||
Source1: freerdp_download_and_repack.sh
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2365232
|
||||
Patch0: Initialize-function-pointers-after-resource-allocation.patch
|
||||
|
||||
# https://issues.redhat.com/browse/RHEL-86251
|
||||
Patch1: Limit-threadpool-to-16-threads.patch
|
||||
Patch2: Use-default-threadpool.patch
|
||||
Patch3: Default-minimum-thread-count.patch
|
||||
Patch4: Limit-minimum-threadpool-size.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: alsa-lib-devel
|
||||
@ -85,6 +91,7 @@ BuildRequires: cmake(json-c)
|
||||
|
||||
BuildRequires: pkgconfig(cairo)
|
||||
BuildRequires: pkgconfig(krb5)
|
||||
BuildRequires: pkgconfig(fdk-aac)
|
||||
BuildRequires: pkgconfig(fuse3)
|
||||
BuildRequires: pkgconfig(libpcsclite)
|
||||
BuildRequires: pkgconfig(libpulse)
|
||||
@ -180,24 +187,26 @@ find . -name "*.h" -exec chmod 664 {} \;
|
||||
find . -name "*.c" -exec chmod 664 {} \;
|
||||
|
||||
%build
|
||||
%cmake %{?_cmake_skip_rpath} \
|
||||
%cmake \
|
||||
-DBUILD_TESTING=ON \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH=ON \
|
||||
-DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \
|
||||
-DWITH_ALSA=ON \
|
||||
-DWITH_AAD=ON \
|
||||
-DWITH_CAIRO=ON \
|
||||
-DWITH_CUPS=ON \
|
||||
-DWITH_CHANNELS=ON -DBUILTIN_CHANNELS=OFF \
|
||||
-DWITH_CHANNELS=ON \
|
||||
-DWITH_CLIENT=ON \
|
||||
-DWITH_CLIENT_SDL=%{?_with_sdl_client:ON}%{?!_with_sdl_client:OFF} \
|
||||
-DWITH_DIRECTFB=OFF \
|
||||
-DWITH_DSP_FFMPEG=%{?_with_ffmpeg:ON}%{?!_with_ffmpeg:OFF} \
|
||||
-DWITH_FDK_AAC=ON \
|
||||
-DWITH_FFMPEG=%{?_with_ffmpeg:ON}%{?!_with_ffmpeg:OFF} \
|
||||
-DWITH_FUSE=ON \
|
||||
-DWITH_GSM=ON \
|
||||
-DWITH_ICU=ON \
|
||||
-DWITH_IPP=OFF \
|
||||
-DWITH_JPEG=ON \
|
||||
-DWITH_JSONC_REQUIRED=ON \
|
||||
-DWITH_KEYBOARD_LAYOUT_FROM_FILE=ON \
|
||||
-DWITH_KRB5=ON \
|
||||
-DWITH_LAME=ON \
|
||||
-DWITH_MANPAGES=ON \
|
||||
@ -215,6 +224,8 @@ find . -name "*.c" -exec chmod 664 {} \;
|
||||
-DWITH_SHADOW_MAC=%{?_with_server:ON}%{?!_with_server:OFF} \
|
||||
-DWITH_SOXR=%{?_with_soxr:ON}%{?!_with_soxr:OFF} \
|
||||
-DWITH_SWSCALE=%{?_with_ffmpeg:ON}%{?!_with_ffmpeg:OFF} \
|
||||
-DWITH_TIMEZONE_COMPILED=OFF \
|
||||
-DWITH_TIMEZONE_FROM_FILE=ON \
|
||||
-DWITH_URIPARSER=%{?_with_uriparser:ON}%{?!_with_uriparser:OFF} \
|
||||
-DWITH_VIDEO_FFMPEG=%{?_with_ffmpeg:ON}%{?!_with_ffmpeg:OFF} \
|
||||
-DWITH_WAYLAND=ON \
|
||||
@ -255,6 +266,10 @@ find . -name "*.c" -exec chmod 664 {} \;
|
||||
|
||||
%cmake_build
|
||||
|
||||
%check
|
||||
export CTEST_OUTPUT_ON_FAILURE=1
|
||||
%cmake_build --target test
|
||||
|
||||
%install
|
||||
%cmake_install
|
||||
|
||||
@ -281,6 +296,7 @@ find %{buildroot} -name "*.a" -delete
|
||||
%files libs
|
||||
%license LICENSE
|
||||
%doc README.md ChangeLog
|
||||
%{_datadir}/FreeRDP/
|
||||
%{_libdir}/freerdp3/
|
||||
%{_libdir}/libfreerdp-client3.so.*
|
||||
%{?_with_server:
|
||||
@ -348,6 +364,7 @@ find %{buildroot} -name "*.a" -delete
|
||||
%files -n libwinpr
|
||||
%license LICENSE
|
||||
%doc README.md ChangeLog
|
||||
%{_datadir}/WinPR/
|
||||
%{_libdir}/libwinpr3.so.*
|
||||
%{_libdir}/libwinpr-tools3.so.*
|
||||
|
||||
@ -361,6 +378,35 @@ find %{buildroot} -name "*.a" -delete
|
||||
%{_libdir}/pkgconfig/winpr-tools3.pc
|
||||
|
||||
%changelog
|
||||
* Tue Sep 30 2025 Marek Kasik <mkasik@redhat.com> - 2:3.10.3-5
|
||||
- Silence abidiff
|
||||
- Resolves: RHEL-86251
|
||||
|
||||
* Mon Sep 29 2025 Marek Kasik <mkasik@redhat.com> - 2:3.10.3-4
|
||||
- Limit threadpool to 16 threads
|
||||
- Resolves: RHEL-86251
|
||||
|
||||
* Mon Jun 16 2025 Marek Kasik <mkasik@redhat.com> - 2:3.10.3-3
|
||||
- Initialize function pointers after resource allocation
|
||||
- Fixes CVE-2025-4478
|
||||
- Resolves: RHEL-91583
|
||||
|
||||
* Tue Dec 17 2024 Ondrej Holy <oholy@redhat.com> - 2:3.10.3-1
|
||||
- Update to 3.10.3
|
||||
|
||||
* Thu Nov 14 2024 Ondrej Holy <oholy@redhat.com> - 2:3.9.0-1
|
||||
- Update to 3.9.0
|
||||
|
||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 2:3.8.0-2
|
||||
- Bump release for October 2024 mass rebuild:
|
||||
Resolves: RHEL-64018
|
||||
|
||||
* Thu Sep 05 2024 Ondrej Holy <oholy@redhat.com> - 2:3.8.0-1
|
||||
- Update to 3.8.0
|
||||
|
||||
* Thu Aug 08 2024 Neal Gompa <ngompa@fedoraproject.org> - 2:3.7.0-1
|
||||
- Update to 3.7.0
|
||||
|
||||
* Fri Jul 26 2024 Ondrej Holy <oholy@redhat.com> - 2:3.6.3-1
|
||||
- Update to 3.6.3 (#2299253)
|
||||
|
||||
|
||||
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (FreeRDP-3.6.3-repack.tar.gz) = 45bf2c1eb8d30460a2beb20a2c784ac32767064568e09d5fa8b3d2121f22d4c566c362c3f91f522bb793882bb1cfa9c8fc02a22e695e182a69206267d789fd5c
|
||||
SHA512 (FreeRDP-3.10.3-repack.tar.gz) = cd007c28267e4b9ace47487f7d44061b03b029409fa167209bb1273f3d1b79fdd3ed96c855d78ccb03bdbedf452009e3a1a21189d282faffdfc3b2b504d03574
|
||||
|
||||
Loading…
Reference in New Issue
Block a user