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/sock.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/sock.c')
-rw-r--r-- | net/core/sock.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 6da54eac2b34..71fc7e4ddd06 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1063,7 +1063,8 @@ set_sndbuf: case SO_ATTACH_FILTER: { struct sock_fprog fprog; - ret = copy_bpf_fprog_from_user(&fprog, optval, optlen); + ret = copy_bpf_fprog_from_user(&fprog, USER_SOCKPTR(optval), + optlen); if (!ret) ret = sk_attach_filter(&fprog, sk); break; @@ -1084,7 +1085,8 @@ set_sndbuf: case SO_ATTACH_REUSEPORT_CBPF: { struct sock_fprog fprog; - ret = copy_bpf_fprog_from_user(&fprog, optval, optlen); + ret = copy_bpf_fprog_from_user(&fprog, USER_SOCKPTR(optval), + optlen); if (!ret) ret = sk_reuseport_attach_filter(&fprog, sk); break; |