mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-30 07:34:12 +08:00
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: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
0376d5dce0
@ -1844,7 +1844,7 @@ static int btf_check_all_metas(struct btf_verifier_env *env)
|
||||
|
||||
hdr = &btf->hdr;
|
||||
cur = btf->nohdr_data + hdr->type_off;
|
||||
end = btf->nohdr_data + hdr->type_len;
|
||||
end = cur + hdr->type_len;
|
||||
|
||||
env->log_type_id = 1;
|
||||
while (cur < end) {
|
||||
|
@ -3163,7 +3163,7 @@ static int adjust_reg_min_max_vals(struct bpf_verifier_env *env,
|
||||
* an arbitrary scalar. Disallow all math except
|
||||
* pointer subtraction
|
||||
*/
|
||||
if (opcode == BPF_SUB){
|
||||
if (opcode == BPF_SUB && env->allow_ptr_leaks) {
|
||||
mark_reg_unknown(env, regs, insn->dst_reg);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2344,7 +2344,8 @@ BPF_CALL_4(bpf_msg_pull_data,
|
||||
if (unlikely(bytes_sg_total > copy))
|
||||
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))
|
||||
return -ENOMEM;
|
||||
p = page_address(page);
|
||||
|
Loading…
Reference in New Issue
Block a user