]> git.baikalelectronics.ru Git - kernel.git/commit
net: switchdev: add reminder near struct switchdev_notifier_fdb_info
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 28 Jun 2022 10:08:31 +0000 (13:08 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Jun 2022 03:37:36 +0000 (20:37 -0700)
commit435b942deb9b9340790cb7610e7b8b644a42d10d
tree155f961c5f204a7a1264adadfc18011532ba26bf
parent23cfa04d4bdd8528d11d852f2dd25e9e48bd1277
net: switchdev: add reminder near struct switchdev_notifier_fdb_info

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>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://lore.kernel.org/r/20220628100831.2899434-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/switchdev.h