Commit 1336c662 authored by Alexei Starovoitov's avatar Alexei Starovoitov

bpf: Clear per_cpu pointers during bpf_prog_realloc

bpf_prog_realloc copies contents of struct bpf_prog.
The pointers have to be cleared before freeing old struct.
Reported-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Fixes: 700d4796 ("bpf: Optimize program stats")
Fixes: ca06f55b ("bpf: Add per-program recursion prevention mechanism")
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 6fdd671b
......@@ -245,6 +245,8 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
* reallocated structure.
*/
fp_old->aux = NULL;
fp_old->stats = NULL;
fp_old->active = NULL;
__bpf_prog_free(fp_old);
}
......
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