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:   Fri, 10 Nov 2017 08:24:13 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Tom Zanussi <tom.zanussi@...ux.intel.com>, tglx@...utronix.de,
        mhiramat@...nel.org, vedang.patel@...el.com, bigeasy@...utronix.de,
        joel.opensrc@...il.com, joelaf@...gle.com,
        mathieu.desnoyers@...icios.com, baohong.liu@...el.com,
        rajvi.jingar@...el.com, julia@...com, linux-kernel@...r.kernel.org,
        linux-rt-users@...r.kernel.org, kernel-team@....com
Subject: Re: [PATCH v5 15/37] tracing: Add variable support to hist triggers

On Fri, 10 Nov 2017 16:28:41 +0900
Namhyung Kim <namhyung@...nel.org> wrote:

> > +			hist_data->attrs->var_defs.expr[n_vars++] = s;
> > +
> > +			hist_data->attrs->var_defs.n_vars = n_vars;
> > +
> > +			if (n_vars == TRACING_MAP_VARS_MAX)
> > +				goto free;  
> 
> This will silently discard all variables.  Why not returning an error?
> Also I think it should be moved to the beginning of this block..

Right, because the check here is already too late. Usually you check
the count before doing the assignment.


	if (n_vars == TRACING_MAP_VARS_MAX)
		goto free;

	hist_data->attrs->var_defs.expr[n_vars++] = s;

Because it is OK for n_vars to equal TRACING_MAP_VARS_MAX, but not OK
to be more.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ