Skip to content

Commit 45eea20

Browse files
committed
Revert "[asan] Fix vfork handling.", +1
Revert r354625, r354627 - multiple build failures. llvm-svn: 354629
1 parent 2b34fdc commit 45eea20

File tree

19 files changed

+0
-195
lines changed

19 files changed

+0
-195
lines changed

compiler-rt/include/sanitizer/hwasan_interface.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ extern "C" {
5050
// does would cause false reports.
5151
void __hwasan_handle_longjmp(const void *sp_dst);
5252

53-
// Set memory tag for the part of the current thread stack below sp_dst to
54-
// zero. Call this in vfork() before returning in the parent process.
55-
void __hwasan_handle_vfork(const void *sp_dst);
56-
5753
// Libc hook for thread creation. Should be called in the child thread before
5854
// any instrumented code.
5955
void __hwasan_thread_enter();
@@ -69,10 +65,6 @@ extern "C" {
6965
// Print one-line report about the memory usage of the current process.
7066
void __hwasan_print_memory_usage();
7167

72-
/* Returns the offset of the first byte in the memory range that can not be
73-
* accessed through the pointer in x, or -1 if the whole range is good. */
74-
intptr_t __hwasan_test_shadow(const volatile void *x, size_t size);
75-
7668
int __sanitizer_posix_memalign(void **memptr, size_t alignment, size_t size);
7769
void * __sanitizer_memalign(size_t alignment, size_t size);
7870
void * __sanitizer_aligned_alloc(size_t alignment, size_t size);

compiler-rt/lib/asan/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ set(ASAN_SOURCES
1313
asan_globals_win.cc
1414
asan_interceptors.cc
1515
asan_interceptors_memintrinsics.cc
16-
asan_interceptors_vfork.S
1716
asan_linux.cc
1817
asan_mac.cc
1918
asan_malloc_linux.cc

compiler-rt/lib/asan/asan_interceptors.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,6 @@ INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), void *arg,
579579
}
580580
#endif // ASAN_INTERCEPT___CXA_ATEXIT
581581

582-
DEFINE_REAL(void, vfork);
583-
584582
// ---------------------- InitializeAsanInterceptors ---------------- {{{1
585583
namespace __asan {
586584
void InitializeAsanInterceptors() {
@@ -658,8 +656,6 @@ void InitializeAsanInterceptors() {
658656
ASAN_INTERCEPT_FUNC(__cxa_atexit);
659657
#endif
660658

661-
__interception::GetRealFunctionAddress("vfork", (uptr *)&REAL(vfork), 0, 0);
662-
663659
InitializePlatformInterceptors();
664660

665661
VReport(1, "AddressSanitizer: libc interceptors initialized\n");

compiler-rt/lib/asan/asan_interceptors_vfork.S

Lines changed: 0 additions & 7 deletions
This file was deleted.

compiler-rt/lib/asan/asan_interface.inc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ INTERFACE_FUNCTION(__asan_exp_store4)
2626
INTERFACE_FUNCTION(__asan_exp_store8)
2727
INTERFACE_FUNCTION(__asan_exp_store16)
2828
INTERFACE_FUNCTION(__asan_exp_storeN)
29-
INTERFACE_FUNCTION(__asan_extra_spill_area)
3029
INTERFACE_FUNCTION(__asan_get_alloc_stack)
3130
INTERFACE_FUNCTION(__asan_get_current_fake_stack)
3231
INTERFACE_FUNCTION(__asan_get_free_stack)
@@ -39,7 +38,6 @@ INTERFACE_FUNCTION(__asan_get_report_pc)
3938
INTERFACE_FUNCTION(__asan_get_report_sp)
4039
INTERFACE_FUNCTION(__asan_get_shadow_mapping)
4140
INTERFACE_FUNCTION(__asan_handle_no_return)
42-
INTERFACE_FUNCTION(__asan_handle_vfork)
4341
INTERFACE_FUNCTION(__asan_init)
4442
INTERFACE_FUNCTION(__asan_load_cxx_array_cookie)
4543
INTERFACE_FUNCTION(__asan_load1)

compiler-rt/lib/asan/asan_interface_internal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,6 @@ extern "C" {
249249

250250
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
251251
const char* __asan_default_suppressions();
252-
253-
SANITIZER_INTERFACE_ATTRIBUTE void *__asan_extra_spill_area();
254-
SANITIZER_INTERFACE_ATTRIBUTE void __asan_handle_vfork(void *sp);
255252
} // extern "C"
256253

257254
#endif // ASAN_INTERFACE_INTERNAL_H

compiler-rt/lib/asan/asan_rtl.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -597,19 +597,6 @@ void NOINLINE __asan_handle_no_return() {
597597
curr_thread->fake_stack()->HandleNoReturn();
598598
}
599599

600-
void *__asan_extra_spill_area() {
601-
AsanThread *t = GetCurrentThread();
602-
CHECK(t);
603-
return t->extra_spill_area();
604-
}
605-
606-
void __asan_handle_vfork(void *sp) {
607-
AsanThread *t = GetCurrentThread();
608-
CHECK(t);
609-
uptr bottom = t->stack_bottom();
610-
PoisonShadow(bottom, (uptr)sp - bottom, 0);
611-
}
612-
613600
void NOINLINE __asan_set_death_callback(void (*callback)(void)) {
614601
SetUserDieCallback(callback);
615602
}

compiler-rt/lib/asan/asan_thread.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ class AsanThread {
130130
AsanThreadLocalMallocStorage &malloc_storage() { return malloc_storage_; }
131131
AsanStats &stats() { return stats_; }
132132

133-
void *extra_spill_area() { return &extra_spill_area_; }
134-
135133
private:
136134
// NOTE: There is no AsanThread constructor. It is allocated
137135
// via mmap() and *must* be valid in zero-initialized state.
@@ -167,7 +165,6 @@ class AsanThread {
167165
AsanThreadLocalMallocStorage malloc_storage_;
168166
AsanStats stats_;
169167
bool unwinding_;
170-
uptr extra_spill_area_;
171168
};
172169

173170
// ScopedUnwinding is a scope for stacktracing member of a context

compiler-rt/lib/hwasan/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ set(HWASAN_RTL_SOURCES
66
hwasan_allocator.cc
77
hwasan_dynamic_shadow.cc
88
hwasan_interceptors.cc
9-
hwasan_interceptors_vfork.S
109
hwasan_linux.cc
1110
hwasan_memintrinsics.cc
1211
hwasan_poisoning.cc

compiler-rt/lib/hwasan/hwasan.cc

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -477,30 +477,6 @@ void __hwasan_handle_longjmp(const void *sp_dst) {
477477
TagMemory(sp, dst - sp, 0);
478478
}
479479

480-
void __hwasan_handle_vfork(const void *sp_dst) {
481-
uptr sp = (uptr)sp_dst;
482-
Thread *t = GetCurrentThread();
483-
CHECK(t);
484-
uptr top = t->stack_top();
485-
uptr bottom = t->stack_bottom();
486-
static const uptr kMaxExpectedCleanupSize = 64 << 20; // 64M
487-
if (top == 0 || bottom == 0 || sp < bottom || sp >= top ||
488-
sp - bottom > kMaxExpectedCleanupSize) {
489-
Report(
490-
"WARNING: HWASan is ignoring requested __hwasan_handle_vfork: "
491-
"stack top: %zx; current %zx; bottom: %zx \n"
492-
"False positive error reports may follow\n",
493-
top, sp, bottom);
494-
return;
495-
}
496-
TagMemory(bottom, sp - bottom, 0);
497-
}
498-
499-
void *__hwasan_extra_spill_area() {
500-
Thread *t = GetCurrentThread();
501-
return &t->vfork_spill();
502-
}
503-
504480
void __hwasan_print_memory_usage() {
505481
InternalScopedString s(kMemoryUsageBufferSize);
506482
HwasanFormatMemoryUsage(s);

0 commit comments

Comments
 (0)