summaryrefslogtreecommitdiffstats
path: root/net/bpfilter/bpfilter_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bpfilter/bpfilter_kern.c')
-rw-r--r--net/bpfilter/bpfilter_kern.c6
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;
}