From nobody Fri Apr 17 10:34:47 2026 Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8858C13959D for ; Sat, 21 Feb 2026 12:07:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.70 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771675630; cv=none; b=dPsPxBIRTu3wmcK3lt1tKEw5y/v9W63/HYm6TQPaIf/INLDUHajWgl3KcWOgWPBmbM3jBWivBTs2QTM+UEq1YSRafMPYB0WZw4yXmzIMB+sl21SldsCjH6r07qdVMd5zoWylOxLVFepNHRG2rbhTuLrQdBInxHQ1fdbHO6NhY68= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771675630; c=relaxed/simple; bh=mJ22RWio6pv+kScuMEt5zNKjb2AVEiNKg8IzVt5Ec7A=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=UX0aKFbyo2hPwLhLvM0WmupcDp62+11rHCveOO1+XlP+RO6xUMrFEkn1Vy43S6kLUB6OxBHoE6JOqoCtrevvcGpEzzyFSyNXAWce5HJ45rl+/qN+kiv5WA4dw3rdPIz6qNRoRYpWO2OrhIZb0XiRKSYh5whBJwAZAA/qDhanx9c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.210.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-ot1-f70.google.com with SMTP id 46e09a7af769-7d498212845so13919158a34.3 for ; Sat, 21 Feb 2026 04:07:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771675628; x=1772280428; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NjQusDyl+tNnjAR8Drg1v8DGJtlPtfsdEiVwK6Lq/lU=; b=WmXPZKRupA5Nrn8AFa9J+htQg6kDiMtAxaECprEjI5teM8OnXukOiJxtkA7pNFx57o HhmB/iaZzerYqax7KGK0nIS4I9p/ULDF6wlhoqMMoalXRLFQM3cR/hauH4Ziox30pdeL fGI/yJ6O+vMWm8aIFX7SycQo4y2qEtcdvmAmzymBcfXs0WNUGAmR/RKqGkufxoGoqPoy 83vReP3cl0ryVQ2aJr/ZeyAMIFHhS7Plo1ZNkgpwk9RcZJl5YO3URLlUhe7MRSMdS2Eq y8/Jj4iO9cqwIMrnWwVAg2hY+urA8YErUWGPsJ2juYnqBySjuUWSCW0YiDl699UN6I4S ecNg== X-Gm-Message-State: AOJu0YwBT4gKXwd2J/XqE0tUb8S7X7muw1/ascSWW+vVqK9vrEhW0WVj ZomdIkbbUq3ZsalPRQNeQLJ5BKgnMSBhpsITqfsInVi5wOP84ye5BkRgzor6jvwE04hzyHnABOI P/17nOWXNulxaQDDBbGFjL/6T557KD1SFHJnUXaqYWXqJC5pzwVo3Ofho64U= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a4a:e911:0:b0:679:a4fe:f025 with SMTP id 006d021491bc7-679c44f4d0emr1693301eaf.59.1771675628500; Sat, 21 Feb 2026 04:07:08 -0800 (PST) Date: Sat, 21 Feb 2026 04:07:08 -0800 In-Reply-To: <699938a6.a70a0220.2c38d7.0150.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69999fec.050a0220.340abe.0d26.GAE@google.com> Subject: Forwarded: [PATCH] bpf: Fix use-after-free in bpf_raw_tp_link on tracepoint unregistration From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] bpf: Fix use-after-free in bpf_raw_tp_link on tracepoint u= nregistration Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master A slab-use-after-free is reported by KASAN in __bpf_trace_run / bpf_trace_run2 when a BPF raw tracepoint link is being torn down while the tracepoint is concurrently firing on another CPU. The tracepoint invocation path protects its read side with SRCU (srcu_read_lock_fast_notrace(&tracepoint_srcu)), but when a BPF raw tracepoint link is released, bpf_link_free() defers the kfree of the bpf_raw_tp_link via call_rcu(), which only waits for a regular RCU grace period. Since regular RCU and SRCU are independent synchronization domains, call_rcu() does not wait for in-flight SRCU readers. This means the bpf_raw_tp_link can be freed while a tracepoint callback is still accessing it, leading to a use-after-free. Fix this by calling tracepoint_synchronize_unregister() after bpf_probe_unregister() in bpf_raw_tp_link_release(). This function calls synchronize_srcu(&tracepoint_srcu), ensuring all in-flight tracepoint callbacks have completed before the link enters the RCU-deferred free path in bpf_link_free(). Reported-by: syzbot+59701a78e84b0bccfe1b@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D59701a78e84b0bccfe1b Signed-off-by: Deepanshu Kartikey --- kernel/bpf/syscall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index dd89bf809772..af6d435dd500 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -3782,6 +3782,7 @@ static void bpf_raw_tp_link_release(struct bpf_link *= link) container_of(link, struct bpf_raw_tp_link, link); =20 bpf_probe_unregister(raw_tp->btp, raw_tp); + tracepoint_synchronize_unregister(); bpf_put_raw_tracepoint(raw_tp->btp); } =20 --=20 2.43.0