Commit 9c06895
bpf: Allow uprobe program to change context registers
Currently uprobe (BPF_PROG_TYPE_KPROBE) program can't write to the
context registers data. While this makes sense for kprobe attachments,
for uprobe attachment it might make sense to be able to change user
space registers to alter application execution.
Since uprobe and kprobe programs share the same type (BPF_PROG_TYPE_KPROBE),
we can't deny write access to context during the program load. We need
to check on it during program attachment to see if it's going to be
kprobe or uprobe.
Storing the program's write attempt to context and checking on it
during the attachment.
Acked-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Jiri Olsa <[email protected]>1 parent 2b3c471 commit 9c06895
3 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1624 | 1624 | | |
1625 | 1625 | | |
1626 | 1626 | | |
| 1627 | + | |
1627 | 1628 | | |
1628 | 1629 | | |
1629 | 1630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11232 | 11232 | | |
11233 | 11233 | | |
11234 | 11234 | | |
| 11235 | + | |
| 11236 | + | |
| 11237 | + | |
| 11238 | + | |
11235 | 11239 | | |
11236 | 11240 | | |
11237 | 11241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1521 | 1521 | | |
1522 | 1522 | | |
1523 | 1523 | | |
1524 | | - | |
1525 | | - | |
1526 | 1524 | | |
1527 | 1525 | | |
1528 | 1526 | | |
| |||
1532 | 1530 | | |
1533 | 1531 | | |
1534 | 1532 | | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
1535 | 1536 | | |
1536 | 1537 | | |
1537 | 1538 | | |
| |||
2918 | 2919 | | |
2919 | 2920 | | |
2920 | 2921 | | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
2921 | 2926 | | |
2922 | 2927 | | |
2923 | 2928 | | |
| |||
0 commit comments