diff options
author | Christoph Hellwig <hch@lst.de> | 2020-07-23 09:08:47 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-25 01:41:53 +0300 |
commit | b1ea9ff6aff2deae84eccaf0a07cd14912669680 (patch) | |
tree | 1b4e6db9c617a49ab90bb26dcd3e3cbeb946f5ec /net/core/filter.c | |
parent | ba423fdaa589d972473083defedf9e862626d268 (diff) | |
download | linux-b1ea9ff6aff2deae84eccaf0a07cd14912669680.tar.xz |
net: switch copy_bpf_fprog_from_user to sockptr_t
Pass a sockptr_t to prepare for set_fs-less handling of the kernel
pointer from bpf-cgroup.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/filter.c')
-rw-r--r-- | net/core/filter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index 3fa16b8c0d61..29e3455122f7 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -77,14 +77,14 @@ #include <net/transp_v6.h> #include <linux/btf_ids.h> -int copy_bpf_fprog_from_user(struct sock_fprog *dst, void __user *src, int len) +int copy_bpf_fprog_from_user(struct sock_fprog *dst, sockptr_t src, int len) { if (in_compat_syscall()) { struct compat_sock_fprog f32; if (len != sizeof(f32)) return -EINVAL; - if (copy_from_user(&f32, src, sizeof(f32))) + if (copy_from_sockptr(&f32, src, sizeof(f32))) return -EFAULT; memset(dst, 0, sizeof(*dst)); dst->len = f32.len; @@ -92,7 +92,7 @@ int copy_bpf_fprog_from_user(struct sock_fprog *dst, void __user *src, int len) } else { if (len != sizeof(*dst)) return -EINVAL; - if (copy_from_user(dst, src, sizeof(*dst))) + if (copy_from_sockptr(dst, src, sizeof(*dst))) return -EFAULT; } |