23
23
#include <linux/btf_ids.h>
24
24
#include <linux/bpf_mem_alloc.h>
25
25
#include <linux/kasan.h>
26
+ #include <linux/bpf_verifier.h>
26
27
27
28
#include "../../lib/kstrtox.h"
28
29
@@ -1912,6 +1913,12 @@ const struct bpf_func_proto bpf_probe_read_user_str_proto __weak;
1912
1913
const struct bpf_func_proto bpf_probe_read_kernel_proto __weak ;
1913
1914
const struct bpf_func_proto bpf_probe_read_kernel_str_proto __weak ;
1914
1915
const struct bpf_func_proto bpf_task_pt_regs_proto __weak ;
1916
+ const struct bpf_func_proto bpf_perf_event_read_proto __weak ;
1917
+ const struct bpf_func_proto bpf_send_signal_proto __weak ;
1918
+ const struct bpf_func_proto bpf_send_signal_thread_proto __weak ;
1919
+ const struct bpf_func_proto bpf_get_task_stack_sleepable_proto __weak ;
1920
+ const struct bpf_func_proto bpf_get_task_stack_proto __weak ;
1921
+ const struct bpf_func_proto bpf_get_branch_snapshot_proto __weak ;
1915
1922
1916
1923
const struct bpf_func_proto *
1917
1924
bpf_base_func_proto (enum bpf_func_id func_id , const struct bpf_prog * prog )
@@ -1965,6 +1972,8 @@ bpf_base_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
1965
1972
return & bpf_get_current_pid_tgid_proto ;
1966
1973
case BPF_FUNC_get_ns_current_pid_tgid :
1967
1974
return & bpf_get_ns_current_pid_tgid_proto ;
1975
+ case BPF_FUNC_get_current_uid_gid :
1976
+ return & bpf_get_current_uid_gid_proto ;
1968
1977
default :
1969
1978
break ;
1970
1979
}
@@ -2022,6 +2031,8 @@ bpf_base_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
2022
2031
return & bpf_get_current_cgroup_id_proto ;
2023
2032
case BPF_FUNC_get_current_ancestor_cgroup_id :
2024
2033
return & bpf_get_current_ancestor_cgroup_id_proto ;
2034
+ case BPF_FUNC_current_task_under_cgroup :
2035
+ return & bpf_current_task_under_cgroup_proto ;
2025
2036
#endif
2026
2037
default :
2027
2038
break ;
@@ -2037,6 +2048,8 @@ bpf_base_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
2037
2048
return & bpf_get_current_task_proto ;
2038
2049
case BPF_FUNC_get_current_task_btf :
2039
2050
return & bpf_get_current_task_btf_proto ;
2051
+ case BPF_FUNC_get_current_comm :
2052
+ return & bpf_get_current_comm_proto ;
2040
2053
case BPF_FUNC_probe_read_user :
2041
2054
return & bpf_probe_read_user_proto ;
2042
2055
case BPF_FUNC_probe_read_kernel :
@@ -2047,6 +2060,10 @@ bpf_base_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
2047
2060
case BPF_FUNC_probe_read_kernel_str :
2048
2061
return security_locked_down (LOCKDOWN_BPF_READ_KERNEL ) < 0 ?
2049
2062
NULL : & bpf_probe_read_kernel_str_proto ;
2063
+ case BPF_FUNC_copy_from_user :
2064
+ return & bpf_copy_from_user_proto ;
2065
+ case BPF_FUNC_copy_from_user_task :
2066
+ return & bpf_copy_from_user_task_proto ;
2050
2067
case BPF_FUNC_snprintf_btf :
2051
2068
return & bpf_snprintf_btf_proto ;
2052
2069
case BPF_FUNC_snprintf :
@@ -2057,6 +2074,27 @@ bpf_base_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
2057
2074
return bpf_get_trace_vprintk_proto ();
2058
2075
case BPF_FUNC_perf_event_read_value :
2059
2076
return bpf_get_perf_event_read_value_proto ();
2077
+ case BPF_FUNC_perf_event_read :
2078
+ return & bpf_perf_event_read_proto ;
2079
+ case BPF_FUNC_send_signal :
2080
+ return & bpf_send_signal_proto ;
2081
+ case BPF_FUNC_send_signal_thread :
2082
+ return & bpf_send_signal_thread_proto ;
2083
+ case BPF_FUNC_get_task_stack :
2084
+ return prog -> sleepable ? & bpf_get_task_stack_sleepable_proto
2085
+ : & bpf_get_task_stack_proto ;
2086
+ case BPF_FUNC_task_storage_get :
2087
+ if (bpf_prog_check_recur (prog ))
2088
+ return & bpf_task_storage_get_recur_proto ;
2089
+ return & bpf_task_storage_get_proto ;
2090
+ case BPF_FUNC_task_storage_delete :
2091
+ if (bpf_prog_check_recur (prog ))
2092
+ return & bpf_task_storage_delete_recur_proto ;
2093
+ return & bpf_task_storage_delete_proto ;
2094
+ case BPF_FUNC_get_branch_snapshot :
2095
+ return & bpf_get_branch_snapshot_proto ;
2096
+ case BPF_FUNC_find_vma :
2097
+ return & bpf_find_vma_proto ;
2060
2098
default :
2061
2099
return NULL ;
2062
2100
}
0 commit comments