forked from OSchip/llvm-project
a22685885d
Summary: In the LLVM IR, "call" instructions read memory for each byval operand. For example: ``` $ cat blah.c struct foo { void *a, *b, *c; }; struct bar { struct foo foo; }; void func1(const struct foo); void func2(struct bar *bar) { func1(bar->foo); } $ [...]/bin/clang -S -flto -c blah.c -O2 ; cat blah.s [...] define dso_local void @func2(%struct.bar* %bar) local_unnamed_addr #0 { entry: %foo = getelementptr inbounds %struct.bar, %struct.bar* %bar, i64 0, i32 0 tail call void @func1(%struct.foo* byval(%struct.foo) align 8 %foo) #2 ret void } [...] $ [...]/bin/clang -S -c blah.c -O2 ; cat blah.s [...] func2: # @func2 [...] subq $24, %rsp [...] movq 16(%rdi), %rax movq %rax, 16(%rsp) movups (%rdi), %xmm0 movups %xmm0, (%rsp) callq func1 addq $24, %rsp [...] retq ``` Let ASAN instrument these hidden memory accesses. This is patch 4/4 of a patch series: https://reviews.llvm.org/D77616 [PATCH 1/4] [AddressSanitizer] Refactor ClDebug{Min,Max} handling https://reviews.llvm.org/D77617 [PATCH 2/4] [AddressSanitizer] Split out memory intrinsic handling https://reviews.llvm.org/D77618 [PATCH 3/4] [AddressSanitizer] Refactor: Permit >1 interesting operands per instruction https://reviews.llvm.org/D77619 [PATCH 4/4] [AddressSanitizer] Instrument byval call arguments Reviewers: kcc, glider Reviewed By: glider Subscribers: hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77619 |
||
---|---|---|
.. | ||
X86 | ||
adaptive_global_redzones.ll | ||
asan-detect-invalid-pointer-pair.ll | ||
asan-masked-load-store.ll | ||
asan-vs-gvn.ll | ||
asan_address_space_attr.ll | ||
basic-msvc64.ll | ||
basic-myriad.ll | ||
basic.ll | ||
byval-args.ll | ||
debug-info-alloca.ll | ||
debug-info-global-var.ll | ||
debug_info.ll | ||
debug_info_noninstrumented_alloca.ll | ||
debug_info_noninstrumented_alloca2.ll | ||
do-not-instrument-globals-darwin.ll | ||
do-not-instrument-globals-linux.ll | ||
do-not-instrument-internal-globals.ll | ||
do-not-instrument-profiling-globals.ll | ||
do-not-instrument-promotable-allocas.ll | ||
do-not-instrument-sanitizers.ll | ||
do-not-touch-comdat-global.ll | ||
do-not-touch-odr-global.ll | ||
do-not-touch-threadlocal.ll | ||
dynamic-shadow-darwin.ll | ||
experiment-call.ll | ||
experiment.ll | ||
force-dynamic-shadow.ll | ||
freebsd.ll | ||
global_addrspace.ll | ||
global_cstring_darwin.ll | ||
global_lto_merge.ll | ||
global_metadata.ll | ||
global_metadata_array.ll | ||
global_metadata_bitcasts.ll | ||
global_metadata_darwin.ll | ||
global_metadata_external_comdat.ll | ||
global_metadata_windows.ll | ||
hoist-argument-init-insts.ll | ||
instrument-dynamic-allocas.ll | ||
instrument-no-return.ll | ||
instrument-stack.ll | ||
instrument_global.ll | ||
instrument_initializer_metadata.ll | ||
instrument_load_then_store.ll | ||
instrumentation-with-call-threshold.ll | ||
keep_going.ll | ||
lifetime-throw.ll | ||
lifetime-uar-uas.ll | ||
lifetime.ll | ||
local_alias.ll | ||
local_stack_base.ll | ||
localescape.ll | ||
no-globals.ll | ||
odr-check-ignore.ll | ||
ps4.ll | ||
scale-offset.ll | ||
stack-poisoning-and-lifetime-be.ll | ||
stack-poisoning-and-lifetime.ll | ||
stack-poisoning-byval-args.ll | ||
stack-poisoning.ll | ||
stack_dynamic_alloca.ll | ||
stack_layout.ll | ||
str-nobuiltin.ll | ||
test64.ll | ||
twice.ll | ||
ubsan.ll | ||
version-mismatch-check.ll | ||
win-sorted-sections.ll | ||
win-string-literal.ll | ||
with-ifunc.ll |