Commit da5fbaa
ANDROID: SPED: Add vendor hooks in Scheduler
SPED (Scheduler-based Privilege Elevation Detection) a Kernel protection
that blocks privilege elevation attacks. Before scheduling a task for
execution, it checks if there is a transition to uid/euid 0 (root) and
if so, it blocks the execution.
We need to register 3 vendor hooks:
* When a task is created in copy_process()
* Before a task is selected for execution in __pick_next_task()
* When a task is terminated in __put_task_struct()
The rationale on why we are using these functions can be found in the "Understanding the Linux Scheduler" tab of go/sped-cookbook
NOTE: There is already the trace_task_newtask() hook in copy_process() so we will reuse it for process creation. Therefore we will add only 2 new hooks.
1p: go/hyp-sched-lpe-detection
design (detailed): go/sped-bluedoc
Bug: 403623944
Test: None
Change-Id: Iae0f223488e8c9c5050f69f11d8930ad9b14871f
Signed-off-by: Kyriakos Ispoglou <ispo@google.com>1 parent 315d114 commit da5fbaa
4 files changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
542 | 550 | | |
543 | 551 | | |
544 | 552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
| 965 | + | |
965 | 966 | | |
966 | 967 | | |
967 | 968 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6606 | 6606 | | |
6607 | 6607 | | |
6608 | 6608 | | |
| 6609 | + | |
| 6610 | + | |
6609 | 6611 | | |
6610 | 6612 | | |
6611 | 6613 | | |
| |||
6621 | 6623 | | |
6622 | 6624 | | |
6623 | 6625 | | |
| 6626 | + | |
6624 | 6627 | | |
6625 | 6628 | | |
6626 | 6629 | | |
6627 | 6630 | | |
| 6631 | + | |
6628 | 6632 | | |
6629 | 6633 | | |
6630 | 6634 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
0 commit comments