Commit 3e924e9
bpf: Allow subprogs to return arena pointers
BPF subprogs currently only return void or scalar values. However,
it is also safe to return arena pointers between subprogs in the same
BPF program: Arena pointers are guaranteed to be safe for both programs
at any point. Expand the verifier to permit returning an arena pointer
to the caller.
The main subprog is still not allowed to return an arena pointer because
arena pointers are internal to the BPF program, and the return values
permitted for each main subprog depend on the program type anyway.
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/r/20260602004120.17087-4-emil@etsalapatis.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 5ab4bc6 commit 3e924e9
2 files changed
Lines changed: 54 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7858 | 7858 | | |
7859 | 7859 | | |
7860 | 7860 | | |
| 7861 | + | |
| 7862 | + | |
| 7863 | + | |
| 7864 | + | |
| 7865 | + | |
7861 | 7866 | | |
7862 | 7867 | | |
7863 | 7868 | | |
7864 | 7869 | | |
7865 | | - | |
7866 | | - | |
| 7870 | + | |
| 7871 | + | |
| 7872 | + | |
| 7873 | + | |
| 7874 | + | |
| 7875 | + | |
| 7876 | + | |
7867 | 7877 | | |
7868 | 7878 | | |
7869 | 7879 | | |
| |||
7873 | 7883 | | |
7874 | 7884 | | |
7875 | 7885 | | |
7876 | | - | |
7877 | | - | |
7878 | 7886 | | |
7879 | 7887 | | |
7880 | 7888 | | |
7881 | 7889 | | |
7882 | 7890 | | |
| 7891 | + | |
| 7892 | + | |
| 7893 | + | |
| 7894 | + | |
| 7895 | + | |
| 7896 | + | |
| 7897 | + | |
| 7898 | + | |
| 7899 | + | |
| 7900 | + | |
| 7901 | + | |
| 7902 | + | |
| 7903 | + | |
| 7904 | + | |
| 7905 | + | |
| 7906 | + | |
| 7907 | + | |
| 7908 | + | |
| 7909 | + | |
| 7910 | + | |
| 7911 | + | |
| 7912 | + | |
| 7913 | + | |
| 7914 | + | |
| 7915 | + | |
| 7916 | + | |
| 7917 | + | |
| 7918 | + | |
7883 | 7919 | | |
7884 | 7920 | | |
7885 | 7921 | | |
| |||
7963 | 7999 | | |
7964 | 8000 | | |
7965 | 8001 | | |
7966 | | - | |
7967 | | - | |
7968 | | - | |
7969 | | - | |
7970 | | - | |
7971 | | - | |
7972 | | - | |
7973 | | - | |
7974 | | - | |
7975 | | - | |
7976 | | - | |
7977 | | - | |
| 8002 | + | |
| 8003 | + | |
| 8004 | + | |
| 8005 | + | |
| 8006 | + | |
| 8007 | + | |
| 8008 | + | |
| 8009 | + | |
| 8010 | + | |
| 8011 | + | |
7978 | 8012 | | |
7979 | 8013 | | |
7980 | 8014 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16503 | 16503 | | |
16504 | 16504 | | |
16505 | 16505 | | |
| 16506 | + | |
| 16507 | + | |
| 16508 | + | |
| 16509 | + | |
16506 | 16510 | | |
16507 | 16511 | | |
16508 | 16512 | | |
| |||
0 commit comments