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, 27 Aug 2009 11:07:49 -0400
From:	Masami Hiramatsu <mhiramat@...hat.com>
To:	Frederic Weisbecker <fweisbec@...il.com>
CC:	Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>,
	Li Zefan <lizf@...fujitsu.com>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH 19/18] tracing: Restore the const qualifier for field
 names and types definition

Frederic Weisbecker wrote:
> Restore the const qualifier in field's name and type parameters of
> trace_define_field that was lost while solving a conflict.
> 
> Fields names and types are defined as builtin constant strings in
> static TRACE_EVENTs. But kprobes allocates these dynamically.
> 
> That said, we still want to always pass these strings as const char *
> in trace_define_fields() to avoid any further accidental writes on
> the pointed strings.
> 
> Reported-by: Li Zefan<lizf@...fujitsu.com>
> Signed-off-by: Frederic Weisbecker<fweisbec@...il.com>
> Cc: Steven Rostedt<rostedt@...dmis.org>

Acked-by: Masami Hiramatsu <mhiramat@...hat.com>

> ---
>   include/linux/ftrace_event.h  |    6 +++---
>   kernel/trace/trace_events.c   |    4 ++--
>   kernel/trace/trace_syscalls.c |    4 ++--
>   3 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
> index 1ab3089..73edf5a 100644
> --- a/include/linux/ftrace_event.h
> +++ b/include/linux/ftrace_event.h
> @@ -148,9 +148,9 @@ enum {
>   };
> 
>   extern int trace_define_common_fields(struct ftrace_event_call *call);
> -extern int trace_define_field(struct ftrace_event_call *call, char *type,
> -			      char *name, int offset, int size, int is_signed,
> -			      int filter_type);
> +extern int trace_define_field(struct ftrace_event_call *call, const char *type,
> +			      const char *name, int offset, int size,
> +			      int is_signed, int filter_type);
>   extern int trace_add_event_call(struct ftrace_event_call *call);
>   extern void trace_remove_event_call(struct ftrace_event_call *call);
> 
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index 8079bb5..197cdaa 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -27,8 +27,8 @@ DEFINE_MUTEX(event_mutex);
> 
>   LIST_HEAD(ftrace_events);
> 
> -int trace_define_field(struct ftrace_event_call *call, char *type,
> -		       char *name, int offset, int size, int is_signed,
> +int trace_define_field(struct ftrace_event_call *call, const char *type,
> +		       const char *name, int offset, int size, int is_signed,
>   		       int filter_type)
>   {
>   	struct ftrace_event_field *field;
> diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
> index 5931933..a928dd0 100644
> --- a/kernel/trace/trace_syscalls.c
> +++ b/kernel/trace/trace_syscalls.c
> @@ -193,8 +193,8 @@ int syscall_enter_define_fields(struct ftrace_event_call *call)
>   		return ret;
> 
>   	for (i = 0; i<  meta->nb_args; i++) {
> -		ret = trace_define_field(call, (char *)meta->types[i],
> -					 (char *)meta->args[i], offset,
> +		ret = trace_define_field(call, meta->types[i],
> +					 meta->args[i], offset,
>   					 sizeof(unsigned long), 0,
>   					 FILTER_OTHER);
>   		offset += sizeof(unsigned long);

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@...hat.com

--
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