Skip to contentSkip to conversation

ethtool: don't propagate EOPNOTSUPP from dumps

PATCH Applied Jakub Kicinski 3 participants 3 messages Nov 26, 2023 – Nov 29, 2023

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 ethtool: don't propagate EOPNOTSUPP from dumps

The default dump handler needs to clear ret before returning. Otherwise if the last interface returns an inconsequential error this error will propagate to user space.

This may confuse user space (ethtool CLI seems to ignore it, but YNL doesn't). It will also terminate the dump early for mutli-skb dump, because netlink core treats EOPNOTSUPP as a real error.

Fixes 728480f12442 ("ethtool: default handlers for GET requests")

---
CC: [email protected]
CC: [email protected]

---
 net/ethtool/netlink.c | 1 +
 1 file changed, 1 insertion(+)
net/ethtool/netlink.c +1 -0
index 3bbd5afb7b31..fe3553f60bf3 100644
@@ -505,6 +505,7 @@ static int ethnl_default_dumpit(struct sk_buff *skb,
 				ret = skb->len;
 			break;
 		}
+		ret = 0;
 	}
 	rtnl_unlock();
 
Signature · 1 line
2.42.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jakub Kicinski

The default dump handler needs to clear ret before returning. Otherwise if the last interface returns an inconsequential error this error will propagate to user space.

This may confuse user space (ethtool CLI seems to ignore it, but YNL doesn't). It will also terminate the dump early for mutli-skb dump, because netlink core treats EOPNOTSUPP as a real error.

Fixes 728480f12442 ("ethtool: default handlers for GET requests")
#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Sun, 26 Nov 2023 14:58:06 -0800 you wrote:

The default dump handler needs to clear ret before returning. Otherwise if the last interface returns an inconsequential error this error will propagate to user space.

This may confuse user space (ethtool CLI seems to ignore it, but YNL doesn't). It will also terminate the dump early for mutli-skb dump, because netlink core treats EOPNOTSUPP as a real error.

[...]

Here is the summary with links:
- [net] ethtool: don't propagate EOPNOTSUPP from dumps

    https://git.kernel.org/netdev/net/c/cbeb989e41f4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html