Commit f782e2c
bpf: Relax return code check for subprograms
Currently verifier enforces return code checks for subprograms in the
same manner as it does for program entry points. This prevents returning
arbitrary scalar values from subprograms. Scalar type of returned values
is checked by btf_prepare_func_args() and hence it should be safe to
allow only scalars for now. Relax return code checks for subprograms and
allow any correct scalar values.
Fixes: 51c39bb (bpf: Introduce function-by-function verification)
Signed-off-by: Dmitrii Banshchikov <me@ubique.spb.ru>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20201113171756.90594-1-me@ubique.spb.ru1 parent 50431b4 commit f782e2c
3 files changed
Lines changed: 33 additions & 2 deletions
File tree
- kernel/bpf
- tools/testing/selftests/bpf
- prog_tests
- progs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7786 | 7786 | | |
7787 | 7787 | | |
7788 | 7788 | | |
| 7789 | + | |
7789 | 7790 | | |
7790 | 7791 | | |
7791 | | - | |
| 7792 | + | |
| 7793 | + | |
7792 | 7794 | | |
7793 | 7795 | | |
7794 | 7796 | | |
| |||
7808 | 7810 | | |
7809 | 7811 | | |
7810 | 7812 | | |
| 7813 | + | |
| 7814 | + | |
| 7815 | + | |
| 7816 | + | |
| 7817 | + | |
| 7818 | + | |
| 7819 | + | |
| 7820 | + | |
| 7821 | + | |
| 7822 | + | |
7811 | 7823 | | |
7812 | 7824 | | |
7813 | 7825 | | |
| |||
7861 | 7873 | | |
7862 | 7874 | | |
7863 | 7875 | | |
7864 | | - | |
7865 | 7876 | | |
7866 | 7877 | | |
7867 | 7878 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments