Switch system distro build to FreeRDP 3.x (3.26.0) (Phase 3 / 3)#1454
Switch system distro build to FreeRDP 3.x (3.26.0) (Phase 3 / 3)#1454benhillis wants to merge 2 commits into
Conversation
Bump FREERDP_VERSION from 2 to 3 in the Dockerfile and adjust the FreeRDP cmake invocation for upstream FreeRDP 3.x defaults. Also fix a small WinPR API drift in WSLGd. Dockerfile: * ARG FREERDP_VERSION=2 -> =3 (also flips debuginfo strip target from FreeRDP2.list to FreeRDP3.list). * New cmake flags (each became REQUIRED-by-default in 3.x and is not desired for WSLg): - -DWITH_FFMPEG=OFF - -DWITH_DSP_FFMPEG=OFF - -DWITH_VIDEO_FFMPEG=OFF - -DWITH_SWSCALE=OFF - -DWITH_KRB5=OFF * The legacy -DWITH_CHANNEL_GFXREDIR=ON / -DWITH_CHANNEL_RDPAPPLIST=ON flags are dropped: WITH_CHANNEL_GFXREDIR is vestigial in upstream FreeRDP 3.x (the cmakedefine exists in config.h.in but is not set by any cmake logic), and rdpapplist is not a FreeRDP channel at all (the rdpapplist plugin is built standalone from wslg/rdpapplist/). Replaced with -DCHANNEL_GFXREDIR=ON which is the correct upstream knob for enabling the gfxredir dynamic channel (default OFF). WSLGd: * IniFile_GetSectionKeyNames(..., size_t* count) signature change in WinPR 3.x (was int*). Guarded with #if WINPR_VERSION_MAJOR >= 3 so the file still compiles against WinPR 2.x. Added explicit #include <winpr/version.h> in precomp.h. This commit by itself is a no-op against the existing microsoft/FreeRDP-mirror (FreeRDP 2.4.0-era) used by CI. It activates once the corresponding wslg-build PR points the FreeRDP repo resource at FreeRDP/FreeRDP@3.26.0. Coordinated with: * microsoft/weston-mirror#163 -- ports the weston rdp-backend to FreeRDP 3.x server API * microsoft/wslg-build PR (to be opened) -- switches the FreeRDP repo resource from microsoft/FreeRDP-mirror to FreeRDP/FreeRDP Validation: end-to-end Docker build succeeds against FreeRDP 3.26.0; libfreerdp-server3.so.3.26.0 ships, exports gfxredir_server_context_ {new,free}, and rdp-backend.so links correctly against the 3.x libs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Migrates WSLg system distro build scaffolding toward upstream FreeRDP 3.x (3.26.0), including Docker build configuration updates and a small WinPR API compatibility change in WSLGd.
Changes:
- Update Dockerfile to default to FreeRDP v3 and adjust FreeRDP CMake feature knobs for 3.x.
- Make WSLGd compile against WinPR 2.x and 3.x by handling the
IniFile_GetSectionKeyNamescount type change. - Add WinPR version header include to support version-based compilation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Dockerfile | Defaults build to FreeRDP 3 and updates FreeRDP CMake options to match 3.x expectations. |
| WSLGd/main.cpp | Adapts to WinPR 3.x signature change for INI key enumeration count type. |
| WSLGd/precomp.h | Includes WinPR version header needed for WINPR_VERSION_MAJOR checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ARG WESTON_COMMIT="<unknown>" | ||
| ARG SYSTEMDISTRO_DEBUG_BUILD | ||
| ARG FREERDP_VERSION=2 | ||
| ARG FREERDP_VERSION=3 |
| -DCMAKE_BUILD_TYPE=${BUILDTYPE_FREERDP} \ | ||
| -DWITH_DEBUG_ALL=${WITH_DEBUG_FREERDP} \ | ||
| -DWITH_ICU=ON \ | ||
| -DWITH_FFMPEG=OFF \ | ||
| -DWITH_DSP_FFMPEG=OFF \ | ||
| -DWITH_VIDEO_FFMPEG=OFF \ | ||
| -DWITH_SWSCALE=OFF \ | ||
| -DWITH_KRB5=OFF \ | ||
| -DWITH_SERVER=ON \ | ||
| -DWITH_CHANNEL_GFXREDIR=ON \ | ||
| -DWITH_CHANNEL_RDPAPPLIST=ON \ | ||
| -DCHANNEL_GFXREDIR=ON \ | ||
| -DWITH_CLIENT=OFF \ | ||
| -DWITH_CLIENT_COMMON=OFF \ | ||
| -DWITH_CLIENT_CHANNELS=OFF \ |
The Dockerfile now builds against FreeRDP 3.26.0 (FREERDP_VERSION=3 + upstream FreeRDP source via wslg-build), but cgmanifest.json still listed the old 2.x commit 39f56443. This caused Component Governance scanning to report the wrong dependency version and would have raised false vulnerability alerts against retired FreeRDP 2.x. Update CommitHash to match the actual FreeRDP 3.26.0 release tag shipped in this image. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Addressed code-review finding: This was non-functional (wouldn't have broken the build) but would have made Component Governance scanning report the wrong upstream version and potentially raise stale CVE alerts against retired FreeRDP 2.x. |
Switch the WSLg system distro build from the FreeRDP 2.4.0-era
microsoft/FreeRDP-mirrorfork to upstream FreeRDP 3.x (tag3.26.0).This is PR 1 of 3 in a coordinated migration. PR 2 (
microsoft/weston-mirror#163) ports the weston rdp-backend to the FreeRDP 3.x server API. PR 3 (to be opened) will switch the ADO pipeline's FreeRDP repo resource frommicrosoft/FreeRDP-mirrortoFreeRDP/FreeRDP@3.26.0. This PR alone is a no-op against the current pipeline.Why
The WSLg-pinned
microsoft/FreeRDP-mirror'sworkingbranch is built from a fork of FreeRDP 2.4.0 (Aug 2023), and the upstream 2.x line was declared EOL by the FreeRDP project. Only 3.x is supported. Tracking advisories from 2023-08 onward: 11 HIGH-severity CVEs in 2026 alone (e.g. CVE-2026-26955 OOB write, CVE-2026-31806 nsc heap overflow, CVE-2026-44420 cliprdr server heap overflow, CVE-2026-45700 planar bitmap decoder overflow). All are patched only in 3.x. Since WSLg runs the server side of RDP, the cliprdr / rdpgfx / cache PDU handlers in particular are reachable from a malicious or compromised mstsc client over TCP loopback or vsock.Diff
DockerfileARG FREERDP_VERSION=2->=3(also flips the debuginfo strip target fromFreeRDP2.listtoFreeRDP3.list).-DWITH_FFMPEG=OFF-DWITH_DSP_FFMPEG=OFF-DWITH_VIDEO_FFMPEG=OFF-DWITH_SWSCALE=OFF-DWITH_KRB5=OFF-DWITH_CHANNEL_GFXREDIR=ONand-DWITH_CHANNEL_RDPAPPLIST=ON.WITH_CHANNEL_GFXREDIRis vestigial in upstream FreeRDP 3.x (thecmakedefineexists inconfig.h.inbut no cmake logic ever sets it);rdpapplistis not a FreeRDP channel at all (the rdpapplist plugin is built standalone fromwslg/rdpapplist/). Replaced with-DCHANNEL_GFXREDIR=ON, the correct upstream knob for enabling the gfxredir dynamic channel (default OFF).WSLGd/main.cpp+WSLGd/precomp.hIniFile_GetSectionKeyNames(..., size_t* count)signature change in WinPR 3.x (wasint*). Guarded with#if WINPR_VERSION_MAJOR >= 3so the file still compiles against WinPR 2.x. Added explicit#include <winpr/version.h>inprecomp.h.Validation
End-to-end Docker build of the system distro succeeds against
FreeRDP/FreeRDP@3.26.0. Verified in the built image:/usr/lib/libfreerdp3.so.3.26.0/usr/lib/libwinpr3.so.3.26.0/usr/lib/libfreerdp-server3.so.3.26.0, exportsgfxredir_server_context_{new,free},audin_server_context_new,rdpsnd_server_context_new, etc./usr/lib/rdpapplist/librdpapplist-server.so, exportsrdpapplist_server_context_{new,free}./usr/lib/libweston-9/rdp-backend.solinks againstlibfreerdp3.so.3/libwinpr3.so.3/libfreerdp-server3.so.3.Runtime smoke test (xfreerdp loopback + Windows mstsc) is pending and will be performed before any of the three PRs is marked "Ready for review".
Known limitations (tracked as follow-up)
audin_server_context/rdpsnd_server_contextAPIs were rewritten in 3.x to a PDU-callback model; the wslg port is in flight in rdp-backend: port to FreeRDP 3.x server API (Phase 3 / 3) weston-mirror#163 as a stub commit and a proper port will land before that PR is marked Ready.cert-file/key-file) currently errors out on FreeRDP 3.x. WSLg in production uses the session-generated TLS path via Hyper-V vsock, which is fully functional.