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-53da59aa6dd881fd0bbdd058a8a299d90ce9dd1d@git.kernel.org>
Date:	Fri, 21 May 2010 17:09:55 GMT
From:	tip-bot for Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	acme@...hat.com, linux-kernel@...r.kernel.org, hpa@...or.com,
	mingo@...hat.com, mathieu.desnoyers@...icios.com,
	lizf@...fujitsu.com, peterz@...radead.org, fweisbec@...il.com,
	rostedt@...dmis.org, hch@....de, akpm@...ux-foundation.org,
	tglx@...utronix.de, laijs@...fujitsu.com, mhiramat@...hat.com,
	mingo@...e.hu
Subject: [tip:perf/core] tracepoints: Add check trace callback type

Commit-ID:  53da59aa6dd881fd0bbdd058a8a299d90ce9dd1d
Gitweb:     http://git.kernel.org/tip/53da59aa6dd881fd0bbdd058a8a299d90ce9dd1d
Author:     Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
AuthorDate: Fri, 30 Apr 2010 12:59:59 -0400
Committer:  Steven Rostedt <rostedt@...dmis.org>
CommitDate: Fri, 14 May 2010 09:34:26 -0400

tracepoints: Add check trace callback type

This check is meant to be used by tracepoint users which do a direct cast of
callbacks to (void *) for direct registration, thus bypassing the
register_trace_##name and unregister_trace_##name checks.

This permits to ensure that the callback type matches the function type at the
call site, but without generating any code.

Acked-by: Masami Hiramatsu <mhiramat@...hat.com>
Acked-by: Frederic Weisbecker <fweisbec@...il.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
LKML-Reference: <20100430165959.GA25605@...stal>
CC: Ingo Molnar <mingo@...e.hu>
CC: Andrew Morton <akpm@...ux-foundation.org>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: Peter Zijlstra <peterz@...radead.org>
CC: Arnaldo Carvalho de Melo <acme@...hat.com>
CC: Lai Jiangshan <laijs@...fujitsu.com>
CC: Li Zefan <lizf@...fujitsu.com>
CC: Christoph Hellwig <hch@....de>
Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
---
 include/linux/tracepoint.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 1d85f9a..8d5e4f6 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -137,9 +137,11 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin,
 	static inline int unregister_trace_##name(void (*probe)(proto))	\
 	{								\
 		return tracepoint_probe_unregister(#name, (void *)probe);\
+	}								\
+	static inline void check_trace_callback_type_##name(void (*cb)(proto)) \
+	{								\
 	}
 
-
 #define DEFINE_TRACE_FN(name, reg, unreg)				\
 	static const char __tpstrtab_##name[]				\
 	__attribute__((section("__tracepoints_strings"))) = #name;	\
@@ -168,6 +170,9 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin,
 	static inline int unregister_trace_##name(void (*probe)(proto))	\
 	{								\
 		return -ENOSYS;						\
+	}								\
+	static inline void check_trace_callback_type_##name(void (*cb)(proto)) \
+	{								\
 	}
 
 #define DEFINE_TRACE_FN(name, reg, unreg)
--
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