Commit 0376d5dc authored by David S. Miller's avatar David S. Miller

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf

Daniel Borkmann says:

====================
pull-request: bpf 2018-09-16

The following pull-request contains BPF updates for your *net* tree.

The main changes are:

1) Fix end boundary calculation in BTF for the type section, from Martin.

2) Fix and revert subtraction of pointers that was accidentally allowed
   for unprivileged programs, from Alexei.

3) Fix bpf_msg_pull_data() helper by using __GFP_COMP in order to avoid
   a warning in linearizing sg pages into a single one for large allocs,
   from Tushar.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 4bf9ffa0 4c3d795c
...@@ -1844,7 +1844,7 @@ static int btf_check_all_metas(struct btf_verifier_env *env) ...@@ -1844,7 +1844,7 @@ static int btf_check_all_metas(struct btf_verifier_env *env)
hdr = &btf->hdr; hdr = &btf->hdr;
cur = btf->nohdr_data + hdr->type_off; cur = btf->nohdr_data + hdr->type_off;
end = btf->nohdr_data + hdr->type_len; end = cur + hdr->type_len;
env->log_type_id = 1; env->log_type_id = 1;
while (cur < end) { while (cur < end) {
......
...@@ -3163,7 +3163,7 @@ static int adjust_reg_min_max_vals(struct bpf_verifier_env *env, ...@@ -3163,7 +3163,7 @@ static int adjust_reg_min_max_vals(struct bpf_verifier_env *env,
* an arbitrary scalar. Disallow all math except * an arbitrary scalar. Disallow all math except
* pointer subtraction * pointer subtraction
*/ */
if (opcode == BPF_SUB){ if (opcode == BPF_SUB && env->allow_ptr_leaks) {
mark_reg_unknown(env, regs, insn->dst_reg); mark_reg_unknown(env, regs, insn->dst_reg);
return 0; return 0;
} }
......
...@@ -2344,7 +2344,8 @@ BPF_CALL_4(bpf_msg_pull_data, ...@@ -2344,7 +2344,8 @@ BPF_CALL_4(bpf_msg_pull_data,
if (unlikely(bytes_sg_total > copy)) if (unlikely(bytes_sg_total > copy))
return -EINVAL; return -EINVAL;
page = alloc_pages(__GFP_NOWARN | GFP_ATOMIC, get_order(copy)); page = alloc_pages(__GFP_NOWARN | GFP_ATOMIC | __GFP_COMP,
get_order(copy));
if (unlikely(!page)) if (unlikely(!page))
return -ENOMEM; return -ENOMEM;
p = page_address(page); p = page_address(page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment