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

2022-12-07 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl added a comment. In D125195#3979478 , @vitalybuka wrote: > Is this still relevant? > If so, I would recommend to split ItaniumCXXABI from asan changes. I haven't proceeded with this because this would be ABI breaking. I intend to support the (

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

2022-12-07 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka requested changes to this revision. vitalybuka added a comment. This revision now requires changes to proceed. Herald added a subscriber: Enna1. Is this still relevant? If so, I would recommend to split ItaniumCXXABI from asan changes. Repository: rG LLVM Github Monorepo CHANGES SI

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

2022-05-18 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl updated this revision to Diff 430461. rsundahl added a comment. Fix (and cleanup) for failure of CodeGen arm.c check in ci/cd pipeline. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125195/new/ https://reviews.llvm.org/D125195 Files: cl

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

2022-05-13 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl added inline comments. Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:2191 CGM.CreateRuntimeFunction(FTy, "__asan_poison_cxx_array_cookie"); +// CGF.Builder.CreateCall(F, NumElementsPtr.getRawPointer(CGF)); CGF.Builder.CreateCall(F, NumElementsPtr.getPoin

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

2022-05-13 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl updated this revision to Diff 429352. rsundahl added a comment. This update corrects merge conflicts in Build #104091 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125195/new/ https://reviews.llvm.org/D125195 Files: clang/lib/CodeGen/It

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

2022-05-13 Thread Julian Lettner via Phabricator via cfe-commits
yln added inline comments. Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:2349 + if (!cookieOffset.isZero()) +cookiePtr = CGF.Builder.CreateConstInBoundsByteGEP(cookiePtr, cookieOffset); Variable names should start with uppercase: https://llvm.org/docs/C

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

2022-05-12 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl marked 8 inline comments as done. rsundahl added a comment. The update completes the suggested changes. The generated code is slightly different around initialization of the array cookie due to choosing one implementation over another when I "folded" ARMCXXABI::InitializeArrayCookie()

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

2022-05-12 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl updated this revision to Diff 429135. rsundahl added a comment. - Refactor InitializeArrayCookie and readArrayCookieImpl. This update to the differential implements the final suggestions for refactoring ItaniumCXXABI to remove duplicated code in the function InitializeArrayCookie() and r

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

2022-05-11 Thread Julian Lettner via Phabricator via cfe-commits
yln added inline comments. Comment at: compiler-rt/lib/asan/asan_poisoning.cpp:263 +#if SANITIZER_ARM64 + // The ARM64 cookie has a second "size_t" entry so poison it as well + *(reinterpret_cast(s)-1) = kAsanArrayCookieMagic; Comment at: co

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

2022-05-11 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl updated this revision to Diff 428731. rsundahl marked 6 inline comments as done. rsundahl added a comment. Update diff back to dc7e02d4b4dc30d44ddebd832719a6e63396e718 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125195/new/ https://revie

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

2022-05-11 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl updated this revision to Diff 428718. rsundahl added a comment. Revert ItaniumCXXABI.cpp for now (unintentional push) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125195/new/ https://reviews.llvm.org/D125195 Files: clang/lib/CodeGen/It

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

2022-05-11 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl updated this revision to Diff 428716. rsundahl added a comment. Implement suggestions from reviews. (Incremental update.) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125195/new/ https://reviews.llvm.org/D125195 Files: clang/lib/CodeGe

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

2022-05-11 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl marked an inline comment as not done. rsundahl added inline comments. Comment at: compiler-rt/test/asan/TestCases/Posix/new_array_cookie_test.cpp:19 C *buffer = new C[argc]; - buffer[-2].x = 10; + buffer[-1].x = 10; // CHECK: AddressSanitizer: heap-buffer-overflow

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

2022-05-09 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl added a comment. Adding dialog to comments made by reviewers. Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:2443 + // Handle poisoning the array cookie in asan + if (CGM.getLangOpts().Sanitize.has(SanitizerKind::Address) && AS == 0 && + (expr->getOperatorNew()

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

2022-05-09 Thread Julian Lettner via Phabricator via cfe-commits
yln added inline comments. Comment at: compiler-rt/lib/asan/asan_poisoning.cpp:262 *reinterpret_cast(s) = kAsanArrayCookieMagic; + // The ARM64 cookie has a second "elementSize" entry so poison it as well + #if SANITIZER_ARM64 yln wrote: > yln wrote: > > Nit

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

2022-05-09 Thread Julian Lettner via Phabricator via cfe-commits
yln added inline comments. Comment at: compiler-rt/lib/asan/asan_poisoning.cpp:262 *reinterpret_cast(s) = kAsanArrayCookieMagic; + // The ARM64 cookie has a second "elementSize" entry so poison it as well + #if SANITIZER_ARM64 yln wrote: > Nitpicking extreme

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

2022-05-09 Thread Julian Lettner via Phabricator via cfe-commits
yln added inline comments. Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:2453 +CGF.Builder.CreateCall(F, cookie.getRawPointer(CGF)); + } This code is very similar to what we have in `ItaniumCXXABI::InitializeArrayCookie()`. Can we try to extract a loca

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

2022-05-09 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl added reviewers: vitalybuka, kcc. rsundahl added a comment. Adding Vitaly Buka and Kostya Serebryany (sanitizer maintainers). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125195/new/ https://reviews.llvm.org/D125195 _

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

2022-05-09 Thread Dan Liew via Phabricator via cfe-commits
delcypher added inline comments. Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:2443 + // Handle poisoning the array cookie in asan + if (CGM.getLangOpts().Sanitize.has(SanitizerKind::Address) && AS == 0 && + (expr->getOperatorNew()->isReplaceableGlobalAllocationFunction(

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

2022-05-09 Thread Roy Sundahl via Phabricator via cfe-commits
rsundahl updated this revision to Diff 428099. rsundahl added a comment. Adding ASAN test "new_array_cookie_with_new_from_class" (rdar://92884511) This test "new_array_cookie_with_new_from_class " was dependent on the cookie size on x86_64 and was either unsupported or expected to fail on arm. Th

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

2022-05-08 Thread Roy Sundahl via Phabricator via cfe-commits
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, Sanit