]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ethtool: pse-pd: fix null-deref on genl_info in dump
authorJakub Kicinski <kuba@kernel.org>
Wed, 19 Oct 2022 22:35:51 +0000 (15:35 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Oct 2022 12:18:05 +0000 (13:18 +0100)
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: syzbot+81c4b4bbba6eea2cfcae@syzkaller.appspotmail.com
Fixes: 57bfe243b3ff ("ethtool: add interface to interact with Ethernet Power Equipment")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/pse-pd.c

index 5a471e115b66acf5c0bc04bd4905c3a3b7b83c78..e8683e485dc91d0b238d85324741905493af9a90 100644 (file)
@@ -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);