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:   Wed, 29 Jun 2022 11:07:43 +0300
From:   Nikolay Aleksandrov <razor@...ckwall.org>
To:     Vladimir Oltean <vladimir.oltean@....com>, netdev@...r.kernel.org
Cc:     "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Jiri Pirko <jiri@...nulli.us>,
        Ivan Vecera <ivecera@...hat.com>,
        Roopa Prabhu <roopa@...dia.com>,
        Ido Schimmel <idosch@...dia.com>
Subject: Re: [PATCH net-next] net: switchdev: add reminder near struct
 switchdev_notifier_fdb_info

On 28/06/2022 13:08, Vladimir Oltean wrote:
> br_switchdev_fdb_notify() creates an on-stack FDB info variable, and
> initializes it member by member. As such, newly added fields which are
> not initialized by br_switchdev_fdb_notify() will contain junk bytes
> from the stack.
> 
> Other uses of struct switchdev_notifier_fdb_info have a struct
> initializer which should put zeroes in the uninitialized fields.
> 
> Add a reminder above the structure for future developers. Recently
> discussed during review.
> 
> Link: https://patchwork.kernel.org/project/netdevbpf/patch/20220524152144.40527-2-schultz.hans+netdev@gmail.com/#24877698
> Link: https://patchwork.kernel.org/project/netdevbpf/patch/20220524152144.40527-3-schultz.hans+netdev@gmail.com/#24912269
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> ---
>  include/net/switchdev.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
> index aa0171d5786d..7dcdc97c0bc3 100644
> --- a/include/net/switchdev.h
> +++ b/include/net/switchdev.h
> @@ -239,6 +239,9 @@ struct switchdev_notifier_info {
>  	const void *ctx;
>  };
>  
> +/* Remember to update br_switchdev_fdb_populate() when adding
> + * new members to this structure
> + */
>  struct switchdev_notifier_fdb_info {
>  	struct switchdev_notifier_info info; /* must be first */
>  	const unsigned char *addr;

Reviewed-by: Nikolay Aleksandrov <razor@...ckwall.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ