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: <20230323113945.0915029d@kernel.org>
Date:   Thu, 23 Mar 2023 11:39:45 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Wolfram Sang <wsa+renesas@...g-engineering.com>
Cc:     netdev@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Simon Horman <simon.horman@...igine.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Steve Glendinning <steve.glendinning@...well.net>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Vladimir Oltean <olteanv@...il.com>
Subject: Re: [PATCH net v3 1/2] smsc911x: only update stats when interface
 is up

On Wed, 22 Mar 2023 08:19:58 +0100 Wolfram Sang wrote:
> -	smsc911x_tx_update_txcounters(dev);
> -	dev->stats.rx_dropped += smsc911x_reg_read(pdata, RX_DROP);
> +
> +	if (netif_running(dev)) {
> +		smsc911x_tx_update_txcounters(dev);
> +		dev->stats.rx_dropped += smsc911x_reg_read(pdata, RX_DROP);
> +	}

Same problem as on the renesas patch, netif_running() can return true
before ndo->open() is called. And stats can be read with just the RCU
lock (via procfs).

Maybe we should add a false-negative version of netif_running() ?
__LINK_STATE_START*ED* ?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ