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]
Date:	Thu, 28 May 2009 09:54:49 +0200
From:	Jiri Slaby <jirislaby@...il.com>
To:	mingo@...e.hu
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org,
	Jiri Slaby <jirislaby@...il.com>,
	Tom Zanussi <tzanussi@...il.com>
Subject: [PATCH 3/3] trace: events_filter, fix lock imbalances

apply_event_filter and apply_subsystem_event_filter omits an unlock
on one fail path each. Fix that.

Signed-off-by: Jiri Slaby <jirislaby@...il.com>
Cc: Tom Zanussi <tzanussi@...il.com>
---
 kernel/trace/trace_events_filter.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 85ad6a8..e35094a 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1080,8 +1080,10 @@ int apply_event_filter(struct ftrace_event_call *call, char *filter_string)
 	}
 
 	ps = kzalloc(sizeof(*ps), GFP_KERNEL);
-	if (!ps)
-		return -ENOMEM;
+	if (!ps) {
+		err = -ENOMEM;
+		goto unlock;
+	}
 
 	filter_disable_preds(call);
 	replace_filter_string(call->filter, filter_string);
@@ -1101,7 +1103,7 @@ out:
 	filter_opstack_clear(ps);
 	postfix_clear(ps);
 	kfree(ps);
-
+unlock:
 	mutex_unlock(&filter_mutex);
 
 	return err;
@@ -1124,8 +1126,10 @@ int apply_subsystem_event_filter(struct event_subsystem *system,
 	}
 
 	ps = kzalloc(sizeof(*ps), GFP_KERNEL);
-	if (!ps)
-		return -ENOMEM;
+	if (!ps) {
+		err = -ENOMEM;
+		goto unlock;
+	}
 
 	filter_free_subsystem_preds(system);
 	replace_filter_string(system->filter, filter_string);
@@ -1145,7 +1149,7 @@ out:
 	filter_opstack_clear(ps);
 	postfix_clear(ps);
 	kfree(ps);
-
+unlock:
 	mutex_unlock(&filter_mutex);
 
 	return err;
-- 
1.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ