exec: Add node tampering blacklist function

We'll be adding checks to block writes from processes which tamper with
values that we control from within the kernel, especially ones that
userspace writes to for boosting. Add a central function to perform the
process check to reduce code duplication.

This blacklists the following processes which are known to tamper with
such values:
  - init
  - libperfmgr (power@1.3-servi and NodeLooperThrea)
  - perfd (perf@1.0-servic)
  - init.qcom.post_boot.sh (init.qcom.post_)

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
This commit is contained in:
Danny Lin
2019-08-04 03:40:30 +00:00
committed by UtsavBalar1231
parent fb81702650
commit ce392dfd95

View File

@@ -148,4 +148,15 @@ extern int do_execveat(int, struct filename *,
const char __user * const __user *,
int);
static inline bool task_is_booster(struct task_struct *tsk)
{
char comm[sizeof(tsk->comm)];
get_task_comm(comm, tsk);
return !strcmp(comm, "init") || !strcmp(comm, "NodeLooperThrea") ||
!strcmp(comm, "power@1.3-servi") ||
!strcmp(comm, "perf@1.0-servic") ||
!strcmp(comm, "init.qcom.post_");
}
#endif /* _LINUX_BINFMTS_H */