-
Notifications
You must be signed in to change notification settings - Fork 5
uprobe,bpf: Allow to change app registers from uprobe registers #5968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uprobe,bpf: Allow to change app registers from uprobe registers #5968
Conversation
|
Upstream branch: b13448d |
2b3c471 to
2211108
Compare
|
Upstream branch: 180a46b |
b17cd82 to
32ca42d
Compare
2211108 to
acca942
Compare
|
Upstream branch: 6ff4a0f |
32ca42d to
7c9dd8d
Compare
acca942 to
0821404
Compare
|
Upstream branch: 3547a61 |
7c9dd8d to
4b4b4d6
Compare
0821404 to
028d6d4
Compare
|
Upstream branch: 8cd189e |
4b4b4d6 to
42291ce
Compare
028d6d4 to
0c300ac
Compare
|
Upstream branch: 815276d |
42291ce to
89949c7
Compare
0c300ac to
b38c040
Compare
|
Upstream branch: 57cb269 |
89949c7 to
b4191ae
Compare
b38c040 to
1a8f119
Compare
|
Upstream branch: 5612ea8 |
b4191ae to
c4f056d
Compare
1a8f119 to
da4ec66
Compare
|
Upstream branch: 5a427fd |
c4f056d to
6aac867
Compare
a98c373 to
f2c71e8
Compare
|
Upstream branch: 348f611 |
22343e3 to
68085cd
Compare
f2c71e8 to
0af025f
Compare
|
Upstream branch: 2383e45 |
68085cd to
315b00e
Compare
0af025f to
30b62c7
Compare
|
Upstream branch: f0b5c14 |
315b00e to
62f1e0b
Compare
30b62c7 to
41e1333
Compare
|
Upstream branch: 8b52d09 |
62f1e0b to
aec27d5
Compare
41e1333 to
34ccf81
Compare
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]>
If uprobe handler changes instruction pointer we still execute single step) or emulate the original instruction and increment the (new) ip with its length. This makes the new instruction pointer bogus and application will likely crash on illegal instruction execution. If user decided to take execution elsewhere, it makes little sense to execute the original instruction, so let's skip it. Acked-by: Oleg Nesterov <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Signed-off-by: Jiri Olsa <[email protected]>
Adding test to check we can change common register values through uprobe program. It's x86_64 specific test. Acked-by: Andrii Nakryiko <[email protected]> Signed-off-by: Jiri Olsa <[email protected]>
Adding test to check we can change the application execution through instruction pointer change through uprobe program. It's x86_64 specific test. Acked-by: Andrii Nakryiko <[email protected]> Signed-off-by: Jiri Olsa <[email protected]>
Adding test to check we can't attach standard kprobe program that writes to the context. It's x86_64 specific test. Acked-by: Andrii Nakryiko <[email protected]> Signed-off-by: Jiri Olsa <[email protected]>
|
Upstream branch: 34f033a |
Adding test to check we can't attach kprobe multi program that writes to the context. It's x86_64 specific test. Acked-by: Andrii Nakryiko <[email protected]> Signed-off-by: Jiri Olsa <[email protected]>
aec27d5 to
3d74e02
Compare
34ccf81 to
aea6d55
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1003090 irrelevant now. Closing PR. |
Pull request for series with
subject: uprobe,bpf: Allow to change app registers from uprobe registers
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003090