|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3 |
|
| #
12bfea58 |
| 08-Mar-2022 |
Andrew Browne <[email protected]> |
[DFSan] Fix several bugs in dfsan custom callbacks test.
Reviewed By: kda
Differential Revision: https://reviews.llvm.org/D121249
|
|
Revision tags: llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
| #
61ec2148 |
| 04-Oct-2021 |
Andrew Browne <[email protected]> |
[DFSan] Remove -dfsan-args-abi support in favor of TLS.
ArgsABI was originally added in https://reviews.llvm.org/D965
Current benchmarking does not show a significant difference. There is no need t
[DFSan] Remove -dfsan-args-abi support in favor of TLS.
ArgsABI was originally added in https://reviews.llvm.org/D965
Current benchmarking does not show a significant difference. There is no need to maintain both ABIs.
Reviewed By: pcc
Differential Revision: https://reviews.llvm.org/D111097
show more ...
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2 |
|
| #
76777b21 |
| 24-Aug-2021 |
Andrew Browne <[email protected]> |
[DFSan] Add wrapper for getentropy().
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D108604
|
|
Revision tags: llvmorg-13.0.0-rc1, llvmorg-14-init |
|
| #
228bea6a |
| 24-Jul-2021 |
George Balatsouras <[email protected]> |
Revert D106195 "[dfsan] Add wrappers for v*printf functions"
This reverts commit bf281f364757d6af8d9d8456f26d334d1eeaf575.
This commit causes dfsan to segfault.
|
| #
bf281f36 |
| 16-Jul-2021 |
George Balatsouras <[email protected]> |
[dfsan] Add wrappers for v*printf functions
Functions `vsnprintf`, `vsprintf` and `vfprintf` commonly occur in DFSan warnings.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://revie
[dfsan] Add wrappers for v*printf functions
Functions `vsnprintf`, `vsprintf` and `vfprintf` commonly occur in DFSan warnings.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D106195
show more ...
|
|
Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2 |
|
| #
5b4dda55 |
| 04-Jun-2021 |
George Balatsouras <[email protected]> |
[dfsan] Add full fast8 support
Complete support for fast8: - amend shadow size and mapping in runtime - remove fast16 mode and -dfsan-fast-16-labels flag - remove legacy mode and make fast8 mode the
[dfsan] Add full fast8 support
Complete support for fast8: - amend shadow size and mapping in runtime - remove fast16 mode and -dfsan-fast-16-labels flag - remove legacy mode and make fast8 mode the default - remove dfsan-fast-8-labels flag - remove functions in dfsan interface only applicable to legacy - remove legacy-related instrumentation code and tests - update documentation.
Reviewed By: stephan.yichao.zhao, browneee
Differential Revision: https://reviews.llvm.org/D103745
show more ...
|
| #
a82747fa |
| 07-Jun-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Fix internal build errors because of more strict warning checks
|
|
Revision tags: llvmorg-12.0.1-rc1 |
|
| #
2c82588d |
| 23-Apr-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Use the sanitizer allocator to reduce memory cost
dfsan does not use sanitizer allocator as others. In practice, we let it use glibc's allocator since tcmalloc needs more work to be working
[dfsan] Use the sanitizer allocator to reduce memory cost
dfsan does not use sanitizer allocator as others. In practice, we let it use glibc's allocator since tcmalloc needs more work to be working with dfsan well. With glibc, we observe large memory leakage. This could relate to two things:
1) glibc allocator has limitation: for example, tcmalloc can reduce memory footprint 2x easily
2) glibc may call unmmap directly as an internal system call by using system call number. so DFSan has no way to release shadow spaces for those unmmap.
Using sanitizer allocator addresses the above issues 1) its memory management is close to tcmalloc
2) we can register callback when sanitizer allocator calls unmmap, so dfsan can release shadow spaces correctly.
Our experiment with internal server-based application proved that with the change, in a-few-day run, memory usage leakage is close to what tcmalloc does w/o dfsan.
This change mainly follows MSan's code.
1) define allocator callbacks at dfsan_allocator.h|cpp
2) mark allocator APIs to be discard
3) intercept allocator APIs
4) make dfsan_set_label consistent with MSan's SetShadow when setting 0 labels, define dfsan_release_meta_memory when unmap is called
5) add flags about whether zeroing memory after malloc/free. dfsan works at byte-level, so bit-level oparations can cause reading undefined shadow. See D96842. zeroing memory after malloc helps this. About zeroing after free, reading after free is definitely UB, but if user code does so, it is hard to debug an overtainting caused by this w/o running MSan. So we add the flag to help debugging.
This change will be split to small changes for review. Before that, a question is "this code shares a lot of with MSan, for example, dfsan_allocator.* and dfsan_new_delete.*. Does it make sense to unify the code at sanitizer_common? will that introduce some maintenance issue?"
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D101204
show more ...
|
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4 |
|
| #
4950695e |
| 19-Mar-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Add Origin ABI Wrappers
Supported ctime_r, fgets, getcwd, get_current_dir_name, gethostname, getrlimit, getrusage, strcpy, time, inet_pton, localtime_r, getpwuid_r, epoll_wait, poll, select,
[dfsan] Add Origin ABI Wrappers
Supported ctime_r, fgets, getcwd, get_current_dir_name, gethostname, getrlimit, getrusage, strcpy, time, inet_pton, localtime_r, getpwuid_r, epoll_wait, poll, select, sched_getaffinity
Most of them work as calling their non-origin verision directly.
This is a part of https://reviews.llvm.org/D95835.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D98966
show more ...
|
| #
91516925 |
| 24-Mar-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Add Origin ABI Wrappers
Supported strrchr, strrstr, strto*, recvmmsg, recrmsg, nanosleep, memchr, snprintf, socketpair, sprintf, getocketname, getsocketopt, gettimeofday, getpeer
[dfsan] Add Origin ABI Wrappers
Supported strrchr, strrstr, strto*, recvmmsg, recrmsg, nanosleep, memchr, snprintf, socketpair, sprintf, getocketname, getsocketopt, gettimeofday, getpeername.
strcpy was added because the test of sprintf need it. It will be committed by D98966. Please ignore it when reviewing.
This is a part of https://reviews.llvm.org/D95835.
Reviewed By: gbalats
Differential Revision: https://reviews.llvm.org/D99109
show more ...
|
| #
1fe04204 |
| 17-Mar-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Add origin ABI wrappers
supported: dl_get_tls_static_info, calloc, clock_gettime, dfsan_set_write_callback, dl_iterato_phdr, dlopen, memcpy, memmove, memset, pread, read, strcat, strdup, str
[dfsan] Add origin ABI wrappers
supported: dl_get_tls_static_info, calloc, clock_gettime, dfsan_set_write_callback, dl_iterato_phdr, dlopen, memcpy, memmove, memset, pread, read, strcat, strdup, strncpy
This is a part of https://reviews.llvm.org/D95835.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D98790
show more ...
|
| #
ec5ed66c |
| 15-Mar-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Add origin ABI wrappers
supported: bcmp, fstat, memcmp, stat, strcasecmp, strchr, strcmp, strncasecmp, strncp, strpbrk
This is a part of https://reviews.llvm.org/D95835.
Reviewed By: moreh
[dfsan] Add origin ABI wrappers
supported: bcmp, fstat, memcmp, stat, strcasecmp, strchr, strcmp, strncasecmp, strncp, strpbrk
This is a part of https://reviews.llvm.org/D95835.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D98636
show more ...
|
| #
4e67ae7b |
| 10-Mar-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Add origin ABI wrappers for thread/signal/fork
This is a part of https://reviews.llvm.org/D95835.
See https://github.com/llvm/llvm-project/commit/bb91e02efd00eda04296069a83228c8d9db105b7 ab
[dfsan] Add origin ABI wrappers for thread/signal/fork
This is a part of https://reviews.llvm.org/D95835.
See https://github.com/llvm/llvm-project/commit/bb91e02efd00eda04296069a83228c8d9db105b7 about the similar issue of fork in MSan's origin tracking.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D98359
show more ...
|
|
Revision tags: llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3 |
|
| #
15f26c5f |
| 03-Feb-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Wrap strcat
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D95923
|
| #
eb5c0a90 |
| 03-Feb-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Test IGN and DFL for sigaction
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D95957
|
| #
93afc345 |
| 02-Feb-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Clean TLS after signal callbacks
Similar to https://reviews.llvm.org/D95642, this diff fixes signal.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D95896
|
| #
3f568e1f |
| 02-Feb-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Wrap memmove
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D95883
|
| #
e1a4322f |
| 28-Jan-2021 |
Jianzhou Zhao <[email protected]> |
[dfsan] Clean TLS after sigaction callbacks
DFSan uses TLS to pass metadata of arguments and return values. When an instrumented function accesses the TLS, if a signal callback happens, and the call
[dfsan] Clean TLS after sigaction callbacks
DFSan uses TLS to pass metadata of arguments and return values. When an instrumented function accesses the TLS, if a signal callback happens, and the callback calls other instrumented functions with updating the same TLS, the TLS is in an inconsistent state after the callback ends. This may cause either under-tainting or over-tainting.
This fix follows MSan's workaround. https://github.com/llvm/llvm-project/commit/cb22c67a21e4b5e1ade65141117a70be318be072 It simply resets TLS at restore. This prevents from over-tainting. Although under-tainting may still happen, a taint flow can be found eventually if we run a DFSan-instrumented program multiple times. The alternative option is saving the entire TLS. However the TLS storage takes 2k bytes, and signal calls could be nested. So it does not seem worth.
This diff fixes sigaction. A following diff will be fixing signal.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D95642
show more ...
|
|
Revision tags: llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2 |
|
| #
7bc7501a |
| 11-Dec-2020 |
Matt Morehouse <[email protected]> |
[DFSan] Add custom wrapper for recvmmsg.
Uses the recvmsg wrapper logic in a loop.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D93059
|
| #
5ff35356 |
| 10-Dec-2020 |
Matt Morehouse <[email protected]> |
[DFSan] Appease the custom wrapper lint script.
|
| #
00993164 |
| 10-Dec-2020 |
Matt Morehouse <[email protected]> |
[DFSan] Add custom wrapper for pthread_join.
The wrapper clears shadow for retval.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D93047
|
| #
fa4bd4b3 |
| 10-Dec-2020 |
Matt Morehouse <[email protected]> |
[DFSan] Add custom wrapper for getpeername.
The wrapper clears shadow for addr and addrlen when written to.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D93046
|
| #
72fd47b9 |
| 10-Dec-2020 |
Matt Morehouse <[email protected]> |
[DFSan] Add custom wrapper for _dl_get_tls_static_info.
Implementation is here: https://code.woboq.org/userspace/glibc/elf/dl-tls.c.html#307
We use weak symbols to avoid linking issues with glibcs
[DFSan] Add custom wrapper for _dl_get_tls_static_info.
Implementation is here: https://code.woboq.org/userspace/glibc/elf/dl-tls.c.html#307
We use weak symbols to avoid linking issues with glibcs older than 2.27.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D93053
show more ...
|
| #
bdaeb82a |
| 10-Dec-2020 |
Matt Morehouse <[email protected]> |
[DFSan] Add custom wrapper for sigaltstack.
The wrapper clears shadow for old_ss.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D93041
|
| #
8a874a42 |
| 10-Dec-2020 |
Matt Morehouse <[email protected]> |
[DFSan] Add custom wrapper for getsockname.
The wrapper clears shadow for any bytes written to addr or addrlen.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D92
[DFSan] Add custom wrapper for getsockname.
The wrapper clears shadow for any bytes written to addr or addrlen.
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D92964
show more ...
|