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]
Message-ID: <8828005.nfsgNN4c79@sven-l14>
Date:   Sun, 24 Jul 2022 23:31:01 +0200
From:   Sven Eckelmann <sven@...fation.org>
To:     linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Marek Lindner <mareklindner@...mailbox.ch>,
        Simon Wunderlich <sw@...onwunderlich.de>,
        Antonio Quartulli <a@...table.cc>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        b.a.t.m.a.n@...ts.open-mesh.org, netdev@...r.kernel.org
Subject: Re: [for-next][PATCH 17/23] batman-adv: tracing: Use the new __vstring() helper

On Thursday, 14 July 2022 18:43:13 CEST Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@...dmis.org>
> 
> Instead of open coding a __dynamic_array() with a fixed length (which
> defeats the purpose of the dynamic array in the first place).

Please also make sure to remove the define of BATADV_MAX_MSG_LEN

Kind regards,
	Sven

[...]
> --- a/net/batman-adv/trace.h
> +++ b/net/batman-adv/trace.h
> @@ -40,16 +40,13 @@ TRACE_EVENT(batadv_dbg,
>  	    TP_STRUCT__entry(
>  		    __string(device, bat_priv->soft_iface->name)
>  		    __string(driver, KBUILD_MODNAME)
> -		    __dynamic_array(char, msg, BATADV_MAX_MSG_LEN)
> +		    __vstring(msg, vaf->fmt, vaf->va)
>  	    ),
>  
>  	    TP_fast_assign(
>  		    __assign_str(device, bat_priv->soft_iface->name);
>  		    __assign_str(driver, KBUILD_MODNAME);
> -		    WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
> -					   BATADV_MAX_MSG_LEN,
> -					   vaf->fmt,
> -					   *vaf->va) >= BATADV_MAX_MSG_LEN);
> +		    __assign_vstr(msg, vaf->fmt, vaf->va);
>  	    ),
>  
>  	    TP_printk(
> 


Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ