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: <158091750477.411.16676804316136284961.tip-bot2@tip-bot2>
Date:   Wed, 05 Feb 2020 15:45:04 -0000
From:   "tip-bot2 for Cengiz Can" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Cengiz Can <cengiz@...nel.wtf>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        x86 <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [tip: perf/urgent] perf maps: Add missing unlock to maps__insert() error case

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     85fc95d75970ee7dd8e01904e7fb1197c275ba6b
Gitweb:        https://git.kernel.org/tip/85fc95d75970ee7dd8e01904e7fb1197c275ba6b
Author:        Cengiz Can <cengiz@...nel.wtf>
AuthorDate:    Mon, 20 Jan 2020 17:15:54 +03:00
Committer:     Arnaldo Carvalho de Melo <acme@...hat.com>
CommitterDate: Fri, 31 Jan 2020 09:40:50 +01:00

perf maps: Add missing unlock to maps__insert() error case

`tools/perf/util/map.c` has a function named `maps__insert` that
acquires a write lock if its in multithread context.

Even though this lock is released when function successfully completes,
there's a branch that is executed when `maps_by_name == NULL` that
returns from this function without releasing the write lock.

Added an `up_write` to release the lock when this happens.

Fixes: a7c2b572e217 ("perf map_groups: Auto sort maps by name, if needed")
Signed-off-by: Cengiz Can <cengiz@...nel.wtf>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Link: http://lore.kernel.org/lkml/20200120141553.23934-1-cengiz@kernel.wtf
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/map.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index fdd5bdd..f67960b 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -549,6 +549,7 @@ void maps__insert(struct maps *maps, struct map *map)
 
 			if (maps_by_name == NULL) {
 				__maps__free_maps_by_name(maps);
+				up_write(&maps->lock);
 				return;
 			}
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ