From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755506AbdCGO13 (ORCPT ); Tue, 7 Mar 2017 09:27:29 -0500 Received: from mail-ua0-f181.google.com ([209.85.217.181]:36623 "EHLO mail-ua0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755381AbdCGO1I (ORCPT ); Tue, 7 Mar 2017 09:27:08 -0500 MIME-Version: 1.0 In-Reply-To: <20170307140414.GA31678@redhat.com> References: <20170306131459.GC6515@twins.programming.kicks-ass.net> <20170307140414.GA31678@redhat.com> From: Dmitry Vyukov Date: Tue, 7 Mar 2017 15:17:34 +0100 Message-ID: Subject: Re: perf: use-after-free in perf_release To: Oleg Nesterov Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , LKML , Mathieu Desnoyers , syzkaller Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 7, 2017 at 3:04 PM, Oleg Nesterov wrote: > On 03/06, Peter Zijlstra wrote: >> >> and this is a failed fork(). >> >> >> However, inherited events don't have a filedesc to fput(), and >> similarly, a task that fails for has never been visible to attach a perf >> event to because it never hits the pid-hash. > > Yes, it is not visible to find_task_by_vpid() until copy_process() does > attach_pid(PIDTYPE_PID), and copy_process() can't fail after that. I would what is that that is failed in copy_process. Could it be perf_event_init_task itself? Maybe it leaves a pointer to p in some shared state on some error conditions?