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]
Date:	Mon, 10 Sep 2012 11:09:49 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Shlomo Pongartz <shlomop@...lanox.com>
Cc:	netdev@...r.kernel.org
Subject: Re: ndo_get_stats and rtnl_netlink

On Sun, 2012-09-09 at 18:23 +0300, Shlomo Pongartz wrote:
> Hi,
> 
> Just realized that dev_get_stats which calls into a netdevice 
> ndo_get_stats64/ndo_get_stats can be
> called with or without RTNL lock protection. If called from 
> rtnl_fill_ifinfo e.g as of invocation of
> "ip link show <interface>, there IS locking, however if called from 
> dev_seq_printf_stats e.g as of
> invocation of reading the /sys/class/net/<interface>/statistics/ 
> entries, etc more cases -- no locking.
> 
> This turned to be problematic when implementing the ethtool 
> "set_channels" directive which
> changes the number of **rings**, since we stepped on a bug where the 
> rings data structure was
> changed by the ethtool flow in the same time a statistics call was done 
> into the driver, etc.
> 
> What would be the way to continue here, per driver lock sounds non 
> generic...

RTNL locking is not needed to fetch stats, and would be overkill.

Each driver has its own way to protect/gather its stats.



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ