summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangjoon Baek <joon.c.baek@samsung.com>2016-12-05 13:14:10 +0900
committerChangjoon Baek <joon.c.baek@samsung.com>2016-12-05 13:17:06 +0900
commit5725e0112e457b87040040554e8eacda2f541d40 (patch)
tree54f08dd827bce3793d579680994370d124cd1b63
parent424f3e7944fc711cb32bebb4667ec85c202b1b1b (diff)
downloadttrace-5725e0112e457b87040040554e8eacda2f541d40.tar.gz
ttrace-5725e0112e457b87040040554e8eacda2f541d40.tar.bz2
ttrace-5725e0112e457b87040040554e8eacda2f541d40.zip
Use absolute path for execlp()
Attacker can exploit by modified 'PATH' environment. Excuting system command have to use absolute path. Change-Id: Ided661e83c072684524c5ab8b73fc89db9842e13 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
-rwxr-xr-xsrc/atrace/atrace.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/atrace/atrace.cpp b/src/atrace/atrace.cpp
index 6293b06..3fabf0b 100755
--- a/src/atrace/atrace.cpp
+++ b/src/atrace/atrace.cpp
@@ -514,7 +514,7 @@ static bool setTagsProperty(uint64_t tags)
return false;
}
//for auto-mounting tracingfs (>= linux 4.1.x)
- system("ls -al /sys/kernel/debug/tracing > /dev/null 2>&1");
+ system("/usr/bin/ls -al /sys/kernel/debug/tracing > /dev/null 2>&1");
if(!initSysfsPermission()) {
fprintf(stderr, "Fail to init sysfs permisions: %s(%d)\n", strerror_r(errno, str_error, sizeof(str_error)), errno);
munmap(sm_for_enabled_tag, sizeof(uint64_t));