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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z_fnlxK0Ohj-Ky_1@mini-arch>
Date: Thu, 10 Apr 2025 08:45:27 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
	pabeni@...hat.com, andrew+netdev@...n.ch, horms@...nel.org,
	sdf@...ichev.me, kuniyu@...zon.com
Subject: Re: [PATCH net-next] net: convert dev->rtnl_link_state to a bool

On 04/09, Jakub Kicinski wrote:
> netdevice reg_state was split into two 16 bit enums back in 2010
> in commit a2835763e130 ("rtnetlink: handle rtnl_link netlink
> notifications manually"). Since the split the fields have been
> moved apart, and last year we converted reg_state to a normal
> u8 in commit 4d42b37def70 ("net: convert dev->reg_state to u8").
> 
> rtnl_link_state being a 16 bitfield makes no sense. Convert it
> to a single bool, it seems very unlikely after 15 years that
> we'll need more values in it.
> 
> We could drop dev->rtnl_link_ops from the conditions but feels
> like having it there more clearly points at the reason for this
> hack.

Acked-by: Stanislav Fomichev <sdf@...ichev.me>

But for me having rtnl_link_ops in the mix is still hard to read.
Might be more clear to rename rtnl_link_initializing to
suppress_rtnl_notify, make it false by default, and set to true 
from rtnl_create_link. Then reading conditions like the one below
will make more sense (imo):

	if (!dev->suppress_rtnl_notify)
  		rtmsg_ifinfo(RTM_NEWLINK, dev, ~0U, GFP_KERNEL, 0, NULL);

(iow, reverse the conditional so false works for most non-ops devices)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ