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] [day] [month] [year] [list]
Message-ID: <tip-2e712675ffd1331bb527dfc851b0e98cd684c2f1@git.kernel.org>
Date:   Thu, 2 May 2019 22:52:11 -0700
From:   tip-bot for Bo YU <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     kafai@...com, tglx@...utronix.de, acme@...hat.com,
        tsu.yubo@...il.com, daniel@...earbox.net, yhs@...com,
        peterz@...radead.org, linux-kernel@...r.kernel.org,
        songliubraving@...com, adrian.hunter@...el.com,
        namhyung@...nel.org, jolsa@...nel.org, mingo@...nel.org,
        ast@...nel.org, hpa@...or.com, alexander.shishkin@...ux.intel.com
Subject: [tip:perf/urgent] perf bpf: Return value with unlocking in
 perf_env__find_btf()

Commit-ID:  2e712675ffd1331bb527dfc851b0e98cd684c2f1
Gitweb:     https://git.kernel.org/tip/2e712675ffd1331bb527dfc851b0e98cd684c2f1
Author:     Bo YU <tsu.yubo@...il.com>
AuthorDate: Mon, 22 Apr 2019 04:01:38 -0400
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 2 May 2019 16:00:19 -0400

perf bpf: Return value with unlocking in perf_env__find_btf()

In perf_env__find_btf(), we're returning without unlocking
"env->bpf_progs.lock". There may be cause lockdep issue.

Detected by CoversityScan, CID# 1444762:(program hangs(LOCK))

Signed-off-by: Bo YU <tsu.yubo@...il.com>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: Daniel Borkmann <daniel@...earbox.net>
Cc: Martin KaFai Lau <kafai@...com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Song Liu <songliubraving@...com>
Cc: Yonghong Song <yhs@...com>
Cc: bpf@...r.kernel.org
Cc: netdev@...r.kernel.org
Fixes: 2db7b1e0bd49d: (perf bpf: Return NULL when RB tree lookup fails in perf_env__find_btf())
Link: http://lkml.kernel.org/r/20190422080138.10088-1-tsu.yubo@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 9494f9dc61ec..6a3eaf7d9353 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -115,8 +115,8 @@ struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id)
 	}
 	node = NULL;
 
-	up_read(&env->bpf_progs.lock);
 out:
+	up_read(&env->bpf_progs.lock);
 	return node;
 }
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ