Message ID | 20210218001647.71631-1-xiyou.wangcong@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 53f523f3052ac16bbc7718032aa6b848f971d28c |
Delegated to: | BPF |
Headers | show |
Series | [bpf-next,v2] bpf: clear percpu pointers in bpf_prog_clone_free() | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for bpf-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | fail | 1 blamed authors not CCed: andrii@kernel.org; 6 maintainers not CCed: andrii@kernel.org yhs@fb.com john.fastabend@gmail.com kpsingh@kernel.org songliubraving@fb.com kafai@fb.com |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 8 this patch: 8 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 8 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 8 this patch: 8 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
Hello: This patch was applied to bpf/bpf.git (refs/heads/master): On Wed, 17 Feb 2021 16:16:47 -0800 you wrote: > From: Cong Wang <cong.wang@bytedance.com> > > Similar to bpf_prog_realloc(), bpf_prog_clone_create() also copies > the percpu pointers, but the clone still shares them with the original > prog, so we have to clear these two percpu pointers in > bpf_prog_clone_free(). Otherwise we would get a double free: > > [...] Here is the summary with links: - [bpf-next,v2] bpf: clear percpu pointers in bpf_prog_clone_free() https://git.kernel.org/bpf/bpf/c/53f523f3052a You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 0ae015ad1e05..aa1e64196d8d 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -1118,6 +1118,8 @@ static void bpf_prog_clone_free(struct bpf_prog *fp) * clone is guaranteed to not be locked. */ fp->aux = NULL; + fp->stats = NULL; + fp->active = NULL; __bpf_prog_free(fp); }