[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37b65a59-b7f0-2863-5903-d806673a18b5@gmail.com>
Date: Mon, 13 Dec 2021 20:46:38 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next] ethtool: fix null-ptr-deref on ref tracker
On 12/13/21 5:39 PM, Jakub Kicinski wrote:
> dev can be a NULL here, not all requests set require_dev.
>
> Fixes: e4b8954074f6 ("netlink: add net device refcount tracker to struct ethnl_req_info")
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> net/ethtool/netlink.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
> index 23f32a995099..767fb3f17267 100644
> --- a/net/ethtool/netlink.c
> +++ b/net/ethtool/netlink.c
> @@ -141,8 +141,10 @@ int ethnl_parse_header_dev_get(struct ethnl_req_info *req_info,
> return -EINVAL;
> }
>
Oh I am reading your patch after I sent mine.
Please use edumazet@...gle.com next time, because eric.dumazet@...il.com has
huge lag (typical vger -> accounts@...il.com issues)
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Thanks !
> - req_info->dev = dev;
> - netdev_tracker_alloc(dev, &req_info->dev_tracker, GFP_KERNEL);
> + if (dev) {
> + req_info->dev = dev;
> + netdev_tracker_alloc(dev, &req_info->dev_tracker, GFP_KERNEL);
> + }
> req_info->flags = flags;
> return 0;
> }
Powered by blists - more mailing lists