Add SafeStack support to rustc
Adds support for LLVM [SafeStack] which provides backward edge control flow protection by separating the stack into two parts: data which is only accessed in provable safe ways is allocated on the normal stack (the "safe stack") and all other data is placed in a separate allocation (the "unsafe stack"). SafeStack support is enabled by passing `-Zsanitizer=safestack`. [SafeStack]: https://clang.llvm.org/docs/SafeStack.html
This commit is contained in:
@@ -88,6 +88,9 @@ pub fn sanitize_attrs<'ll>(
|
||||
|
||||
attrs.push(llvm::AttributeKind::SanitizeMemTag.create_attr(cx.llcx));
|
||||
}
|
||||
if enabled.contains(SanitizerSet::SAFESTACK) {
|
||||
attrs.push(llvm::AttributeKind::SanitizeSafeStack.create_attr(cx.llcx));
|
||||
}
|
||||
attrs
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user