[PATCH] D125195: [asan][ARMCXXABI] Added missing asan poison array cookie hooks.

Roy Sundahl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 8 17:09:20 PDT 2022


rsundahl created this revision.
rsundahl added reviewers: yln, kubamracek, rjmccall, dcoughlin, delcypher, aralisza, thetruestblue, wrotki.
Herald added subscribers: pengfei, kristof.beyls.
Herald added a project: All.
rsundahl requested review of this revision.
Herald added projects: clang, Sanitizers.
Herald added subscribers: Sanitizers, cfe-commits.

Hooks into the address sanitizer that support array cookie poisoning and
validation were being generated for x86_64 but not for ARM. (amended)

In addition to the ItaniumCXXABI array cookie of a single size_t element
containing the number of elements in the allocated array, the ARMCXXABI adds
a second size_t element containing the sizeof(element). This difference in
cookie size created the need to override the methods ::InitializeArrayCookie()
and ::readArrayCookieImpl(). Later, in support of ASAN poison array cookies,
calls to __asan_poison_cxx_array_cookie() and __asan_load_cxx_array_cookie()
were added to each method respectively. However, these "hooks" were only
implemented for the ItaniumCXXABI. This commit adds the same functionality
to the overridden ARMCXXABI methods.

rdar://92765369


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125195

Files:
  clang/lib/CodeGen/ItaniumCXXABI.cpp
  compiler-rt/lib/asan/asan_poisoning.cpp
  compiler-rt/test/asan/TestCases/Posix/new_array_cookie_test.cpp
  compiler-rt/test/asan/TestCases/Posix/new_array_cookie_uaf_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125195.427960.patch
Type: text/x-patch
Size: 6054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220509/7393d3fb/attachment.bin>


More information about the cfe-commits mailing list