Commit 00965c2
bpf: force BPF_F_RDONLY_PROG on insn array creation
The original implementation added a hack to check_mem_access()
to prevent programs from writing into insn arrays. To get rid
of this hack, enforce BPF_F_RDONLY_PROG on map creation.
Also fix the corresponding selftest, as the error message changes
with this patch.
Suggested-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Anton Protopopov <[email protected]>1 parent 8c83cb5 commit 00965c2
File tree
3 files changed
+10
-8
lines changed- kernel/bpf
- tools/testing/selftests/bpf/progs
3 files changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7565 | 7565 | | |
7566 | 7566 | | |
7567 | 7567 | | |
7568 | | - | |
7569 | | - | |
7570 | | - | |
7571 | | - | |
7572 | | - | |
7573 | 7568 | | |
7574 | 7569 | | |
7575 | 7570 | | |
| |||
7584 | 7579 | | |
7585 | 7580 | | |
7586 | 7581 | | |
7587 | | - | |
| 7582 | + | |
| 7583 | + | |
| 7584 | + | |
| 7585 | + | |
7588 | 7586 | | |
7589 | 7587 | | |
7590 | | - | |
| 7588 | + | |
| 7589 | + | |
7591 | 7590 | | |
7592 | 7591 | | |
7593 | 7592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| |||
0 commit comments