summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-03-25 04:11:58 +0300
committerDavid S. Miller <davem@davemloft.net>2021-03-26 02:46:53 +0300
commitd3b37fc805d9ef697451730ebdfc7e35e6c2ace8 (patch)
tree6a278dde025950740c93261759564512b1f6662f /net
parent240e114411e74d2ee8121643e0c67717eb7c6982 (diff)
downloadlinux-d3b37fc805d9ef697451730ebdfc7e35e6c2ace8.tar.xz
ethtool: fec: sanitize ethtool_fecparam->active_fec
struct ethtool_fecparam::active_fec is a GET-only field, all in-tree drivers correctly ignore it on SET. Clear the field on SET to avoid any confusion. Again, we can't reject non-zero now since ethtool user space does not zero-init the param correctly. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ethtool/ioctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index be3549023d89..237ffe5440ef 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -2586,6 +2586,7 @@ static int ethtool_set_fecparam(struct net_device *dev, void __user *useraddr)
if (copy_from_user(&fecparam, useraddr, sizeof(fecparam)))
return -EFAULT;
+ fecparam.active_fec = 0;
fecparam.reserved = 0;
return dev->ethtool_ops->set_fecparam(dev, &fecparam);