[PATCH] D27052: [compiler-rt][asan] Fix overlaping parameters for memmove/memcpy on windows.

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 12:09:39 PST 2016


But only for the interceptors. __asan_memcpy should only be called if
instrumentMemIntrinsic added it, in AddressSanitizer.cpp. I don't think
macOS is doing anything special there (if it were, this patch wouldn't even
have the section where I posted the comment, as ASan would be handling it
already)

Filipe

On Wed, 23 Nov 2016 at 19:50, Reid Kleckner <rnk at google.com> wrote:

> rnk added inline comments.
>
>
> ================
> Comment at: lib/asan/asan_interceptors.cc:427
> +  ASAN_MEMMOVE_IMPL(nullptr, to, from, size);
> +#endif
> +}
> ----------------
> filcab wrote:
> > I have a problem with this. It seems like it's hiding problems.
> >
> > If the runtime called `__asan_memcpy`, it is because we actually had a
> call to `memcpy`, so we should check for overlap properly. This code is
> turning that off.
> > If `memcpy` and `memmove` are defined to the same, we shouldn't be
> erroring when `memmove` is called, though. But I don't see how calls to
> `__asan_memcpy`/`__asan_memmove` get converted to be the same function,
> since that's an ASan function, not the libc one.
> In practice, we found, as Apple did, that on platforms where memcpy
> aliases memmove, it is not feasible to intercept them separately. If you
> trace through the existing logic, you'll see that we're already suppressing
> this error in the same way on Mac.
>
>
> https://reviews.llvm.org/D27052
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161123/ae70e05d/attachment.html>


More information about the llvm-commits mailing list