Don't prepend /proc/PID/root to user-supplied USDT binary paths starting with /proc...
authorDave Marchevsky <davemarchevsky@gmail.com>
Thu, 15 Aug 2019 20:30:34 +0000 (13:30 -0700)
committeryonghong-song <ys114321@gmail.com>
Fri, 16 Aug 2019 00:12:59 +0000 (17:12 -0700)
src/cc/usdt/usdt.cc

index b8c4b96..0c02601 100644 (file)
@@ -279,7 +279,7 @@ std::string Context::resolve_bin_path(const std::string &bin_path) {
     ::free(which_so);
   }
 
-  if (!result.empty() && pid_ && *pid_ != -1) {
+  if (!result.empty() && pid_ && *pid_ != -1 && result.find("/proc") != 0) {
     result = tfm::format("/proc/%d/root%s", *pid_, result);
   }