All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <razor@blackwall.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Jiri Pirko <jiri@resnulli.us>, Ivan Vecera <ivecera@redhat.com>,
	Roopa Prabhu <roopa@nvidia.com>, Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net-next] net: switchdev: add reminder near struct switchdev_notifier_fdb_info
Date: Wed, 29 Jun 2022 11:07:43 +0300	[thread overview]
Message-ID: <33ceacbe-7cde-d131-f208-2d53a47eca0e@blackwall.org> (raw)
In-Reply-To: <20220628100831.2899434-1-vladimir.oltean@nxp.com>

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@nxp.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@blackwall.org>


  parent reply	other threads:[~2022-06-29  8:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 10:08 [PATCH net-next] net: switchdev: add reminder near struct switchdev_notifier_fdb_info Vladimir Oltean
2022-06-29  6:46 ` Ido Schimmel
2022-06-29  8:07 ` Nikolay Aleksandrov [this message]
2022-06-30  4:00 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33ceacbe-7cde-d131-f208-2d53a47eca0e@blackwall.org \
    --to=razor@blackwall.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idosch@nvidia.com \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=roopa@nvidia.com \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.