Author: nmusgrave
Date: Wed Sep 16 19:10:59 2015
New Revision: 247871
URL: http://llvm.org/viewvc/llvm-project?rev=247871&view=rev
Log:
Updating docs for MSan to describe poison-in-dtor.
Summary:
Describe the compile and runtime flags to enable MemorySanitizer
detection of use-after-destroy.
Rev
Author: nmusgrave
Date: Tue Sep 15 19:38:22 2015
New Revision: 247762
URL: http://llvm.org/viewvc/llvm-project?rev=247762&view=rev
Log:
Implementation and testing for poisoning vtable
ptr in dtor.
Summary:
After destruction, invocation of virtual functions prevented
by poisoning vtable pointer.
nmusgrave updated this revision to Diff 34851.
nmusgrave added a comment.
- Remove commented-out block.
http://reviews.llvm.org/D12712
Files:
lib/CodeGen/CGClass.cpp
test/CodeGenCXX/sanitize-dtor-derived-class.cpp
test/CodeGenCXX/sanitize-dtor-vtable.cpp
Index: test/CodeGenCXX/sanitize-d
nmusgrave updated this revision to Diff 34822.
nmusgrave added a comment.
- Re-checking testing for poisoning vtable.
http://reviews.llvm.org/D12712
Files:
lib/CodeGen/CGClass.cpp
test/CodeGenCXX/sanitize-dtor-derived-class.cpp
test/CodeGenCXX/sanitize-dtor-vtable.cpp
Index: test/CodeGen
nmusgrave updated this revision to Diff 34617.
nmusgrave added a comment.
- Poison vtable in either complete or base dtor.
http://reviews.llvm.org/D12712
Files:
lib/CodeGen/CGClass.cpp
test/CodeGenCXX/sanitize-dtor-derived-class.cpp
test/CodeGenCXX/sanitize-dtor-vtable.cpp
Index: test/Co
nmusgrave updated this revision to Diff 34614.
nmusgrave marked 2 inline comments as done.
nmusgrave added a comment.
- Fixed testing callback emission order to account for vptr.
http://reviews.llvm.org/D12712
Files:
lib/CodeGen/CGClass.cpp
test/CodeGenCXX/sanitize-dtor-derived-class.cpp
nmusgrave marked 2 inline comments as done.
Comment at: lib/CodeGen/CGClass.cpp:1652
@@ +1651,3 @@
+
+ static void Poison(CodeGenFunction &CGF, llvm::Value *OffsetPtr,
+CharUnits::QuantityType PoisonSize);
eugenis wrote:
> If it's a global func
nmusgrave marked an inline comment as done.
Comment at: lib/CodeGen/CGClass.cpp:1685
@@ -1680,3 +1684,3 @@
// Start sanitizing at this field
if (startIndex < 0)
startIndex = fieldIndex;
compiler-rt/test/msan/dtor-multiple-inherit
nmusgrave updated this revision to Diff 34373.
nmusgrave added a comment.
- Cleaned up impl.
http://reviews.llvm.org/D12712
Files:
lib/CodeGen/CGClass.cpp
test/CodeGenCXX/sanitize-dtor-derived-class.cpp
test/CodeGenCXX/sanitize-dtor-vtable.cpp
Index: test/CodeGenCXX/sanitize-dtor-vtable.
nmusgrave marked an inline comment as done.
nmusgrave added a comment.
http://reviews.llvm.org/D12712
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nmusgrave updated this revision to Diff 34357.
nmusgrave added a comment.
- Fixed testing callback emission order to account for vptr. Vptr poisoned
after all virtual and member destructors are invoked, in order to prevent a
data race an on the virtual function invoked by a class instance.
(htt
nmusgrave created this revision.
nmusgrave added reviewers: eugenis, kcc.
nmusgrave added a subscriber: cfe-commits.
After destruction, invocation of virtual functions prevented
by poisoning vtable pointer.
http://reviews.llvm.org/D12712
Files:
lib/CodeGen/CGClass.cpp
test/CodeGenCXX/sanitiz
Author: nmusgrave
Date: Tue Sep 8 11:38:17 2015
New Revision: 247025
URL: http://llvm.org/viewvc/llvm-project?rev=247025&view=rev
Log:
Failing test highlighting no poisoning if dtor undeclared.
Summary:
If class or struct has not declared a destructor,
no destructor is emitted, and members are n
nmusgrave updated this revision to Diff 34220.
nmusgrave marked an inline comment as done.
nmusgrave added a comment.
- Rename test.
http://reviews.llvm.org/D12616
Files:
test/CodeGenCXX/sanitize-dtor-trivial.cpp
Index: test/CodeGenCXX/sanitize-dtor-trivial.cpp
==
nmusgrave updated this revision to Diff 34094.
nmusgrave marked an inline comment as done.
nmusgrave added a comment.
- Only check simplest object for existence of sanitizing callback.
http://reviews.llvm.org/D12616
Files:
test/CodeGenCXX/sanitize-dtor-generated.cpp
Index: test/CodeGenCXX/sa
nmusgrave created this revision.
nmusgrave added reviewers: eugenis, kcc.
nmusgrave added a subscriber: cfe-commits.
If class or struct has not declared a destructor,
no destsructor is emitted, and members are not poisoned
after destruction. This case highlights bug in current
implementation of us
Author: nmusgrave
Date: Thu Sep 3 18:02:30 2015
New Revision: 246815
URL: http://llvm.org/viewvc/llvm-project?rev=246815&view=rev
Log:
Refactored dtor sanitizing into EHScopeStack
Summary:
Dtor sanitization handled amidst other dtor cleanups,
between cleaning bases and fields. Sanitizer call pus
nmusgrave updated this revision to Diff 33982.
nmusgrave marked 2 inline comments as done.
nmusgrave added a comment.
- Clean method headers, style.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize-d
nmusgrave updated this revision to Diff 33978.
nmusgrave marked 4 inline comments as done.
nmusgrave added a comment.
- Simplified fields and checks for aliasing.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGen
nmusgrave updated this revision to Diff 33959.
nmusgrave added a comment.
- Refined testing for bit fields.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize-dtor-bit-field.cpp
test/CodeGenCXX/sanit
nmusgrave updated this revision to Diff 33956.
nmusgrave marked 4 inline comments as done.
nmusgrave added a comment.
- Testing sanitizing bit fields.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize
nmusgrave updated this revision to Diff 33887.
nmusgrave marked 4 inline comments as done.
nmusgrave added a comment.
- Update comments, consistent style for attribute checking.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
nmusgrave added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:42-44
@@ -33,1 +41,5 @@
bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) {
+ // If sanitizing memory to check for use-after-dtor, do not emit as
+ // an alias, unless it has no fields
nmusgrave updated this revision to Diff 33752.
nmusgrave marked 13 inline comments as done.
nmusgrave added a comment.
- Simplified implementation of class field poisoning, to avoid redundant
counting and conditional checks. Expensive checks delayed.
http://reviews.llvm.org/D12022
Files:
lib
nmusgrave updated this revision to Diff 33463.
nmusgrave marked an inline comment as done.
nmusgrave added a comment.
- Alias-repressing test case ignores casting of pointers.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
nmusgrave added inline comments.
Comment at: test/CodeGenCXX/sanitize-dtor-repress-aliasing.cpp:30
@@ +29,2 @@
+// Definition of virtual function table
+// CHECK: @_ZTV7Derived = {{.*}}(void (%struct.Derived*)* @_ZN7DerivedD1Ev to
i8*){{.*}}(void (%struct.Derived*)* @_ZN7DerivedD
nmusgrave marked 3 inline comments as done.
nmusgrave added a comment.
http://reviews.llvm.org/D12022
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nmusgrave updated this revision to Diff 33436.
nmusgrave added a comment.
- Checking for existence of fields to poison in alias emission.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize-dtor-nontriv
nmusgrave updated this revision to Diff 33115.
nmusgrave added a comment.
- Simplify parameters, rename function, for examining fields of class to
destroy.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sa
nmusgrave updated this revision to Diff 33100.
nmusgrave marked an inline comment as done.
nmusgrave added a comment.
- Check flags before dtor sanitizing
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sani
nmusgrave updated this revision to Diff 33037.
nmusgrave marked 4 inline comments as done.
nmusgrave added a comment.
- Simplify function invocations
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize-
nmusgrave updated this revision to Diff 32986.
nmusgrave added a comment.
- Refactored for simpler trivial field checking
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize-dtor-nontrivial-virtual-base
nmusgrave updated this revision to Diff 32930.
nmusgrave added a comment.
- Refactoring dtor sanitizing emission order
- support for virtual functions & virtual bases WIP
- Repress dtor aliasing when sanitizing in dtor
- CFE test for dtor aliasing, and repression of aliasing in dtor code
generati
nmusgrave added inline comments.
Comment at: lib/CodeGen/CGClass.cpp:1578
@@ +1577,3 @@
+if (CGF.CGM.FieldHasTrivialDestructorBody(Context, Field) ||
+Field->getType()->isPointerType()) {
+ // Start sanitizing at this field
eugenis wro
nmusgrave added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:41
@@ +40,3 @@
+ if (getCodeGenOpts().SanitizeMemoryUseAfterDtor && Layout.getFieldCount() > 0
+ && HasTrivialDestructorBody(Context, D->getParent(), D->getParent())) {
+return true;
nmusgrave added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:41
@@ +40,3 @@
+ if (getCodeGenOpts().SanitizeMemoryUseAfterDtor && Layout.getFieldCount() > 0
+ && HasTrivialDestructorBody(Context, D->getParent(), D->getParent())) {
+return true;
nmusgrave updated this revision to Diff 32873.
nmusgrave marked 2 inline comments as done.
nmusgrave added a comment.
- Poisoning on field-by-field basis, with collective poisoning of trivial
members when possible.
- Cleaned up implementation of calculating region to poison in dtor.
http://revi
nmusgrave updated this revision to Diff 32608.
nmusgrave added a comment.
- More complex testing for destruction order. Tests class with base, virtual
base, trivial, and nontrivial member to ensure destruction order is correct.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
li
nmusgrave updated this revision to Diff 32600.
nmusgrave added a comment.
- CFE test for dtor aliasing, and repression of aliasing in dtor code
generation.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
test/CodeGenCXX/sanitize-dtor-repress-aliasing.c
Author: nmusgrave
Date: Fri Aug 14 18:22:03 2015
New Revision: 245124
URL: http://llvm.org/viewvc/llvm-project?rev=245124&view=rev
Log:
clarified test comment
Modified:
cfe/trunk/test/CodeGenCXX/sanitize-dtor-callback.cpp
Modified: cfe/trunk/test/CodeGenCXX/sanitize-dtor-callback.cpp
URL:
h
Author: nmusgrave
Date: Thu Aug 13 13:35:11 2015
New Revision: 244933
URL: http://llvm.org/viewvc/llvm-project?rev=244933&view=rev
Log:
Fix previous commit: poison only class members, simpler tests
Summary: Poisoning applied to only class members, and before dtors for base
class invoked
Impleme
Author: nmusgrave
Date: Wed Aug 12 17:07:24 2015
New Revision: 244820
URL: http://llvm.org/viewvc/llvm-project?rev=244820&view=rev
Log:
Revert "Implement poisoning of only class members in dtor, as opposed to also
poisoning fields inherited from base classes."
This reverts commit 8dbbf3578a9a5d0
Author: nmusgrave
Date: Wed Aug 12 16:37:40 2015
New Revision: 244819
URL: http://llvm.org/viewvc/llvm-project?rev=244819&view=rev
Log:
Implement poisoning of only class members in dtor, as opposed to also poisoning
fields inherited from base classes.
Verify emitted code for derived class with vi
43 matches
Mail list logo