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: <CANn89iK8TEtpZa67-FfR6KFKAj_HCdtn3573Z9Cd7PG26WP3iA@mail.gmail.com>
Date:   Sat, 10 Dec 2022 00:58:59 +0100
From:   Eric Dumazet <edumazet@...gle.com>
To:     Hangbin Liu <liuhangbin@...il.com>
Cc:     netdev@...r.kernel.org, Jay Vosburgh <j.vosburgh@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Jonathan Toppins <jtoppins@...hat.com>,
        Paolo Abeni <pabeni@...hat.com>, liali <liali@...hat.com>
Subject: Re: [PATCH net 1/3] bonding: access curr_active_slave with rtnl_dereference

On Fri, Dec 9, 2022 at 11:13 AM Hangbin Liu <liuhangbin@...il.com> wrote:
>
> Looks commit 4740d6382790 ("bonding: add proper __rcu annotation for
> curr_active_slave") missed rtnl_dereference for curr_active_slave
> in bond_miimon_commit().
>
> Fixes: 4740d6382790 ("bonding: add proper __rcu annotation for curr_active_slave")


> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
> ---
>  drivers/net/bonding/bond_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index b9a882f182d2..2b6cc4dbb70e 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -2689,7 +2689,7 @@ static void bond_miimon_commit(struct bonding *bond)
>
>                         bond_miimon_link_change(bond, slave, BOND_LINK_UP);
>
> -                       if (!bond->curr_active_slave || slave == primary)
> +                       if (!rtnl_dereference(bond->curr_active_slave) || slave == primary)

We do not dereference the pointer here.

If this is fixing a sparse issue, then use the correct RCU helper for this.

( rcu_access_pointer())

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ