To intercept the functions in Win11's ntdll.dll, we need to use the trampoline
technique because there are bytes other than 0x90 or 0xcc in the gaps between
exported functions. This patch adds more patterns that appear in ntdll's
functions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lgtm, thanks for the patch. Would you like me to push it for you? Would you like me to exclude or include your email from the Author record?
Thank you for reviewing my patch! Yes, I'd like you to land this on my behalf. Please include my email to the record if possible. That's an honor.
Note that we should get in contact with the Windows maintainers about this. Windows OS dlls are built with /HOTPATCH and should all be hotpatchable. It's unclear what the leading junk in the hotpatch padding is.
I've followed up with people more knowledgeable than myself. The unknown leading bytes in the padding region are XFG hashes and can be safely overwritten as long as XFG is not enabled for the process. (XFG is an eXtension of CFG, control flow guard)
I can't imagine many people will have both ASan and XFG enabled at the same time so I think the interception logic should just always assume there is padding before Windows OS functions.