From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Jakub Kicinski <kuba@kernel.org>,
davem@davemloft.net
Cc: lkp@intel.com, kbuild-all@lists.01.org, netdev@vger.kernel.org,
ecree.xilinx@gmail.com, michael.chan@broadcom.com,
damian.dybek@intel.com, paul.greenwalt@intel.com,
rajur@chelsio.com, jaroslawx.gawin@intel.com,
vkochan@marvell.com, alobakin@pm.me
Subject: Re: [PATCH net-next 5/6] ethtool: fec: sanitize ethtool_fecparam->fec
Date: Thu, 25 Mar 2021 15:00:47 +0300 [thread overview]
Message-ID: <20210325120047.GX1717@kadam> (raw)
In-Reply-To: <20210325011200.145818-6-kuba@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 2761 bytes --]
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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.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)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This should be if (!fecparam.fec || fecparam.fec & BIT(ETHTOOL_FEC_NONE_BIT))
15beed7dba77ce net/ethtool/ioctl.c Jakub Kicinski 2021-03-24 2590 return -EINVAL;
15beed7dba77ce net/ethtool/ioctl.c Jakub Kicinski 2021-03-24 2591
c405852e12f210 net/ethtool/ioctl.c Jakub Kicinski 2021-03-24 2592 fecparam.active_fec = 0;
76d37e2ba4f23d net/ethtool/ioctl.c Jakub Kicinski 2021-03-24 2593 fecparam.reserved = 0;
76d37e2ba4f23d net/ethtool/ioctl.c Jakub Kicinski 2021-03-24 2594
1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2595 return dev->ethtool_ops->set_fecparam(dev, &fecparam);
1a5f3da20bd966 net/core/ethtool.c Vidya Sagar Ravipati 2017-07-27 2596 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32759 bytes --]
next prev parent reply other threads:[~2021-03-25 12:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-25 1:11 [PATCH net-next 0/6] ethtool: clarify the ethtool FEC interface Jakub Kicinski
2021-03-25 1:11 ` [PATCH net-next 1/6] ethtool: fec: fix typo in kdoc Jakub Kicinski
2021-03-25 12:06 ` Andrew Lunn
2021-03-25 1:11 ` [PATCH net-next 2/6] ethtool: fec: remove long structure description Jakub Kicinski
2021-03-25 12:07 ` Andrew Lunn
2021-03-25 1:11 ` [PATCH net-next 3/6] ethtool: fec: sanitize ethtool_fecparam->reserved Jakub Kicinski
2021-03-25 12:22 ` Andrew Lunn
2021-03-25 16:02 ` Jakub Kicinski
2021-03-25 1:11 ` [PATCH net-next 4/6] ethtool: fec: sanitize ethtool_fecparam->active_fec Jakub Kicinski
2021-03-25 12:25 ` Andrew Lunn
2021-03-25 1:11 ` [PATCH net-next 5/6] ethtool: fec: sanitize ethtool_fecparam->fec Jakub Kicinski
2021-03-25 12:00 ` Dan Carpenter [this message]
2021-03-25 16:03 ` Jakub Kicinski
2021-03-25 1:12 ` [PATCH net-next 6/6] ethtool: clarify the ethtool FEC interface Jakub Kicinski
2021-03-29 11:56 ` Edward Cree
2021-03-29 12:32 ` Andrew Lunn
2021-03-29 17:39 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210325120047.GX1717@kadam \
--to=dan.carpenter@oracle.com \
--cc=alobakin@pm.me \
--cc=damian.dybek@intel.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=jaroslawx.gawin@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=kuba@kernel.org \
--cc=lkp@intel.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=paul.greenwalt@intel.com \
--cc=rajur@chelsio.com \
--cc=vkochan@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox