Skip to content

Commit

Permalink
bcc: Remove bpf_probe_read_user availability checks on compile time
Browse files Browse the repository at this point in the history
If wrong kernel-headers are installed, then this can provide false
result for probe read selection. Instead look for only kallsyms.

Signed-off-by: Sumanth Korikkar <[email protected]>
  • Loading branch information
sumanthkorikkar authored and yonghong-song committed May 25, 2020
1 parent 275abc9 commit 0b2f4d0
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/cc/frontends/clang/b_frontend_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ static std::string check_bpf_probe_read_user(llvm::StringRef probe,
bool& overlap_addr) {
if (probe.str() == "bpf_probe_read_user" ||
probe.str() == "bpf_probe_read_user_str") {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
return probe.str();
#else
// Check for probe_user symbols in backported kernel before fallback
void *resolver = get_symbol_resolver();
uint64_t addr = 0;
Expand All @@ -132,7 +129,6 @@ static std::string check_bpf_probe_read_user(llvm::StringRef probe,
return "bpf_probe_read";
else
return "bpf_probe_read_str";
#endif
}
return "";
}
Expand Down

0 comments on commit 0b2f4d0

Please sign in to comment.