diff options
author | Christoph Hellwig <hch@lst.de> | 2020-07-23 08:08:55 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-24 15:41:54 -0700 |
commit | b03afaa82ece13b2a008f0e3a7127bead578e3e6 (patch) | |
tree | d34d7c6c990946d126e74053cdd8d37291dbe48e /net/bpfilter | |
parent | c2f12630c60ff33a9cafd221646053fc10ec59b6 (diff) |
bpfilter: switch bpfilter_ip_set_sockopt to sockptr_t
This is mostly to prepare for cleaning up the callers, as bpfilter by
design can't handle kernel pointers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bpfilter')
-rw-r--r-- | net/bpfilter/bpfilter_kern.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bpfilter/bpfilter_kern.c b/net/bpfilter/bpfilter_kern.c index 00540457e5f4..f580c3344cb3 100644 --- a/net/bpfilter/bpfilter_kern.c +++ b/net/bpfilter/bpfilter_kern.c @@ -60,17 +60,17 @@ stop: } static int bpfilter_process_sockopt(struct sock *sk, int optname, - char __user *optval, unsigned int optlen, + sockptr_t optval, unsigned int optlen, bool is_set) { struct mbox_request req = { .is_set = is_set, .pid = current->pid, .cmd = optname, - .addr = (uintptr_t)optval, + .addr = (uintptr_t)optval.user, .len = optlen, }; - if (uaccess_kernel()) { + if (uaccess_kernel() || sockptr_is_kernel(optval)) { pr_err("kernel access not supported\n"); return -EFAULT; } |