mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-02 18:17:50 -04:00
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>
This commit is contained in:
committed by
David S. Miller
parent
c2f12630c6
commit
b03afaa82e
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user