diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2014-05-23 12:43:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-23 16:48:05 -0400 |
commit | b1fcd35cf53553a0a3ef949b05106d921446abc3 (patch) | |
tree | 4784eb248a9705f2eae7dcb10968497f0559499f /drivers/isdn/i4l | |
parent | 8556ce79d5986a87fee4c29300b4efee07c0f15e (diff) |
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>
Diffstat (limited to 'drivers/isdn/i4l')
-rw-r--r-- | drivers/isdn/i4l/isdn_ppp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index a5da511e3c9a..61ac63237446 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c | |||
@@ -634,7 +634,7 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg) | |||
634 | #ifdef CONFIG_IPPP_FILTER | 634 | #ifdef CONFIG_IPPP_FILTER |
635 | case PPPIOCSPASS: | 635 | case PPPIOCSPASS: |
636 | { | 636 | { |
637 | struct sock_fprog fprog; | 637 | struct sock_fprog_kern fprog; |
638 | struct sock_filter *code; | 638 | struct sock_filter *code; |
639 | int err, len = get_filter(argp, &code); | 639 | int err, len = get_filter(argp, &code); |
640 | 640 | ||
@@ -653,7 +653,7 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg) | |||
653 | } | 653 | } |
654 | case PPPIOCSACTIVE: | 654 | case PPPIOCSACTIVE: |
655 | { | 655 | { |
656 | struct sock_fprog fprog; | 656 | struct sock_fprog_kern fprog; |
657 | struct sock_filter *code; | 657 | struct sock_filter *code; |
658 | int err, len = get_filter(argp, &code); | 658 | int err, len = get_filter(argp, &code); |
659 | 659 | ||