Skip to content

Enable ASLR and DEP for Windows DLLs (#288, #661) - #742

Merged
xerial merged 1 commit into
mainfrom
fix/windows-dll-hardening
Oct 3, 2026
Merged

xerial merged 1 commit into
mainfrom
fix/windows-dll-hardening

Conversation

@xerial

@xerial xerial commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #288 and #661. The bundled snappyjava.dll files are currently linked without ASLR/DEP opt-in: objdump -p on the x86_64 DLL shows DllCharacteristics 00000000. This PR adds these linker flags in Makefile.common:

Target Flags added
Windows-x86 -Wl,--dynamicbase -Wl,--nxcompat
Windows-x86_64, Windows-aarch64 the same, plus -Wl,--high-entropy-va

The Build Native workflow gets a new step that fails if the built x86 or x86_64 DLL is missing DYNAMIC_BASE / NX_COMPAT (and HIGH_ENTROPY_VA on 64-bit).

SafeSEH, also reported in #661, isn't supported by the MinGW linker, so it isn't covered here.

After merge, the Build Native workflow on main will open an "Update native libraries" PR with the rebuilt DLLs.

Test plan

  • Build Native workflow passes on this PR, including the DLL characteristics check

🤖 Generated with Claude Code

Link snappyjava.dll with --dynamicbase and --nxcompat (and
--high-entropy-va for 64-bit) so that it opts into ASLR and DEP (#288,
#661), and verify the DLL characteristics in the native build workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xerial
xerial merged commit d19b2d1 into main Oct 3, 2026
12 checks passed
@xerial
xerial deleted the fix/windows-dll-hardening branch October 3, 2026 07:54
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.

Enable ASLR and DEP on snappyjava.dll

1 participant