|
@@ -25,7 +25,8 @@ void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
|
|
SourceLocation Loc, StringRef Name,
|
|
SourceLocation Loc, StringRef Name,
|
|
QualType Ty, bool IsDynInit,
|
|
QualType Ty, bool IsDynInit,
|
|
bool IsBlacklisted) {
|
|
bool IsBlacklisted) {
|
|
- if (!CGM.getLangOpts().Sanitize.has(SanitizerKind::Address))
|
|
|
|
|
|
+ if (!CGM.getLangOpts().Sanitize.hasOneOf(SanitizerKind::Address |
|
|
|
|
+ SanitizerKind::KernelAddress))
|
|
return;
|
|
return;
|
|
IsDynInit &= !CGM.isInSanitizerBlacklist(GV, Loc, Ty, "init");
|
|
IsDynInit &= !CGM.isInSanitizerBlacklist(GV, Loc, Ty, "init");
|
|
IsBlacklisted |= CGM.isInSanitizerBlacklist(GV, Loc, Ty);
|
|
IsBlacklisted |= CGM.isInSanitizerBlacklist(GV, Loc, Ty);
|
|
@@ -56,7 +57,8 @@ void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
|
|
|
|
|
|
void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
|
|
void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
|
|
const VarDecl &D, bool IsDynInit) {
|
|
const VarDecl &D, bool IsDynInit) {
|
|
- if (!CGM.getLangOpts().Sanitize.has(SanitizerKind::Address))
|
|
|
|
|
|
+ if (!CGM.getLangOpts().Sanitize.hasOneOf(SanitizerKind::Address |
|
|
|
|
+ SanitizerKind::KernelAddress))
|
|
return;
|
|
return;
|
|
std::string QualName;
|
|
std::string QualName;
|
|
llvm::raw_string_ostream OS(QualName);
|
|
llvm::raw_string_ostream OS(QualName);
|
|
@@ -67,7 +69,8 @@ void SanitizerMetadata::reportGlobalToASan(llvm::GlobalVariable *GV,
|
|
void SanitizerMetadata::disableSanitizerForGlobal(llvm::GlobalVariable *GV) {
|
|
void SanitizerMetadata::disableSanitizerForGlobal(llvm::GlobalVariable *GV) {
|
|
// For now, just make sure the global is not modified by the ASan
|
|
// For now, just make sure the global is not modified by the ASan
|
|
// instrumentation.
|
|
// instrumentation.
|
|
- if (CGM.getLangOpts().Sanitize.has(SanitizerKind::Address))
|
|
|
|
|
|
+ if (CGM.getLangOpts().Sanitize.hasOneOf(SanitizerKind::Address |
|
|
|
|
+ SanitizerKind::KernelAddress))
|
|
reportGlobalToASan(GV, SourceLocation(), "", QualType(), false, true);
|
|
reportGlobalToASan(GV, SourceLocation(), "", QualType(), false, true);
|
|
}
|
|
}
|
|
|
|
|