net: filter: let unattached filters use sock_fprog_kern
authorDaniel Borkmann <dborkman@redhat.com>
Fri, 23 May 2014 16:43:58 +0000 (18:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 May 2014 20:48:05 +0000 (16:48 -0400)
commitb1fcd35cf53553a0a3ef949b05106d921446abc3
tree4784eb248a9705f2eae7dcb10968497f0559499f
parent8556ce79d5986a87fee4c29300b4efee07c0f15e
net: filter: let unattached filters use sock_fprog_kern

The sk_unattached_filter_create() API is used by BPF filters that
are not directly attached or related to sockets, and are used in
team, ptp, xt_bpf, cls_bpf, etc. As such all users do their own
internal managment of obtaining filter blocks and thus already
have them in kernel memory and set up before calling into
sk_unattached_filter_create(). As a result, due to __user annotation
in sock_fprog, sparse triggers false positives (incorrect type in
assignment [different address space]) when filters are set up before
passing them to sk_unattached_filter_create(). Therefore, let
sk_unattached_filter_create() API use sock_fprog_kern to overcome
this issue.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/isdn/i4l/isdn_ppp.c
drivers/net/ppp/ppp_generic.c
drivers/net/team/team_mode_loadbalance.c
include/linux/filter.h
lib/test_bpf.c
net/core/filter.c
net/core/ptp_classifier.c
net/netfilter/xt_bpf.c
net/sched/cls_bpf.c