Skip to content

[win/asan] GetInstructionSize: Make F6 C1 XX a generic entry. #118144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bernhardu
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Nov 29, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: None (bernhardu)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/118144.diff

1 Files Affected:

  • (modified) compiler-rt/lib/interception/interception_win.cpp (+3-1)
diff --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index dc3018a675dee2..e3c3764c45417f 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -634,6 +634,9 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
     case 0xD284:  // 84 D2 : test dl,dl
       return 2;
 
+    case 0xC1F6:  // F6 C1 XX : test cl, XX
+      return 3;
+
     // Cannot overwrite control-instruction. Return 0 to indicate failure.
     case 0x25FF:  // FF 25 XX YY ZZ WW : jmp dword ptr ds:[WWZZYYXX]
       return 0;
@@ -724,7 +727,6 @@ static size_t GetInstructionSize(uptr address, size_t* rel_offset = nullptr) {
   }
 
   switch (0x00FFFFFF & *(u32*)address) {
-    case 0x07c1f6:    // f6 c1 07 : test cl, 0x7
     case 0x10b70f:    // 0f b7 10 : movzx edx, WORD PTR [rax]
     case 0xc00b4d:    // 4d 0b c0 : or r8, r8
     case 0xc03345:    // 45 33 c0 : xor r8d, r8d

Copy link

github-actions bot commented Nov 29, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@bernhardu bernhardu force-pushed the mr-interception_win-make-F6-C1-XX-generic branch from 5c7c27f to c005634 Compare November 29, 2024 23:42
@bernhardu
Copy link
Contributor Author

v2:

  • adjust for format requirements.

@bernhardu bernhardu marked this pull request as draft December 1, 2024 10:19
@bernhardu bernhardu force-pushed the mr-interception_win-make-F6-C1-XX-generic branch from c005634 to 82ff530 Compare December 6, 2024 20:28
@bernhardu bernhardu marked this pull request as ready for review December 6, 2024 20:38
@bernhardu
Copy link
Contributor Author

v3:

  • Add test line.

CC: @zmodem

Copy link
Collaborator

@zmodem zmodem left a comment

Choose a reason for hiding this comment

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

lgtm

Would you like me to hit the "merge" button?

@bernhardu
Copy link
Contributor Author

Would you like me to hit the "merge" button?

Thanks for reviewing, if there are no more concerns about the change, yes, please.

@zmodem zmodem merged commit bf6f1ca into llvm:main Dec 9, 2024
9 checks passed
@bernhardu bernhardu deleted the mr-interception_win-make-F6-C1-XX-generic branch December 9, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants