From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388845; b=crw+0F7oWK981Xcl3pgHfu9XKSh9nMS55fSvlUe3kMxdksuaHPPb5wmLBUozZVVaaEDr Yjw0iWmlrtpLOQz1Lc6Nrrl9XH2gaAjR+P0Mk5F4APnVAVuo5QaY3LmX+cAd0oB4wk6qh WQaC7mUCXplzeDHkPrT69iqiMTdtgUWjZnjlce+T6qMRKiVvGHvXhvOmXfRAzjf0W6JVC NN+V+Y7pxzRW4Fh7rqfFwohu4x95oDiF5SLrJxUhCg+vqby93+xMzrOm72xYuD02QI5Uf 81s+uR/hZHqI3OhHLrcKEWKCi0uOOUDP1sFV7KMN9qfmDiccWI3SQcsu5ngcqGsxqrQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388845; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Scanned-By; bh=KOay+42NKfRacWuuS1mQFtz2U8S4Z8LQFmOKPW7QFMw=; b=3+wsH/N127sZa3XFYrA72s3plrvIKxeuWy0hDc+T1EJbck4RGkp8HdpBLSPf+CsJEb5B M05vURaiO9aSKpKtaQK9Lmi0wEChCTwDbHdkizVw7FUvcXUkgAdIhvIUwK7SIGLmfMyio yOeWQ+W1JX1kQYpNJjV2/Qe6H6P3B6AElyEgMYzaYppEX1HkBX74SOwWbjrzSWZ5dDzAf sbQwcMBA0s+rj9BQi5i/xpsdVawhBIBefJoo4P+58+r2R9dd1ODMdd158xxW3EYPBXROS WAy1ugGmkIgs+K+7HFKoYVJuCgu7zB5FpF4QL8CAEhFIAjHEEn5OSpVuFW2AZE7q1kQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ORX0siWR; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAF18606A32C for ; Fri, 4 Dec 2026 12:54:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DAF18606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ORX0siWR DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796388843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KOay+42NKfRacWuuS1mQFtz2U8S4Z8LQFmOKPW7QFMw=; b=ORX0siWRKtxWkmEg3uWe0I8VaNFeCyZdmZOufhA7G6tAUNJvFnDqQQTtExzGAFDDx6FmHm 5yuzTJwv+ChQ+WHB+O/s6gtYP8c+1MMQb2uri6KIn/Xt7kFgfbYVSNK8CvgFLjEmev3LZB TUvZZfTNrqpxdZ7AoZhkvjyKXzNZXQI= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-460-5vPyHXcHPriJuRpVytbh1w-1; Fri, 4 Dec 2026 12:54:00 +0000 X-MC-Unique: 5vPyHXcHPriJuRpVytbh1w-1 X-Mimecast-MFC-AGG-ID: 5vPyHXcHPriJuRpVytbh1w_1796388837 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F2E4F19146D5; Fri, 4 Dec 2026 12:53:56 +0000 (UTC) Received: from onestero-thinkpadp1gen7.tpbc.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 4DF353003E8D; Fri, 4 Dec 2026 12:53:51 +0000 (UTC) Received: by onestero-thinkpadp1gen7.tpbc.csb (nbSMTP-1.00) for uid 13628 oleg@redhat.com; Fri, 4 Dec 2026 13:53:56 +0100 (CET) Date: Fri, 4 Dec 2026 13:53:50 +0100 From: Oleg Nesterov To: Alexei Starovoitov Cc: Chris Mason , brauner@kernel.org, daniel@iogearbox.net, andrii@kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, peterz@infradead.org, mingo@redhat.com, kees@kernel.org, tj@kernel.org, eddyz87@gmail.com, memxor@gmail.com, yonghong.song@linux.dev, martin.lau@linux.dev, song@kernel.org, jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev, sched-ext@lists.linux.dev Subject: Re: [PATCH 0/3] fork, exit: fix BPF use-after-frees on task pointers Message-ID: References: <20261203200612.26376-1-mason@kernel.org> X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 On 12/04, Alexei Starovoitov wrote: > > BUT the title is misleading. > The kernel has the same bug without bpf. fill_stats_for_pid() holds > a reference on tsk and nothing else. Then bacct_add_tsk() reads > tsk->group_leader->start_time. Oh yes, and IIRC there are more buggy users of ->group_leader > > Patch 2 makes a released thread hold a reference on its group leader, > > which I don't love. If there are better ideas, I'm happy to get > > the bots cranking on them. I think we should move ->group_leader from task_struct to ->signal_struct. I was going to do this a long ago, but was distructed. See the preparations I sent https://lore.kernel.org/all/aXY_h8i78n6yD9JY@redhat.com/ I'll try to take a look this weekend, I need to recall the implications. But ->real_parent has to stay per task, and I don't really understand 1/3, even the changelog. Oleg.