BACKPORT: net: simplify cBPF setsockopt compat handling

Add a helper that copies either a native or compat bpf_fprog from
userspace after verifying the length, and remove the compat setsockopt
handlers that now aren't required.

Change-Id: Ie62fb625ef94ad6d2148531c279e87e82524aae0
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Christoph Hellwig 2020-07-17 08:23:13 +02:00 • committed by basamaryan
commit a13a4c9122
No known key found for this signature in database
GPG key ID: 210D5384FB2A5885
6 changed files with 40 additions and 96 deletions

View file

@ -40,7 +40,6 @@ struct compat_cmsghdr {
int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *,
struct sockaddr __user **, struct iovec **);
struct sock_fprog __user *get_compat_bpf_fprog(char __user *optval);
int put_cmsg_compat(struct msghdr*, int, int, int, void *);
int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *,