[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210325090333.26088719@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 25 Mar 2021 09:03:33 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: kbuild@...ts.01.org, davem@...emloft.net, lkp@...el.com,
kbuild-all@...ts.01.org, netdev@...r.kernel.org,
ecree.xilinx@...il.com, michael.chan@...adcom.com,
damian.dybek@...el.com, paul.greenwalt@...el.com,
rajur@...lsio.com, jaroslawx.gawin@...el.com, vkochan@...vell.com,
alobakin@...me
Subject: Re: [PATCH net-next 5/6] ethtool: fec: sanitize
ethtool_fecparam->fec
On Thu, 25 Mar 2021 15:00:47 +0300 Dan Carpenter wrote:
> Hi Jakub,
>
> url: https://github.com/0day-ci/linux/commits/Jakub-Kicinski/ethtool-clarify-the-ethtool-FEC-interface/20210325-091411
> base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 69cdfb530f7b8b094e49555454869afc8140b1bb
> config: x86_64-randconfig-m001-20210325 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> smatch warnings:
> net/ethtool/ioctl.c:2589 ethtool_set_fecparam() warn: bitwise AND condition is false here
>
> vim +2589 net/ethtool/ioctl.c
>
> 1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2579 static int ethtool_set_fecparam(struct net_device *dev, void __user *useraddr)
> 1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2580 {
> 1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2581 struct ethtool_fecparam fecparam;
> 1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2582
> 1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2583 if (!dev->ethtool_ops->set_fecparam)
> 1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2584 return -EOPNOTSUPP;
> 1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2585
> 1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2586 if (copy_from_user(&fecparam, useraddr, sizeof(fecparam)))
> 1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2587 return -EFAULT;
> 1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2588
> 15beed7dba77ce net/ethtool/ioctl.c Jakub Kicinski 2021-03-24 @2589 if (!fecparam.fec || fecparam.fec & ETHTOOL_FEC_NONE_BIT)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:o good catch. s/_BIT//. Thanks!
Powered by blists - more mailing lists