[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200709.123626.261284515556787924.davem@davemloft.net>
Date: Thu, 09 Jul 2020 12:36:26 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: mkubecek@...e.cz
Cc: kuba@...nel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] ethtool: fix genlmsg_put() failure handling in
ethnl_default_dumpit()
From: Michal Kubecek <mkubecek@...e.cz>
Date: Thu, 9 Jul 2020 12:11:50 +0200 (CEST)
> If the genlmsg_put() call in ethnl_default_dumpit() fails, we bail out
> without checking if we already have some messages in current skb like we do
> with ethnl_default_dump_one() failure later. Therefore if existing messages
> almost fill up the buffer so that there is not enough space even for
> netlink and genetlink header, we lose all prepared messages and return and
> error.
>
> Rather than duplicating the skb->len check, move the genlmsg_put(),
> genlmsg_cancel() and genlmsg_end() calls into ethnl_default_dump_one().
> This is also more logical as all message composition will be in
> ethnl_default_dump_one() and only iteration logic will be left in
> ethnl_default_dumpit().
>
> Fixes: 728480f12442 ("ethtool: default handlers for GET requests")
> Reported-by: Jakub Kicinski <kuba@...nel.org>
> Signed-off-by: Michal Kubecek <mkubecek@...e.cz>
Applied and queued up for -stable, thanks.
Powered by blists - more mailing lists