[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240811125816.GC30068@redhat.com>
Date: Sun, 11 Aug 2024 14:58:17 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: syzbot <syzbot+f7a1c2c2711e4a780f19@...kaller.appspotmail.com>
Cc: acme@...nel.org, adrian.hunter@...el.com,
alexander.shishkin@...ux.intel.com, irogers@...gle.com,
jolsa@...nel.org, kan.liang@...ux.intel.com,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, mark.rutland@....com,
mhiramat@...nel.org, mingo@...hat.com, namhyung@...nel.org,
peterz@...radead.org, syzkaller-bugs@...glegroups.com,
andrii@...nel.org
Subject: Re: [syzbot] [perf?] KASAN: slab-use-after-free Read in
__uprobe_unregister
On 08/10, syzbot wrote:
>
> syzbot found the following issue on:
>
> HEAD commit: 6a0e38264012 Merge tag 'for-6.11-rc2-tag' of git://git.ker..
> git tree: upstream
#syz test: upstream 6a0e38264012
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index cd098846e251..5d9c96c69733 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -3485,17 +3485,19 @@ int bpf_uprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr
uprobes[i].ref_ctr_offset,
&uprobes[i].consumer);
if (err) {
- bpf_uprobe_unregister(&path, uprobes, i);
- goto error_free;
+ goto error_unregister;
}
}
err = bpf_link_prime(&link->link, &link_primer);
if (err)
- goto error_free;
+ goto error_unregister;
return bpf_link_settle(&link_primer);
+error_unregister:
+ bpf_uprobe_unregister(&path, uprobes, i);
+
error_free:
kvfree(uprobes);
kfree(link);
Powered by blists - more mailing lists