Skip to content

Commit

Permalink
bpf: disallow bpf tc programs access current->pid,uid
Browse files Browse the repository at this point in the history
Accessing current->pid/uid from cls_bpf may lead to misleading results and
should not be used when TC classifiers need accurate information about pid/uid.

Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Alexei Starovoitov authored and davem330 committed Jun 16, 2015
1 parent ea6bb99 commit 89d256b
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,12 +1461,6 @@ tc_cls_act_func_proto(enum bpf_func_id func_id)
return &bpf_l4_csum_replace_proto;
case BPF_FUNC_clone_redirect:
return &bpf_clone_redirect_proto;
case BPF_FUNC_get_current_pid_tgid:
return &bpf_get_current_pid_tgid_proto;
case BPF_FUNC_get_current_uid_gid:
return &bpf_get_current_uid_gid_proto;
case BPF_FUNC_get_current_comm:
return &bpf_get_current_comm_proto;
default:
return sk_filter_func_proto(func_id);
}
Expand Down

0 comments on commit 89d256b

Please sign in to comment.