Skip to content

Commit

Permalink
make output less confusing when system is meltdown safe
Browse files Browse the repository at this point in the history
Refs #8.
  • Loading branch information
raphaelsc committed Jan 6, 2018
1 parent ac2c435 commit 353543d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions meltdown_checker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,14 @@ static bool validate_syscall_table_entry(const void* data, const std::unordered_
uint64_t* entry = (uint64_t*) data;
uintptr_t ptr = reinterpret_cast<uintptr_t>(entry[0]);

printf("0x%016lx -> That's %s\n", (uintptr_t)ptr, symbol_map.count(ptr) ? symbol_map.at(ptr).c_str() : "unknown");

if (symbol_map.count(ptr)) {
auto symbol = symbol_map.at(ptr);
std::transform(symbol.begin(), symbol.end(), symbol.begin(), ::tolower);
auto ret = symbol.find(syscall_table_symbol_entry_prefix);
if (ret > 0 || ret == std::string::npos) {
return false;
}
printf("0x%016lx -> That's %s\n", (uintptr_t)ptr, symbol_map.count(ptr) ? symbol_map.at(ptr).c_str() : "unknown");
return true;
}
return false;
Expand Down Expand Up @@ -312,7 +311,7 @@ int main(int argc, char** argv) {
std::cout << "Check https://security.googleblog.com/2018/01/todays-cpu-vulnerability-what-you-need.html for more details\n";
goto out;
} else {
std::cout << "so far so good...\n";
std::cout << "so far so good (i.e. meltdown safe) ...\n";
}
}
std::cout << "\nSystem not affected. Congratulations!\n";
Expand Down

0 comments on commit 353543d

Please sign in to comment.