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>] [day] [month] [year] [list]
Message-Id: <1630566543-598084-1-git-send-email-jiasheng@iscas.ac.cn>
Date:   Thu,  2 Sep 2021 07:09:03 +0000
From:   jiasheng <jiasheng@...as.ac.cn>
To:     linux-kernel@...r.kernel.org
Cc:     jiasheng <jiasheng@...as.ac.cn>
Subject: [PATCH 2/2] tracing: Add trace_trigger_soft_disabled() in front of trace_event_buffer_commit() in trace_inject_entry()

We have found that in the complied files trace_event_buffer_commit()
appear more than 200 times, and under at least 90% circumstances
that trace_trigger_soft_disabled() and trace_event_buffer_commit()
appear in pairs.
For example, they appear together in the trace_event_raw_event_##call()
of the file complie from 'include/trace/trace_events.h'.
But we have found that in the trace_inject_entry(), there is only
trace_event_buffer_commit() instead of the pair.
Therefore, we consider that the trace_trigger_soft_disabled()
might be forgotten.

Signed-off-by: jiasheng <jiasheng@...as.ac.cn>
---
 kernel/trace/trace_events_inject.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/trace_events_inject.c b/kernel/trace/trace_events_inject.c
index c188045..6dfd3cd 100644
--- a/kernel/trace/trace_events_inject.c
+++ b/kernel/trace/trace_events_inject.c
@@ -21,6 +21,8 @@ trace_inject_entry(struct trace_event_file *file, void *rec, int len)
 	void *entry;
 
 	rcu_read_lock_sched();
+	if (trace_trigger_soft_disabled(file))
+		return written;
 	entry = trace_event_buffer_reserve(&fbuffer, file, len);
 	if (entry) {
 		memcpy(entry, rec, len);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ