[llvm] [asan][x86] Abort instrumenting memintrinsics that target fs, gs (PR #129291)

Thor Preimesberger via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 13 12:52:15 PDT 2025


================
@@ -1340,10 +1341,21 @@ Value *AddressSanitizer::memToShadow(Value *Shadow, IRBuilder<> &IRB) {
     return IRB.CreateAdd(Shadow, ShadowBase);
 }
 
+bool AddressSanitizer::maybeIgnoreMemIntrinsic(MemIntrinsic *MI,
+                                               const Triple &TargetTriple) {
+  // Ignore FS and GS registers to prevent miscompilation
+  if (MI->getDestAddressSpace() >= 256 &&
----------------
cheezeburglar wrote:

For SS, probably not - in 64 bit mode, all segment registers are disabled except for FS and GS. 

The higher (259+) address spaces look like they correspond to compiler directives that originate from Microsoft - I *think* they get casted the the usual default address space in llvm, so I'd guess not. I'm not entirely sure however

https://github.com/llvm/llvm-project/pull/129291


More information about the llvm-commits mailing list