Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Move the bpf verifier trace check into the new switch statement in HEAD. Resolve the overlapping changes in hinic, where bug fixes overlap the addition of VF support. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -486,7 +486,12 @@ static int array_map_mmap(struct bpf_map *map, struct vm_area_struct *vma)
|
||||
if (!(map->map_flags & BPF_F_MMAPABLE))
|
||||
return -EINVAL;
|
||||
|
||||
return remap_vmalloc_range(vma, array_map_vmalloc_addr(array), pgoff);
|
||||
if (vma->vm_pgoff * PAGE_SIZE + (vma->vm_end - vma->vm_start) >
|
||||
PAGE_ALIGN((u64)array->map.max_entries * array->elem_size))
|
||||
return -EINVAL;
|
||||
|
||||
return remap_vmalloc_range(vma, array_map_vmalloc_addr(array),
|
||||
vma->vm_pgoff + pgoff);
|
||||
}
|
||||
|
||||
const struct bpf_map_ops array_map_ops = {
|
||||
|
@@ -1489,8 +1489,10 @@ static int map_lookup_and_delete_elem(union bpf_attr *attr)
|
||||
if (err)
|
||||
goto free_value;
|
||||
|
||||
if (copy_to_user(uvalue, value, value_size) != 0)
|
||||
if (copy_to_user(uvalue, value, value_size) != 0) {
|
||||
err = -EFAULT;
|
||||
goto free_value;
|
||||
}
|
||||
|
||||
err = 0;
|
||||
|
||||
|
@@ -4389,7 +4389,9 @@ static void do_refine_retval_range(struct bpf_reg_state *regs, int ret_type,
|
||||
|
||||
if (ret_type != RET_INTEGER ||
|
||||
(func_id != BPF_FUNC_get_stack &&
|
||||
func_id != BPF_FUNC_probe_read_str))
|
||||
func_id != BPF_FUNC_probe_read_str &&
|
||||
func_id != BPF_FUNC_probe_read_kernel_str &&
|
||||
func_id != BPF_FUNC_probe_read_user_str))
|
||||
return;
|
||||
|
||||
ret_reg->smax_value = meta->msize_max_value;
|
||||
@@ -7113,9 +7115,23 @@ static int check_return_code(struct bpf_verifier_env *env)
|
||||
range = tnum_const(0);
|
||||
break;
|
||||
case BPF_PROG_TYPE_TRACING:
|
||||
if (env->prog->expected_attach_type != BPF_TRACE_ITER)
|
||||
switch (env->prog->expected_attach_type) {
|
||||
case BPF_TRACE_FENTRY:
|
||||
case BPF_TRACE_FEXIT:
|
||||
range = tnum_const(0);
|
||||
break;
|
||||
case BPF_TRACE_ITER:
|
||||
case BPF_TRACE_RAW_TP:
|
||||
case BPF_MODIFY_RETURN:
|
||||
return 0;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
break;
|
||||
case BPF_PROG_TYPE_EXT:
|
||||
/* freplace program can return anything as its return value
|
||||
* depends on the to-be-replaced kernel func or bpf program.
|
||||
*/
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user