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: <YRJy3F6lXuKNQIpl@unreal>
Date:   Tue, 10 Aug 2021 15:36:44 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Vladimir Oltean <vladimir.oltean@....com>
Cc:     netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        Vadym Kochan <vkochan@...vell.com>,
        Taras Chornyi <tchornyi@...vell.com>,
        Saeed Mahameed <saeedm@...dia.com>,
        Jiri Pirko <jiri@...dia.com>, Ido Schimmel <idosch@...dia.com>,
        Lars Povlsen <lars.povlsen@...rochip.com>,
        Steen Hegelund <Steen.Hegelund@...rochip.com>,
        UNGLinuxDriver@...rochip.com,
        Grygorii Strashko <grygorii.strashko@...com>,
        Julian Wiedmann <jwi@...ux.ibm.com>,
        Karsten Graul <kgraul@...ux.ibm.com>,
        Heiko Carstens <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ibm.com>,
        Jianbo Liu <jianbol@...dia.com>,
        Vlad Buslov <vladbu@...dia.com>,
        Bjarni Jonasson <bjarni.jonasson@...rochip.com>,
        Vignesh Raghavendra <vigneshr@...com>,
        Tobias Waldekranz <tobias@...dekranz.com>,
        linux-kernel@...r.kernel.org, linux-rdma@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-omap@...r.kernel.org,
        linux-s390@...r.kernel.org, Russell King <linux@...linux.org.uk>,
        Ido Schimmel <idosch@...sch.org>
Subject: Re: [PATCH v2 net] net: switchdev: zero-initialize struct
 switchdev_notifier_fdb_info emitted by drivers towards the bridge

On Tue, Aug 10, 2021 at 02:50:24PM +0300, Vladimir Oltean wrote:
> The blamed commit a new field to struct switchdev_notifier_fdb_info, but
> did not make sure that all call paths set it to something valid. For
> example, a switchdev driver may emit a SWITCHDEV_FDB_ADD_TO_BRIDGE
> notifier, and since the 'is_local' flag is not set, it contains junk
> from the stack, so the bridge might interpret those notifications as
> being for local FDB entries when that was not intended.
> 
> To avoid that now and in the future, zero-initialize all
> switchdev_notifier_fdb_info structures created by drivers such that all
> newly added fields to not need to touch drivers again.
> 
> Fixes: 2c4eca3ef716 ("net: bridge: switchdev: include local flag in FDB notifications")
> Reported-by: Ido Schimmel <idosch@...sch.org>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> Reviewed-by: Ido Schimmel <idosch@...dia.com>
> Tested-by: Ido Schimmel <idosch@...dia.com>
> ---
> v1->v2: use an empty struct initializer as opposed to memset, as
>         suggested by Leon Romanovsky
> 
>  drivers/net/ethernet/marvell/prestera/prestera_switchdev.c | 4 ++--
>  drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c       | 2 +-
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c      | 4 ++--
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c   | 2 +-
>  drivers/net/ethernet/microchip/sparx5/sparx5_mactable.c    | 2 +-
>  drivers/net/ethernet/rocker/rocker_main.c                  | 2 +-
>  drivers/net/ethernet/rocker/rocker_ofdpa.c                 | 2 +-
>  drivers/net/ethernet/ti/am65-cpsw-switchdev.c              | 2 +-
>  drivers/net/ethernet/ti/cpsw_switchdev.c                   | 2 +-
>  drivers/s390/net/qeth_l2_main.c                            | 4 ++--
>  net/dsa/slave.c                                            | 2 +-
>  11 files changed, 14 insertions(+), 14 deletions(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@...dia.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ