lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <000000000000e3f688061a392771@google.com>
Date: Thu, 06 Jun 2024 07:04:04 -0700
From: syzbot <syzbot+9d95beb2a3c260622518@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] possible deadlock in trie_delete_elem

For archival purposes, forwarding an incoming command email to
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com.

***

Subject: possible deadlock in trie_delete_elem
Author: norkam41@...il.com

#syz test: https://linux.googlesource.com/linux/kernel/git/torvalds/linux e377d803b65ee4130213b3c041fc25fdfec1bd90

---
 kernel/trace/bpf_trace.c | 13 +++++++++++--
 kernel/tracepoint.c      | 15 +++++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 2d29bc0f21cc..75fdb8e3abaa 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -2393,12 +2393,21 @@ void __bpf_trace_run(struct bpf_raw_tp_link *link, u64 *args)
 	cant_sleep();

 	// return if instrumentation disabled, see: bpf_disable_instrumentation
-	if (unlikely(__this_cpu_read(bpf_prog_active))) {
+	int instrumentation = unlikely(__this_cpu_read(bpf_prog_active));
+	if (instrumentation) {
+		printk("SKIP FOR INSTRUMENTATION: %s > %s > %p /%i ==============\n",
+				prog->aux->name,
+				link->btp->tp->name, prog, instrumentation);
 		bpf_prog_inc_misses_counter(prog);
 		return;
 	}

-	if (unlikely(this_cpu_inc_return(*(prog->active)) != 1)) {
+	int active = this_cpu_inc_return(*(prog->active));
+	// printk("%s > %s > %p /%i\n", prog->aux->name, link->btp->tp->name, prog, active);
+	if (active != 1) {
+		printk("SKIP FOR ACTIVE: %s > %s > %p /%i =======================\n",
+				prog->aux->name,
+				link->btp->tp->name, prog, active);
 		bpf_prog_inc_misses_counter(prog);
 		goto out;
 	}
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index 8d1507dd0724..a0a0d8b16b41 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -168,12 +168,21 @@ static inline void release_probes(struct tracepoint_func *old)
 static void debug_print_probes(struct tracepoint_func *funcs)
 {
 	int i;
+	struct bpf_raw_tp_link *link;

 	if (!tracepoint_debug || !funcs)
 		return;

-	for (i = 0; funcs[i].func; i++)
-		printk(KERN_DEBUG "Probe %d : %p\n", i, funcs[i].func);
+	for (i = 0; funcs[i].func; i++) {
+		link = funcs[i].data;
+		int active = this_cpu_read(*(link->link.prog->active));
+		printk("Probe %d : %p / %p: %s/%d / %i\n", i,
+				funcs[i].func,
+				link,
+				link->link.prog->aux->name,
+				active,
+				funcs[i].prio);
+	}
 }

 static struct tracepoint_func *
@@ -298,6 +307,8 @@ static enum tp_func_state nr_func_state(const struct tracepoint_func *tp_funcs)
 {
 	if (!tp_funcs)
 		return TP_FUNC_0;
+	if (!tp_funcs[0].func)
+		return TP_FUNC_0;
 	if (!tp_funcs[1].func)
 		return TP_FUNC_1;
 	if (!tp_funcs[2].func)
--
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ