linux_dsm_epyc7002/net/ethtool
Michal Kubecek 365f9ae4ee ethtool: fix genlmsg_put() failure handling in ethnl_default_dumpit()
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: 728480f124 ("ethtool: default handlers for GET requests")
Reported-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-07-09 12:35:33 -07:00
..
bitset.c
bitset.h
cabletest.c net: ethtool: Handle missing cable test TDR parameters 2020-06-23 20:21:01 -07:00
channels.c
coalesce.c
common.c net: ethtool: add missing string for NETIF_F_GSO_TUNNEL_REMCSUM 2020-06-23 14:52:27 -07:00
common.h
debug.c
eee.c
features.c
ioctl.c
linkinfo.c
linkmodes.c
linkstate.c ethtool: fix error handling in linkstate_prepare_data() 2020-06-25 16:17:16 -07:00
Makefile
netlink.c ethtool: fix genlmsg_put() failure handling in ethnl_default_dumpit() 2020-07-09 12:35:33 -07:00
netlink.h
pause.c
privflags.c
rings.c
strset.c
tsinfo.c
wol.c