Windows: Defender's ShellCode.MKA!MTB on the AGC test executables matches GCC's divide-by-65 in UintStorageImageBinding #26777
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Helldiverr on 2026-11-24T21:14:09Z.
What happens
On Windows, Microsoft Defender quarantines
agc_shader_replay.exeand 35tests/agc_*_tests.exeasTrojan:Win64/ShellCode.MKA!MTB. The match is a static byte signature on one instruction sequence that GCC emits fornumber % 65inRuntimeAbi::UintStorageImageBinding. It is not caused by generated machine code, which is the reason docs/dev/BUILD.md:76 gives.Title, test or build step
The
objcopypost-step of the AGC test targets (Invalid argument); ctest then reports those tests asNot Run. docs/dev/BUILD.md:76.AnyPS5 commit
main02cbc28a52for the full build below. The source lines cited are unchanged onmainc2a0c13039.System
Windows 11 Pro 10.0.26300, Ryzen 9 9950X3D, WinLibs GCC 15.2.0 UCRT posix-seh r7, Release,
BUILD_TESTING=ON. Defender real-time protection on with default settings, antimalware client 4.18.26100.4, engine 1.1.26100.4, signatures 1.463.453.0.Steps to reproduce
mainwith the default preset andBUILD_TESTING=ON, with Defender's default settings.Get-MpThreatDetectionafterwards. It listsShellCode.MKA!MTBforagc_shader_replay.exeand the AGC test executables, and the build log showsobjcopy ... Invalid argumentfor each of them.In one full build of
main02cbc28a52on this machine,Get-MpThreatDetectionrecorded 108 detections of these 36 files within 45 minutes, as builds and reruns relinked them. On another worktree, a focused build of one PR hadagc_shader_mode_register_tests.exequarantined six times in nine minutes.Log
What was checked
Where the signature is. I bisected
agc_spirv_module_tests.exeby relinking it from subsets of its archive members and having Defender scan each result three times.DescriptorBindingBuilder.cpp.obj. With that object and the test alone it is detected 3/3. Each of the other 121 members, without that object, gives clean 3/3..textmatters. Blanking.rdataor.text.unlikelystays detected; blanking.textis clean..text, the signature needs 15 bytes:cmp/jajust before them stays detected.89 c2 b9 fd c0 0f fc 48 0f af d1 48 c1 ea 26.mov edx,eax; mov ecx,0xfc0fc0fd; imul rdx,rcx; shr rdx,38. This is GCC's division by 65.-gbuild maps them toRuntimeAbi::UintStorageImageBinding. That function computesnumber % countwithBinding::Count= 65 and is inlined at DescriptorBindingBuilder.cpp:823.It only fires on small executables.
int main(){return 0;}linked with that one object: as an EXE it is detected 3/3. Linked as a DLL it is clean 3/3. The same DLL withIMAGE_FILE_DLLcleared in its header is detected again, 3/3.libSceAgcDriver.prxfrom the same build, the file a release ships, contains the same byte sequence with the same surrounding bytes. It is 23.8 MB and scans clean 3/3, also with the DLL flag cleared.objcopyis a consequence, not a cause. Defender removes the executable right after the link. The post-step at core/libs/CMakeLists.txt:65 that renames.eh_framethen finds no file and reportsInvalid argument. Nothing in these executables is writable and executable: the code sits in an ordinary read-execute.text.Other Defender verdicts seen in the same builds. These differ in kind from
ShellCode.MKA!MTB: they are cloud machine-learning verdicts (!ml) on exact file hashes.Trojan:Win32/Wacatac.C!mlorWacatac.H!ml. Flipping one byte of such a file and rescanning came back clean.relinker.exeitself was flaggedTrojan:Win32/Bearfoos.A!mlonce, as in #16960; a later build of it scanned clean.test-tempexclusion.Releases are unsigned.
tools/package_release.pycopies the built executables into the archive as they are..github/workflows/release.ymlhas no signing step..githubortools.Possible directions (the maintainer's call):
ShellCode.MKA!MTBnarrowed. The 15 bytes above can go with it.release.ymlbeforepackage_release.py. This addresses Smart App Control and reputation verdicts for people running a release. It does not change the byte signature above, which hits test builds only.UintStorageImageBindingcomputes the stage-local slot. For example, comparenumberagainst per-stage ranges instead of taking% 65. GCC would then emit different instructions. This is only a workaround for one signature, and another constant may match later.I have not changed any Defender setting for these runs and have not submitted samples to Microsoft.
AI-assisted: yes