Commit 7384893
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]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>1 parent 34f033a commit 7384893
3 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1639 | 1639 | | |
1640 | 1640 | | |
1641 | 1641 | | |
| 1642 | + | |
1642 | 1643 | | |
1643 | 1644 | | |
1644 | 1645 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
1338 | 1338 | | |
1339 | 1339 | | |
1340 | 1340 | | |
1341 | | - | |
1342 | | - | |
1343 | 1341 | | |
1344 | 1342 | | |
1345 | 1343 | | |
| |||
1349 | 1347 | | |
1350 | 1348 | | |
1351 | 1349 | | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
1352 | 1353 | | |
1353 | 1354 | | |
1354 | 1355 | | |
| |||
2735 | 2736 | | |
2736 | 2737 | | |
2737 | 2738 | | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
2738 | 2743 | | |
2739 | 2744 | | |
2740 | 2745 | | |
| |||
0 commit comments