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, 3 Jun 2024 06:54:25 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Eric Dumazet <edumazet@...gle.com>
Cc: David Ahern <dsahern@...nel.org>, Stephen Hemminger
 <stephen@...workplumber.org>, davem@...emloft.net, netdev@...r.kernel.org,
 pabeni@...hat.com, Jaroslav Pulchart <jaroslav.pulchart@...ddata.com>
Subject: Re: [PATCH net] inet: bring NLM_DONE out to a separate recv() in
 inet_dump_ifaddr()

On Sun, 2 Jun 2024 15:21:02 -0700 Jakub Kicinski wrote:
> Netlink is full of legacy behavior, the only way to make it usable
> in modern environments is to let new families not repeat the mistakes.
> That's why I'd really rather not add a workaround at the af_netlink
> level. Why would ethtool (which correctly coalesced NLM_DONE from day 1)
> suddenly start needed another recv(). A lot of the time the entire dump
> fits in one skb.
> 
> If you prefer to sacrifice all of rtnetlink (some of which, to be clear,
> has also been correctly coded from day 1) - we can add a trampoline for
> rtnetlink dump handlers?

Hi Eric, how do you feel about this approach? It would also let us
extract the "RTNL unlocked dump" handling from af_netlink.c, which
would be nice.

BTW it will probably need to be paired with fixing the
for_each_netdev_dump() foot gun, maybe (untested):

--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3025,7 +3025,8 @@ int call_netdevice_notifiers_info(unsigned long val,
 #define net_device_entry(lh)	list_entry(lh, struct net_device, dev_list)
 
 #define for_each_netdev_dump(net, d, ifindex)				\
-	xa_for_each_start(&(net)->dev_by_index, (ifindex), (d), (ifindex))
+	for (; (d = xa_find(&(net)->dev_by_index, &ifindex,		\
+			    ULONG_MAX, XA_PRESENT)); ifindex++)
 
 static inline struct net_device *next_net_device(struct net_device *dev)
 {


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ