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  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:	Tue, 18 Nov 2014 09:49:12 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jiri Kosina <jkosina@...e.cz>, Petr Mladek <pmladek@...e.cz>
Subject: Re: [RFC][PATCH 11/23 v4] tracing: Do not use return values of trace_seq_printf() in syscall tracing

On Thu, 13 Nov 2014 20:12:55 -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <rostedt@...dmis.org>
>
> The functions trace_seq_printf() and friends will not be returning values
> soon and will be void functions. To know if they succeeded or not, the
> functions trace_seq_has_overflowed() and trace_handle_return() should be
> used instead.
>
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
> ---
>  kernel/trace/trace_syscalls.c | 43 +++++++++++++++----------------------------
>  1 file changed, 15 insertions(+), 28 deletions(-)
>
> diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
> index 4dc8b79c5f75..2193e8038681 100644
> --- a/kernel/trace/trace_syscalls.c
> +++ b/kernel/trace/trace_syscalls.c
> @@ -114,7 +114,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags,
>  	struct trace_entry *ent = iter->ent;
>  	struct syscall_trace_enter *trace;
>  	struct syscall_metadata *entry;
> -	int i, ret, syscall;
> +	int i, syscall;
>  
>  	trace = (typeof(trace))ent;
>  	syscall = trace->nr;
> @@ -128,35 +128,24 @@ print_syscall_enter(struct trace_iterator *iter, int flags,
>  		goto end;
>  	}
>  
> -	ret = trace_seq_printf(s, "%s(", entry->name);
> -	if (!ret)
> -		return TRACE_TYPE_PARTIAL_LINE;
> +	trace_seq_printf(s, "%s(", entry->name);
>  
>  	for (i = 0; i < entry->nb_args; i++) {

		if (trace_seq_has_overflowed())
			goto end;
?

Thanks,
Namhyung


>  		/* parameter types */
> -		if (trace_flags & TRACE_ITER_VERBOSE) {
> -			ret = trace_seq_printf(s, "%s ", entry->types[i]);
> -			if (!ret)
> -				return TRACE_TYPE_PARTIAL_LINE;
> -		}
> +		if (trace_flags & TRACE_ITER_VERBOSE)
> +			trace_seq_printf(s, "%s ", entry->types[i]);
> +
>  		/* parameter values */
> -		ret = trace_seq_printf(s, "%s: %lx%s", entry->args[i],
> -				       trace->args[i],
> -				       i == entry->nb_args - 1 ? "" : ", ");
> -		if (!ret)
> -			return TRACE_TYPE_PARTIAL_LINE;
> +		trace_seq_printf(s, "%s: %lx%s", entry->args[i],
> +				 trace->args[i],
> +				 i == entry->nb_args - 1 ? "" : ", ");
>  	}
>  
> -	ret = trace_seq_putc(s, ')');
> -	if (!ret)
> -		return TRACE_TYPE_PARTIAL_LINE;
> -
> +	trace_seq_putc(s, ')');
>  end:
> -	ret =  trace_seq_putc(s, '\n');
> -	if (!ret)
> -		return TRACE_TYPE_PARTIAL_LINE;
> +	trace_seq_putc(s, '\n');
>  
> -	return TRACE_TYPE_HANDLED;
> +	return trace_handle_return(s);
>  }
--
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