From: Jakub Kicinski Date: Wed, 19 Oct 2022 22:35:51 +0000 (-0700) Subject: ethtool: pse-pd: fix null-deref on genl_info in dump X-Git-Tag: v6.1-rc5~107^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=46cdedf2a0fa20a99ca8be40bccde7487e13b77a;p=platform%2Fkernel%2Flinux-starfive.git 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. Reported-by: syzbot+81c4b4bbba6eea2cfcae@syzkaller.appspotmail.com Fixes: 18ff0bcda6d1 ("ethtool: add interface to interact with Ethernet Power Equipment") Signed-off-by: Jakub Kicinski Reviewed-by: Oleksij Rempel Signed-off-by: David S. Miller --- diff --git a/net/ethtool/pse-pd.c b/net/ethtool/pse-pd.c index 5a471e1..e8683e4 100644 --- a/net/ethtool/pse-pd.c +++ b/net/ethtool/pse-pd.c @@ -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);