diff mbox series

[net] ethtool: eeprom: fix null-deref on genl_info in dump

Message ID 5575919a2efc74cd9ad64021880afc3805c54166.1666362167.git.lucien.xin@gmail.com (mailing list archive)
State Accepted
Commit 9d9effca9d7d7cf6341182a7c5cabcbd6fa28063
Delegated to: Netdev Maintainers
Headers show
Series [net] ethtool: eeprom: fix null-deref on genl_info in dump | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers warning 2 maintainers not CCed: idosch@nvidia.com ivecera@redhat.com
netdev/build_clang success Errors and warnings before: 5 this patch: 5
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch warning WARNING: line length of 85 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Xin Long Oct. 21, 2022, 2:22 p.m. UTC
The similar fix as commit 46cdedf2a0fa ("ethtool: pse-pd: fix null-deref on
genl_info in dump") is also needed for ethtool eeprom.

Fixes: c781ff12a2f3 ("ethtool: Allow network drivers to dump arbitrary EEPROM data")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/ethtool/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski Oct. 21, 2022, 3:30 p.m. UTC | #1
On Fri, 21 Oct 2022 10:22:47 -0400 Xin Long wrote:
> The similar fix as commit 46cdedf2a0fa ("ethtool: pse-pd: fix null-deref on
> genl_info in dump") is also needed for ethtool eeprom.
> 
> Fixes: c781ff12a2f3 ("ethtool: Allow network drivers to dump arbitrary EEPROM data")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Reviewed-by: Jakub Kicinski <kuba@kernel.org>
patchwork-bot+netdevbpf@kernel.org Oct. 25, 2022, 2:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 21 Oct 2022 10:22:47 -0400 you wrote:
> The similar fix as commit 46cdedf2a0fa ("ethtool: pse-pd: fix null-deref on
> genl_info in dump") is also needed for ethtool eeprom.
> 
> Fixes: c781ff12a2f3 ("ethtool: Allow network drivers to dump arbitrary EEPROM data")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
>  net/ethtool/eeprom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net] ethtool: eeprom: fix null-deref on genl_info in dump
    https://git.kernel.org/netdev/net/c/9d9effca9d7d

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/ethtool/eeprom.c b/net/ethtool/eeprom.c
index 1c94bb8ea03f..49c0a2a77f02 100644
--- a/net/ethtool/eeprom.c
+++ b/net/ethtool/eeprom.c
@@ -124,7 +124,7 @@  static int eeprom_prepare_data(const struct ethnl_req_info *req_base,
 	if (ret)
 		goto err_free;
 
-	ret = get_module_eeprom_by_page(dev, &page_data, info->extack);
+	ret = get_module_eeprom_by_page(dev, &page_data, info ? info->extack : NULL);
 	if (ret < 0)
 		goto err_ops;