summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-09-15Resolve vulnerability about untrusted stringjoon.c.baek1-72/+101
The sceanario of bootup-trace has vulnerability about untrusted string loaded and execution. This patch changes how to execution and remove system() calling. And change open permission 0666 to 0600. Change-Id: Ibfc19a9c8c7ef43af084e8d6b7496bf59c12dfe5 Signed-off-by: joon.c.baek <joon.c.baek@samsung.com> (cherry picked from commit 37138335b180b9c610c671c2103a00fd8a9fca82)
2017-08-01Remove build warnings with GCC 6.2submit/tizen_4.0_unified/20170814.115522submit/tizen_4.0/20170828.100009submit/tizen_4.0/20170814.115522submit/tizen_4.0/20170811.094300submit/tizen/20170801.044617accepted/tizen/unified/20170803.010335accepted/tizen/4.0/unified/20170828.223019accepted/tizen/4.0/unified/20170816.015423Gihun Chang2-8/+8
*For implicit declaration of function [-Wimplicit-function-declaration] . Add #include <stdio.h> prior to use of the function vsnprintf. *For Unused bariable [-Wunused-variable] . Remove it. Really Unused. . bufSize, buf, ret *For Ignoring return value of func() [-Wunused-result] . Remove the use of function by https://review.tizen.org/gerrit/#/c/124677/ Change-Id: I7e376cfc30078832141128d10b2e44cd598b9b56
2017-07-31Merge "Remove meaningless codes" into tizenGihun Chang1-2/+0
2017-06-02Add traceFS mount service and adjust service ordersubmit/tizen/20170602.072408accepted/tizen/unified/20170602.155201Changjoon Baek1-38/+0
4.x kernel splited traceFS and debugFS. /sys/kernel/debug/tracing and /tmp should be mounted before ttrace-marker.service started. - Add sys-kernel-tracing.service to mount tracefs to /sys/kernel/debug/tracing - Adjust ttrace-marker.service order to be after the sys-kernel-tracing.service Change-Id: I48f08bb8d4a31fa24b8508307812241a6fcb73b6 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2017-04-12Remove meaningless codesChangjoon Baek1-2/+0
tracing_init_dentry() auto-mount tracefs in kernel 4.10.x. This initializing is triggered fs_initcall. So, Removed code in this commit is meaningless. Change-Id: I9ae499131d6f7a8d2dd6e6c2c2d09e33585e3bf6 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2017-03-08Apply Tizen 3.0 Smack policy to ttrace pkgChangjoon Baek1-89/+1
Change smack labeling to using systemd tmpfiles instead of set_smacklabel() initializing Change-Id: I0e44ea62200929804c745175f73cd469b9b4623e Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2017-02-02Replace usage of deprecated libsmack functionRafal Krypa1-1/+2
The libsmack function smack_setlabel is deprecated and will be removed. Using the alternative instead. Change-Id: Ia02383700175ba1e4eb91c85e4aa17c4033290f6 Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
2016-12-22Formatting help messageGihun Chang1-2/+3
Change-Id: I4a0f580006ae18cc55901f912fc11ad999f5f3be
2016-12-16Fix side effect on previous commitsubmit/tizen_3.0/20161216.083703submit/tizen_3.0.m2/20170104.093756accepted/tizen/3.0/wearable/20161219.012523accepted/tizen/3.0/tv/20161219.012517accepted/tizen/3.0/mobile/20161219.012514accepted/tizen/3.0/ivi/20161219.012527accepted/tizen/3.0/common/20161219.113529accepted/tizen/3.0.m2/wearable/20170105.030235accepted/tizen/3.0.m2/tv/20170105.030010accepted/tizen/3.0.m2/mobile/20170105.025841tizen_3.0.m2accepted/tizen_3.0.m2_wearableaccepted/tizen_3.0.m2_tvaccepted/tizen_3.0.m2_mobileGihun Chang2-2/+2
Change-Id: Ice3dd142bb38b15fa331157d2b6b0ef9dd106b8e
2016-12-16Fix message overflowsubmit/tizen_3.0/20161216.045231Gihun Chang2-3/+5
Change-Id: Iaa3a46b5d6550e02d3d5ea66d0213e44a2048779
2016-12-05Use absolute path for execlp()submit/tizen_3.0/20161205.051821accepted/tizen/3.0/wearable/20161205.070021accepted/tizen/3.0/tv/20161205.070016accepted/tizen/3.0/mobile/20161205.070009accepted/tizen/3.0/ivi/20161205.070028accepted/tizen/3.0/common/20161206.125359Changjoon Baek1-1/+1
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>
2016-11-23Skip the initialization of kernel event when atrace run with --append option.Gihun Chang1-13/+12
Change-Id: I49fcc426b831cb28b951d0133d2bd61f6c478a8f Signed-off-by: Gihun Chang <gihun.chang@samsung.com>
2016-11-22Add destructor to libttraceChangjoon Baek1-0/+18
T-trace doesn't considering the case of dlclose(). If some package that use traceBegin, traceEnd call dlopen(), dlclose() repeatly, happen fd leakage at ttrace_tmp, trace_marker. So, Add destructor function libttrace_fini() that close all of opened file descriptor. Change-Id: I6431b404827d160adb8176eefd7bd7f4fce620ef Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2016-11-21Remove codes related with AndroidChangjoon Baek1-219/+0
T-trace forked from Android project. Codes that related with the Android platform remained at atrace.cpp. Remove unused code at the Tizen platform to enhance readability, maintainance. Change-Id: Ifc926115dd5a64e1be47f7d23d457f35dd849f62 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2016-10-21Remove usages of extension functionssubmit/tizen_3.0_common/20161104.104000submit/tizen/20161026.074554accepted/tizen/wearable/20161028.151457accepted/tizen/tv/20161028.151455accepted/tizen/mobile/20161028.151452accepted/tizen/ivi/20161028.151500accepted/tizen/common/20161026.134617Changjoon Baek1-71/+23
Remove usages of extension functions to prevent accessing to uninitialized fd(trace_marker). T-trace check whether initialing by isTagEnabled(), However, g_extension_state can permit accessing to uninitialized fd at all of write(). And, extension feature was not used anymore. Additionally, Use TTRACE_LOG() instead of fprintf(), remove useless spaces for clean codes. Change-Id: Iacf9f899378b4d9fb29f639f475e6624cee08d66 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2016-10-13Merge "Add defence codes to prevent unexpected behavior" into tizensubmit/tizen_3.0/20161028.092423submit/tizen_3.0/20161028.062323submit/tizen/20161026.042356submit/tizen/20161023.232219submit/tizen/20161013.085632accepted/tizen/wearable/20161014.022418accepted/tizen/tv/20161014.022325accepted/tizen/mobile/20161014.022535accepted/tizen/ivi/20161014.022408accepted/tizen/common/20161013.160625accepted/tizen/3.0/wearable/20161028.150809accepted/tizen/3.0/tv/20161028.143439accepted/tizen/3.0/mobile/20161028.143207accepted/tizen/3.0/ivi/20161028.151232Gihun Chang1-11/+49
2016-10-13Add defence codes to prevent unexpected behaviorChangjoon Baek1-11/+49
Check parameters of write system call (buf, len, fd) If find out currupted parameters, return immediately. Change-Id: I035223f3f2d2a07c877872e7a24db158d77a35b3 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2016-09-21Applied APACHE2.0 boilerplate notice to .c filesChangjoon Baek2-38/+24
Applied APACHE2.0 boilerplate notice to trace.c, ttrace.c, These files had owned older SLP boilerplate. It should be replaced. Change-Id: Ib064f2552c510d6a3352a631efe3bff395c4d05d Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2016-08-29Merge "Rename 'TTRACE_TAG_DEBUG' to 'TTRACE_TAG_PERFTEST'" into tizensubmit/tizen/20160831.011831Jonghwa Lee1-1/+1
2016-08-25Rename 'TTRACE_TAG_DEBUG' to 'TTRACE_TAG_PERFTEST'Jonghwa Lee1-1/+1
Change-Id: Ic0053ad161feed30fe29c99884489192f8b3b7ab Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2016-08-23Add '-e' option to exclude specific tags.submit/tizen/20160824.060303accepted/tizen/wearable/20160825.000811accepted/tizen/tv/20160825.000755accepted/tizen/mobile/20160825.000740accepted/tizen/ivi/20160825.000825accepted/tizen/common/20160824.154823Changjoon Baek1-10/+38
Add '-e' option to exclude specific tags, for example, If you don't want to see 'wm' tag, $ atrace -e wm Also, 'am', 'gfx' tags $ atrace -e wm -e am -e gfx Change-Id: I94f0af6a52876a870a65301ae0a70a95ad751c10 Signed-off-by: Changjoon Baek <joon.c.baek@samsung.com>
2016-08-18Add extra tag TTRACE_TAG_DEBUG for TV profile.submit/tizen/20160819.010811accepted/tizen/common/20160819.131040Jonghwa Lee1-0/+1
For some specific demands, it adds extra tag 'DEBUG' for TV profile. The tag will be used for logging miscellaneous stuff. This tag is only avaliable on TV profile. Change-Id: I81575e9bd0ebaaeb073bc1c6b48774f656a4a27a Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2016-07-05change the logic of start/stop to prevent T-trace from writing to the locked ↵HEADsubmit/tizen/20160706.042922accepted/tizen/wearable/20160706.082716accepted/tizen/tv/20160706.082707accepted/tizen/mobile/20160706.082718accepted/tizen/ivi/20160706.082804accepted/tizen/common/20160707.171122masterEunji, Lee2-22/+42
buffer print out error msg only if ttrace is running on debug mode Change-Id: Ic1ee96dbb3a619cdf92187f2f5490b50b3781464
2016-07-05- add protection codes for preventing atrace from double initailizationsubmit/tizen/20160705.082028accepted/tizen/wearable/20160705.101831accepted/tizen/tv/20160705.101809accepted/tizen/mobile/20160705.101854accepted/tizen/ivi/20160705.101738accepted/tizen/common/20160706.141733Eunji, Lee2-29/+64
- add protection codes for avoding tracing msg size overflow Change-Id: I5415c94b5ed77c1fa805ff73d6d12fc10194085c Signed-off-by: Eunji, Lee <eunjieji.lee@samsung.com>
2016-05-26add ttrace_exension_write() call to trace APIsEunji, Lee1-17/+46
Change-Id: Ia76b586c2ec8aae7482221a844c418971f6933e9 Signed-off-by: Eunji, Lee <eunjieji.lee@samsung.com>
2016-05-24Adds command to auto-mount tracingfs for enabling ttrace on linux kernel >= 4.1Eunji, Lee1-1/+2
Change-Id: I4ddecf29c4918a641c6940f2910ae2e93b8a3754 Signed-off-by: Eunji, Lee <eunjieji.lee@samsung.com>
2016-05-10increase default buf size to 1024 and add protection code for changes of ↵Eunji, Lee1-4/+34
_SC_GETGR_R_SIZE_MAX Change-Id: I6abbe0da54442eb1172b0d611700b51d83c62e00
2016-05-03fix svace issue - PROC_USE.VULNERABLEEunji, Lee1-12/+2
Change-Id: Iac00cf6c8efd6aebbcb3c8f5a3e3d09c2361fb9c
2016-04-15change group name to support latest tizen 3.0Eunji, Lee1-2/+20
Change-Id: I28ac6943b4eca24924cff0f5d8f2c57302a5df99
2016-03-04fix fd handle leak in atrace.cpp and ttrace.cEunji, Lee2-30/+32
Change-Id: I1112a5f039cb147b8b64dc428f42e9e97523b2c5 Signed-off-by: Eunji, Lee <eunjieji.lee@samsung.com>
2016-02-24add TTRACE_TAG_EFLsubmit/tizen/20160224.104940accepted/tizen/wearable/20160225.081740accepted/tizen/tv/20160225.081718accepted/tizen/mobile/20160225.081705accepted/tizen/ivi/20160225.081753Eunji, Lee2-0/+2
Change-Id: Idf74de606ca6a1d7977512d631ae4eeda1f9c73c Signed-off-by: Eunji, Lee <eunjieji.lee@samsung.com>
2016-02-15sync with 2.4 branch (commit:1ae27085e86ce77d74922fc43a256a9e7108724e)Eunji, Lee2-69/+133
Change-Id: Ie3cba9e4c69c848ec88b4cad2e64c9c0a8c977e4 Signed-off-by: Eunji, Lee <eunjieji.lee@samsung.com>
2016-01-11ttrace: change perms. at tracing filesjoon.c.baek1-21/+21
Permission 0664 is not working atrace on Tizen3.0 targets(TM!). Change to 0666 of related files. Change-Id: Ia936a0f3db9b81cb4e2378f2687ade8f7d8e5f4b Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2016-01-06ttrace: sync with latest code at spin serverjoon.c.baek2-6/+103
sync with below commit, spin change id : I81a345fdbf66e54cfbf1f3bcf0797fd91188b93c spin commit id : 34f2dfa9650369778681e43b0d45768c036bfcd7 Change-Id: Ia0bbe19f47a23361385a34510b6c4f1c6768ca62 Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2015-09-10resolve smack permission issuses and update ttrace to the latest versionEunji, Lee4-105/+256
* remarkable changes - creates ttrace_tag file when boot-up the device - provides static lib. version of ttrace library - dynamically generates ttrace.h Change-Id: I2e08d234e96e4d921e0a52d403fed34e21175105 Signed-off-by: Eunji, Lee <eunjieji.lee@samsung.com>
2015-06-30[TTRACE] Sync. with T-trace package on tizen2.4Eunji, Lee2-169/+213
Change-Id: I6f35ad1861ea2d5fee51f4690183d969b4b50f47 Signed-off-by: Eunji, Lee <eunjieji.lee@samsung.com>
2015-06-09[TTRACE] Add Error code for UTCEunji, Lee1-0/+1
Change-Id: I395a689e3d8c71a6806091738e7253ad91c208c9 Signed-off-by: Eunji, Lee <eunjieji.lee@samsung.com>
2015-05-22ttrace: Add MODULE_LICENSE_APACHE2Eunji, Lee1-0/+0
Change-Id: I056f1d6825e66e414c81c60b5f8fb50a68cd8e71 Signed-off-by: Eunji, Lee <eunjieji.lee@samsung.com>
2015-05-22ttrace: Resolve build breakjoon.c.baek1-1/+1
ttrace was migrated from Tizen 2.4 repository. Build environments is not suitable with ttrace. Remove including tizen2.4 header and UTC related codes. This patch only support to build armv7l arch. Need more work to build other architectures. (arch64, x86, x86_64, etc,.) Change-Id: I6d98b5c0e4c006cf99c4a8341c1cf91eed9b7aa1 Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
2015-05-22ttrace: Migration ttrace from Tizen 2.4 repositoryjoon.c.baek4-0/+1529
Migration ttrace from Tizen 2.4 repository Change-Id: Ib70d79e7535a74a3681e5fc63eeaba27503923f8 Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>