[PATCH] D152663: [asan] Fix shadow load alignment for unaligned 128-bit load/store

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 11 18:38:55 PDT 2023


MaskRay created this revision.
MaskRay added reviewers: Sanitizers, vitalybuka.
Herald added subscribers: Enna1, hiraditya, kristof.beyls.
Herald added a project: All.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When a 128-bit load/store is aligned by 8, we incorrectly emit `load i16, ptr ..., align 2`
while the shadow byte address may be odd.

This manifests as possibly-misaligned shadow load with `-mstrict-align`, e.g. `clang -target=aarch64-linux -O2 -mstrict-align -fsanitize=address`

Fix https://github.com/llvm/llvm-project/issues/63258


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152663

Files:
  llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
  llvm/test/Instrumentation/AddressSanitizer/basic.ll
  llvm/test/Instrumentation/AddressSanitizer/vector-load-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152663.530355.patch
Type: text/x-patch
Size: 5823 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230612/f2b5c526/attachment.bin>


More information about the llvm-commits mailing list