Skip to content

Switch system distro build to FreeRDP 3.x (3.26.0) (Phase 3 / 3)#1454

Draft
benhillis wants to merge 2 commits into
mainfrom
user/benhill/freerdp-3x-port
Draft

Switch system distro build to FreeRDP 3.x (3.26.0) (Phase 3 / 3)#1454
benhillis wants to merge 2 commits into
mainfrom
user/benhill/freerdp-3x-port

Conversation

@benhillis
Copy link
Copy Markdown
Member

Switch the WSLg system distro build from the FreeRDP 2.4.0-era microsoft/FreeRDP-mirror fork to upstream FreeRDP 3.x (tag 3.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 from microsoft/FreeRDP-mirror to FreeRDP/FreeRDP@3.26.0. This PR alone is a no-op against the current pipeline.

Why

The WSLg-pinned microsoft/FreeRDP-mirror's working branch 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

Dockerfile      | 10 +++++++---
WSLGd/main.cpp  |  6 +++++-
WSLGd/precomp.h |  1 +
3 files changed, 13 insertions(+), 4 deletions(-)

Dockerfile

  • ARG FREERDP_VERSION=2 -> =3 (also flips the 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
  • Removed -DWITH_CHANNEL_GFXREDIR=ON and -DWITH_CHANNEL_RDPAPPLIST=ON. WITH_CHANNEL_GFXREDIR is vestigial in upstream FreeRDP 3.x (the cmakedefine exists in config.h.in but no cmake logic ever sets it); rdpapplist is not a FreeRDP channel at all (the rdpapplist plugin is built standalone from wslg/rdpapplist/). Replaced with -DCHANNEL_GFXREDIR=ON, the correct upstream knob for enabling the gfxredir dynamic channel (default OFF).

WSLGd/main.cpp + WSLGd/precomp.h

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.

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, exports gfxredir_server_context_{new,free}, audin_server_context_new, rdpsnd_server_context_new, etc.
  • /usr/lib/rdpapplist/librdpapplist-server.so, exports rdpapplist_server_context_{new,free}.
  • /usr/lib/libweston-9/rdp-backend.so links against libfreerdp3.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)

  • RDP audio is disabled on FreeRDP 3.x. The audin_server_context / rdpsnd_server_context APIs 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.
  • The file-cert TLS path (rdp.ini 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.

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>
Copilot AI review requested due to automatic review settings May 19, 2026 18:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_GetSectionKeyNames count 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.

Comment thread Dockerfile
ARG WESTON_COMMIT="<unknown>"
ARG SYSTEMDISTRO_DEBUG_BUILD
ARG FREERDP_VERSION=2
ARG FREERDP_VERSION=3
Comment thread Dockerfile
Comment on lines 265 to 277
-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>
@benhillis
Copy link
Copy Markdown
Member Author

Addressed code-review finding: cgmanifest.json still listed FreeRDP commit 39f56443 (2.x). Bumped to 3f6d7cb1 (3.26.0) to match what we actually build. See 0dfa0ac.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants