Make prepare_app() safer in non-main threads 26/259426/1
authorKonrad Lipinski <k.lipinski2@samsung.com>
Mon, 7 Jun 2021 16:44:55 +0000 (18:44 +0200)
committerKonrad Lipinski <k.lipinski2@samsung.com>
Mon, 7 Jun 2021 16:45:01 +0000 (18:45 +0200)
commit815ff9ba033bd5119b03b1500dec21044d3b160f
treedf7cd2358aa1e6dca1043c7c47a7a973557a754e
parent9e8adb561ff53dace466e5bbc6844c4c2be6cddd
Make prepare_app() safer in non-main threads

Calling prepare_app() from a non-main thread in a multithreaded
process could fail. While labels for other threads were being correctly
set by writing to /proc/<tid>/attr/current, the prepare_app thread used
smack_set_label_for_self() and thus /proc/self/attr/current.

This is easily fixed by reusing label_for_self_internal() so that all
threads are uniformly treated, each using its own tid.

Change-Id: Id5b3071b08057200331d64bf8d6cd172ae729df1
src/client/client-security-manager.cpp