Skip to content

Sign rsession.dll in the Windows release build - #18516

Merged
gtritchie merged 2 commits into
mainfrom
bugfix/18512-sign-rsession-dll
Aug 11, 2026
Merged

gtritchie merged 2 commits into
mainfrom
bugfix/18512-sign-rsession-dll

Conversation

@gtritchie

Copy link
Copy Markdown
Member

Problem

The Windows Desktop build ships rsession.dll unsigned. #18070 moved the bulk of the
session code out of rsession.exe and rsession-utf8.exe -- which each statically linked
their own copy -- into a shared library, leaving the two executables as thin launcher stubs
that forward to rsessionMain() in the DLL. The Sign Executables stage was not updated to
match, so the signed stubs load an unsigned module holding essentially all of the session
implementation. Policies that verify loaded modules rather than only the launching image --
WDAC, AppLocker publisher rules, and some EDR configurations -- can block or flag it.

Change

Adds both build-tree copies of the DLL to %EXECUTABLES% in jenkins/Jenkinsfile.windows:

  • package\win32\build\src\cpp\session\rsession.dll (x64, next to the stubs)
  • package\win32\build\src\cpp\session\x86\rsession.dll (x86 from the multiarch sub-build,
    alongside the already-signed x86\rsession.exe)

Signing runs before the Package stage, so the installer picks up the signed DLLs with no
reordering.

Verification

  • Both paths confirmed present in a local multiarch package build tree, next to the
    executables the stage already signs.
  • install(TARGETS rsession-shared RUNTIME DESTINATION "${RSTUDIO_INSTALL_BIN}")
    (src/cpp/session/CMakeLists.txt:707) is what places the x86 copy under session/x86,
    and MULTIARCH is forced on for Jenkins builds, so signtool will not miss the file.
  • package/win32/scripts/upload-debug-symbols.ps1 already lists rsession-shared.pdb for
    both architectures, so its "keep in sync with the executables signed in
    Jenkinsfile.windows" comment now holds.

Signing itself only runs on the Windows pipeline, so this needs manual verification on a
daily build: signtool verify /pa (or the Digital Signatures tab) on the installed
rsession.dll.

Notes

Only rsession.dll is covered here; other DLLs in the shipped tree, including those from
the Electron distribution, were not audited.

The two x86\... entries in the sign list currently sign files that do not reach the
installer -- see #18515, a separate packaging regression from #17814 being fixed on its own
branch. Keeping the x86 DLL entry in place means the payload is signed once that is fixed.

Addresses #18512.

#18070 moved the bulk of the session code out of rsession.exe and
rsession-utf8.exe into a shared library, leaving the two executables as
thin launcher stubs. The Sign Executables stage was not updated, so the
signed stubs load an unsigned DLL holding essentially all of the session
implementation -- which WDAC, AppLocker publisher rules, and some EDR
configurations evaluate as a loaded module.

Add both build-tree copies of the DLL to %EXECUTABLES%: the x64 one next
to the stubs, and the x86 one that the multiarch build installs into
src/cpp/session/x86 alongside x86/rsession.exe. Signing already runs
before the Package stage, so the installer picks up the signed DLLs.

Addresses #18512
@gtritchie gtritchie added this to the 2026.09 (Autumn Hawkbit) milestone Aug 11, 2026
@gtritchie
gtritchie requested a review from kevinushey August 11, 2026 18:02
@gtritchie
gtritchie merged commit 06473dc into main Aug 11, 2026
6 checks passed
@gtritchie
gtritchie deleted the bugfix/18512-sign-rsession-dll branch August 11, 2026 19:07
gtritchie added a commit that referenced this pull request Aug 14, 2026
Backport of #18516 (06473dc) to Yellow Yarrow. This branch carries the
rsession-shared library from #18070, so rsession.exe and rsession-utf8.exe are
thin launcher stubs and rsession.dll holds essentially all of the session
implementation -- but %EXECUTABLES% in the Sign Executables stage still named
only the .exe files, so the shipped DLL was unsigned.

Add both build-tree copies of the DLL: the x64 one next to the stubs, and the
x86 one that the multiarch build installs into src/cpp/session/x86 alongside
x86/rsession.exe. Signing runs before the Package stage, so the installer picks
up the signed DLLs.

The NEWS entry goes in version/news/os/NEWS-2026.08.1-yellow-yarrow.md, since
NEWS.md is not carried on this branch.

Addresses #18557
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.

1 participant