提交 d200cf62 编写于 作者: C Christoph Hellwig 提交者: David S. Miller

bpfilter: reject kernel addresses

The bpfilter user mode helper processes the optval address using
process_vm_readv.  Don't send it kernel addresses fed under
set_fs(KERNEL_DS) as that won't work.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c9ffebdd
...@@ -70,6 +70,10 @@ static int bpfilter_process_sockopt(struct sock *sk, int optname, ...@@ -70,6 +70,10 @@ static int bpfilter_process_sockopt(struct sock *sk, int optname,
.addr = (uintptr_t)optval, .addr = (uintptr_t)optval,
.len = optlen, .len = optlen,
}; };
if (uaccess_kernel()) {
pr_err("kernel access not supported\n");
return -EFAULT;
}
return bpfilter_send_req(&req); return bpfilter_send_req(&req);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册