ethtool: pse-pd: fix null-deref on genl_info in dump
Subsystems (4)
Jakub Kicinski
maintainerPATCH 1/1 ethtool: pse-pd: fix null-deref on genl_info in dump
ethnl_default_dump_one() passes NULL as info.
It's correct not to set extack during dump, as we should just silently skip interfaces which can't provide the information.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- net/ethtool/pse-pd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ethtool/pse-pd.c +1 -1
@@ -64,7 +64,7 @@ static int pse_prepare_data(const struct ethnl_req_info *req_base,if (ret <0 )return ret; - ret =pse_get_pse_attributes (dev, info->extack, data); + ret =pse_get_pse_attributes (dev, info ? info->extack :NULL , data);ethnl_ops_complete (dev);
Signature · 1 line
2.37.3
Quoted 5 lines · Jakub Kicinski
ethnl_default_dump_one()passes NULL as info.It's correct not to set extack during dump, as we should just silently skip interfaces which can't provide the information.
Quoted 8 lines
Reported-by [email protected]Fixes 18ff0bcda6d1 ("ethtool: add interface to interact with Ethernet Power Equipment")Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
Thank you!
Quoted 21 lines
--- net/ethtool/pse-pd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/ethtool/pse-pd.c +1
-1@@ -64,7 +64,7 @@ static int pse_prepare_data(const struct ethnl_req_info *req_base,if (ret <0 )return ret; - ret =pse_get_pse_attributes (dev, info->extack, data); + ret =pse_get_pse_attributes (dev, info ? info->extack :NULL , data);ethnl_ops_complete (dev);Signature · 1 line
2.37.3
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 10 lines · On Wed, 19 Oct 2022 15:35:51 -0700 you wrote:
ethnl_default_dump_one()passes NULL as info.It's correct not to set extack during dump, as we should just silently skip interfaces which can't provide the information.
Reported-by [email protected]Fixes 18ff0bcda6d1 ("ethtool: add interface to interact with Ethernet Power Equipment")Signed-off-by Jakub Kicinski <[email protected]>[...]
Here is the summary with links:
- [net] ethtool: pse-pd: fix null-deref on genl_info in dump
https://git.kernel.org/netdev/net/c/46cdedf2a0fa
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html