diff options
author | Maxim Ostapenko <m.ostapenko@partner.samsung.com> | 2016-05-17 07:38:27 +0000 |
---|---|---|
committer | Maxim Ostapenko <m.ostapenko@partner.samsung.com> | 2016-05-17 07:38:27 +0000 |
commit | 02c21b3ef9407a112ad35e252e2bf8ce88903de4 (patch) | |
tree | fcf22256059f2aec5b38b07ba59e36aae20202e2 /lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py | |
parent | cb6e042040fba67d8cbe917d79073eaab1af2595 (diff) | |
download | bcm5719-llvm-02c21b3ef9407a112ad35e252e2bf8ce88903de4.tar.gz bcm5719-llvm-02c21b3ef9407a112ad35e252e2bf8ce88903de4.zip |
[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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py')
0 files changed, 0 insertions, 0 deletions