llvm-project/compiler-rt/test/sanitizer_common/TestCases
Maxim Ostapenko 02c21b3ef9 [asan] Don't raise false alarm to recv/recvfrom when MSG_TRUNC is present.
Fix https://llvm.org/bugs/show_bug.cgi?id=27673.

Currenty ASan checks the return value of real recv/recvfrom to see if the written bytes fit in the buffer. That works fine most of time.
However, there is an exception: (from the RECV(2) man page)

MSG_TRUNC (since Linux 2.2)
    ... return the real length of the packet or datagram, even when it was longer than the passed buffer. ...

Some programs combine MSG_TRUNC, MSG_PEEK and a single-byte buffer to peek the incoming data size without reading (much of) them. In this case,
the return value is usually longer than what's been written and ASan raises a false alarm here. To avoid such false positive reports,
we can use min(res, len) in COMMON_INTERCEPTOR_WRITE_RANGE checks.

Differential Revision: http://reviews.llvm.org/D20280

llvm-svn: 269749
2016-05-17 07:38:27 +00:00
..
Darwin Fix PR26608: Make sanitizer_common tests more portable. 2016-02-17 21:00:50 +00:00
Linux [asan] Don't raise false alarm to recv/recvfrom when MSG_TRUNC is present. 2016-05-17 07:38:27 +00:00
Posix [sanitizer_common tests] Make Darwin a Posix system and bring the stable-runtime definition from ASan tests. 2016-03-10 18:46:23 +00:00
corelimit.cc [TSan] Initialize flags as early as possible. Disables back coredump, accidentally enabled in r215479. Add a test. 2014-08-15 19:53:51 +00:00
fopen_nullptr.c [asan] fix fopen interceptor to not crash if path is NULL 2015-12-21 19:22:26 +00:00
malloc_hook.cc [MSan] Add a test case for r258339. 2016-01-21 17:51:08 +00:00
options-help.cc [Sanitizer] Test churn: use %env_tool_opts in sanitizer_common lit tests. 2015-08-26 19:29:07 +00:00
options-include.cc Fix PR26608: Make sanitizer_common tests more portable. 2016-02-17 21:00:50 +00:00
options-invalid.cc [Sanitizer] Test churn: use %env_tool_opts in sanitizer_common lit tests. 2015-08-26 19:29:07 +00:00
print-stack-trace.cc [sanitizer-common] Use @LINE in test. 2016-03-07 13:44:20 +00:00
pthread_mutexattr_get.cc Remove ARM XFAIL from passing test 2014-06-24 16:58:59 +00:00
strcasestr.c [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk. 2015-05-28 09:24:33 +00:00
strcspn.c [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk. 2015-05-28 09:24:33 +00:00
strnlen.c [sanitizer] Add strnlen to the common interceptors 2016-03-23 21:24:28 +00:00
strpbrk.c [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk. 2015-05-28 09:24:33 +00:00
strspn.c [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk. 2015-05-28 09:24:33 +00:00
strstr.c [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk. 2015-05-28 09:24:33 +00:00