From nobody Fri Apr 17 07:44:02 2026 Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) (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 B315030AAD0 for ; Sat, 21 Feb 2026 23:34:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771716887; cv=none; b=JiM9z0b02rmHyYIE3wNjDBNf8+uA1Vojk2/YZ8eRvDhtlycoGmNdvL8ohyYhGD/CkjuoaM36Ja0MlsoqlNCjlnr00lE/4sWIvqQA1x5n//Ck7nRre4QgJPBBto5MQQ9GfKNo/ybvd7CgYhHyDpKknn5pL9/AyHkY9ifNWQUZMjI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771716887; c=relaxed/simple; bh=mJ22RWio6pv+kScuMEt5zNKjb2AVEiNKg8IzVt5Ec7A=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=NoJ3Chg2NvsLRKsRwSHy+dBaep5I7ny2v07eKE9JuxDY/F6LXFRrUvAK3Im7eDHx+W9+ppXmqqK31cLT2DsIn1Bo8LnXC4mn534eJohepnbZQxSKlNqrTjpNlLimQzyvLyxyQW9fUZcoNw57kPTxO65IQPCCs6v7Nm0DI5+r988= 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.160.72 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-oa1-f72.google.com with SMTP id 586e51a60fabf-40996e43ddaso15310583fac.3 for ; Sat, 21 Feb 2026 15:34:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771716884; x=1772321684; 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=RoThXeZPPIsa8j2gooArR+izPbAslhsop4GBjF+L+hmB9ycXCfky4K8yhv+WVQ2Qv0 tUsSQgvmadkBz9ZR/JkWzCjYJrOPvBGAUnHhn4TCTI2cr9RcV4BBKzGXlg9fNrRsE7DW OS6URVEAHKTMThkx06PBwUn96yLKTmTX2gDnRkEmjF5Aq4KamN1DCEu14YQQoMU4k7Yb qRNDifkmpmcfP5tSvT9sjsVnPFvjBN0FYDNcPIGEMVj8GjllqDZHJmBbiGUG2zjFZJxe SeC/B+tHhE0jTGEbQiq9Cc/hTPS/TvljgLiF+BGmCK3G5fjchd0JlQ0Y8jKsTUGm/ROv 5Kag== X-Gm-Message-State: AOJu0Yy8vdOdA4UjtYVZJaqqyP2BRIsQh/aLqUf3E6047lrK9NejZEsz 2klhg48eG0fsf8fVIBtHPS18wR8QS59mP4mfBKrKgmDHQdJrJ4gjPbqII4eMQbjlFrZ8//yB4Z+ vQt+jX2/DclKAaqLSf4dEkIvRNH0x+hTdv36Z55NlG1VOQ0h4379uj4SVePM= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:160a:b0:679:97ac:2cc3 with SMTP id 006d021491bc7-679c4278695mr2699304eaf.22.1771716884653; Sat, 21 Feb 2026 15:34:44 -0800 (PST) Date: Sat, 21 Feb 2026 15:34:44 -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: <699a4114.050a0220.b01bb.0047.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