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=1796388847; b=1Tkq4LvAIFjhQAdxkZIY8OkPL/jPNDp9Rum0E6hOM3qP88Xy4N/CcG9WXh3khAJteMlR 2oNEttrikh9Rk2IcgC9iOksc7gDN3FUzpClPuYBRFcyWBjCJzPftqZgc4VegEBbkyTLdy Ci5CBu8qe5A9W/j2kz1Es0ecgjp0cT92isvSO6CvDI6iElqC4rKp6jCmgJm78mc4eofRW YYKWPZ02mzNBnLpjZbaDXrx6m8aM2ePlL4YiTK5TqiS7LY/+EvPDAr+JfLGsiCzDOBC3P kiHe0S4XBP5ZAmuJftcdqxMjgxUcr3GhnwpefPagRFXe4DC1UnM6wxUNJejzaP0MZRA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388847; 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=MxN6jzoLwLCYN+MvM/TLREBvZ9z0qvFgl7rxSt5y/Gtbs3Ez1AonGPEA929GjZIk2NCL nW389A4S7k07W611bP9QxguGYGiGNPWVzIxQYUYw3/Ue79KwcvytyqO1MrwgZLG3nDh7I N1+Y5KVNw7pCXyR8QEvMj6JqI/P04HfBZUQW5qjLYXAqwak5matSHzT99I30wydRFsOAg UXHdE+OX0WvuMzECP2V7VJYXBCEF/I9xBEP73xNnYdty1adI9kVBq34a1xwXE8tit4wSU 3Vm6IFCq1y/q2mx5GDf2kTQJazyHUfyAuUpXyzo9dzYCSA2BbQDVrWkSUQGkUZ4Ynlw== 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=WLC0aXKR; 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 CD527606A32F for ; Fri, 4 Dec 2026 12:54:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CD527606A32F 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=WLC0aXKR DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796388845; 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=WLC0aXKRiBGL1x3SBMU3428JNSs5plnU7ZaM+6/NUMIG4IWlRn73/v5crlCmkdg3oBD7OV xad6W/BMmZPZkPdfK/2BVjyq8gn+ZKB79Tsilf7HXlwe/HtxhE58cBYNHOH3OapFrjdpgV 7QT/0bCMMyIBjK64Ye2PTHQsSdqK4aM= 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: linux-kernel@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.