perf: Fix use-after-free in error path
The syscall error path has a use-after-free; put_pmu_ctx() will reference ctx, therefore we must ensure ctx is destroyed after pmu_ctx is. Fixes: bd275681 ("perf: Rewrite core context handling") Reported-by: <syzbot+b8e8c01c8ade4fe6e48f@syzkaller.appspotmail.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Chengming Zhou <zhouchengming@bytedance.com> Link: https://lkml.kernel.org/r/Y6B3xEgkbmFUCeni@hirez.programming.kicks-ass.net
Please register or sign in to comment