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: <a9030af05886f375beed5f4d75074004fffd896f.1701993656.git.jim.cromie@gmail.com>
Date:   Thu,  7 Dec 2023 17:15:13 -0700
From:   Jim Cromie <jim.cromie@...il.com>
To:     lb@...ihalf.com, linux-kernel@...r.kernel.org
Cc:     akpm@...ux-foundation.org, bleung@...gle.com, contact@...rsion.fr,
        daniel@...ll.ch, dianders@...omium.org, groeck@...gle.com,
        jbaron@...mai.com, jim.cromie@...il.com, john.ogness@...utronix.de,
        keescook@...omium.org, pmladek@...e.com, ppaalanen@...il.com,
        rostedt@...dmis.org, seanpaul@...omium.org,
        sergey.senozhatsky@...il.com, upstream@...ihalf.com,
        vincent.whitchurch@...s.com, yanivt@...gle.com,
        gregkh@...uxfoundation.org
Subject: [re: PATCH v2 00/15 -  10/11] dyndbg: move lock,unlock into ddebug_change, drop goto

Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
 lib/dynamic_debug.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index fc903e90ea0d..b63429462d69 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -537,6 +537,8 @@ static int ddebug_change(const struct ddebug_query *query,
 	struct ddebug_class_map *map = NULL;
 	int __outvar valid_class;
 
+	mutex_lock(&ddebug_lock);
+
 	/* search for matching ddebugs */
 	list_for_each_entry(dt, &ddebug_tables, link) {
 
@@ -625,6 +627,7 @@ static int ddebug_change(const struct ddebug_query *query,
 	if (nfound)
 		update_tr_default_dst(modifiers);
 
+	mutex_unlock(&ddebug_lock);
 	return nfound;
 }
 
@@ -932,23 +935,17 @@ static int ddebug_exec_query(char *query_string, const char *modname)
 		return -EINVAL;
 	}
 
-	mutex_lock(&ddebug_lock);
-
 	/* check flags 1st (last arg) so query is pairs of spec,val */
 	if (ddebug_parse_flags(words[nwords-1], &modifiers)) {
 		pr_err("flags parse failed\n");
-		goto err;
+		return -EINVAL;
 	}
 
 	/* actually go and implement the change */
 	nfound = ddebug_change(&query, &modifiers);
 
-	mutex_unlock(&ddebug_lock);
 	vpr_info_dq(&query, nfound ? "applied" : "no-match");
 	return nfound;
-err:
-	mutex_unlock(&ddebug_lock);
-	return -EINVAL;
 }
 
 /* handle multiple queries in query string, continue on error, return
-- 
2.43.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ