* Re: [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption
@ 2022-05-22 10:18 kernel test robot
2022-05-24 8:26 ` kernel test robot
0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2022-05-22 10:18 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 26764 bytes --]
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220520011538.1098888-11-vinicius.gomes@intel.com>
References: <20220520011538.1098888-11-vinicius.gomes@intel.com>
TO: Vinicius Costa Gomes <vinicius.gomes@intel.com>
TO: netdev(a)vger.kernel.org
CC: Vinicius Costa Gomes <vinicius.gomes@intel.com>
CC: jhs(a)mojatatu.com
CC: xiyou.wangcong(a)gmail.com
CC: jiri(a)resnulli.us
CC: davem(a)davemloft.net
CC: vladimir.oltean(a)nxp.com
CC: po.liu(a)nxp.com
CC: boon.leong.ong(a)intel.com
CC: intel-wired-lan(a)lists.osuosl.org
Hi Vinicius,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Vinicius-Costa-Gomes/ethtool-Add-support-for-frame-preemption/20220520-092800
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git df98714e432abf5cbdac3e4c1a13f94c65ddb8d3
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: arm-randconfig-c002-20220522 (https://download.01.org/0day-ci/archive/20220522/202205221852.CJ4p5boS-lkp(a)intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 1443dbaba6f0e57be066995db9164f89fb57b413)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/a42e940bc53c40ee4e33a1bbf022a663bb28a9c7
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Vinicius-Costa-Gomes/ethtool-Add-support-for-frame-preemption/20220520-092800
git checkout a42e940bc53c40ee4e33a1bbf022a663bb28a9c7
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^~~ ~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:937:21: note: Value stored to 'dev' during its initialization is never read
struct net_device *dev = adapter->netdev;
^~~ ~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:962:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:962:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:1000:3: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(mta_list + (i++ * ETH_ALEN), ha->addr, ETH_ALEN);
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:1000:3: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(mta_list + (i++ * ETH_ALEN), ha->addr, ETH_ALEN);
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:1784:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(__skb_put(skb, headlen + metasize), xdp->data_meta,
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:1784:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(__skb_put(skb, headlen + metasize), xdp->data_meta,
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:2595:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(__skb_put(skb, totalsize), xdp->data_meta,
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:2595:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(__skb_put(skb, totalsize), xdp->data_meta,
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:3035:21: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct net_device *dev = adapter->netdev;
^~~ ~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:3035:21: note: Value stored to 'dev' during its initialization is never read
struct net_device *dev = adapter->netdev;
^~~ ~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:3064:21: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct net_device *dev = adapter->netdev;
^~~ ~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:3064:21: note: Value stored to 'dev' during its initialization is never read
struct net_device *dev = adapter->netdev;
^~~ ~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:3100:21: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct net_device *dev = adapter->netdev;
^~~ ~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:3100:21: note: Value stored to 'dev' during its initialization is never read
struct net_device *dev = adapter->netdev;
^~~ ~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:3374:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(&flex->data[offset], src, len);
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:3374:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(&flex->data[offset], src, len);
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:4154:3: warning: Value stored to 'current_itr' is never read [clang-analyzer-deadcode.DeadStores]
current_itr = 0;
^ ~
drivers/net/ethernet/intel/igc/igc_main.c:4154:3: note: Value stored to 'current_itr' is never read
current_itr = 0;
^ ~
drivers/net/ethernet/intel/igc/igc_main.c:4311:6: warning: Value stored to 'new_val' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
int new_val = q_vector->itr_val;
^~~~~~~ ~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:4311:6: note: Value stored to 'new_val' during its initialization is never read
int new_val = q_vector->itr_val;
^~~~~~~ ~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:4493:3: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(q_vector, 0, struct_size(q_vector, ring, ring_count));
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:4493:3: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(q_vector, 0, struct_size(q_vector, ring, ring_count));
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5071:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(stats, &adapter->stats64, sizeof(*stats));
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5071:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(stats, &adapter->stats64, sizeof(*stats));
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5316:4: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
sprintf(q_vector->name, "%s-TxRx-%u", netdev->name,
^~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5316:4: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11
sprintf(q_vector->name, "%s-TxRx-%u", netdev->name,
^~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5319:4: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
sprintf(q_vector->name, "%s-tx-%u", netdev->name,
^~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5319:4: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11
sprintf(q_vector->name, "%s-tx-%u", netdev->name,
^~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5322:4: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
sprintf(q_vector->name, "%s-rx-%u", netdev->name,
^~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5322:4: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11
sprintf(q_vector->name, "%s-rx-%u", netdev->name,
^~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5325:4: warning: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
sprintf(q_vector->name, "%s-unused", netdev->name);
^~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5325:4: note: Call to function 'sprintf' is insecure as it does not provide bounding of the memory buffer or security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'sprintf_s' in case of C11
sprintf(q_vector->name, "%s-unused", netdev->name);
^~~~~~~
>> drivers/net/ethernet/intel/igc/igc_main.c:5919:6: warning: Access to field 'preemptible' results in a dereference of an undefined pointer value (loaded from variable 'ring') [clang-analyzer-core.NullDereference]
if (ring->preemptible) {
^
drivers/net/ethernet/intel/igc/igc_main.c:6258:2: note: Control jumps to 'case TC_SETUP_QDISC_ETF:' at line 6262
switch (type) {
^
drivers/net/ethernet/intel/igc/igc_main.c:6263:10: note: Calling 'igc_tsn_enable_launchtime'
return igc_tsn_enable_launchtime(adapter, type_data);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5989:6: note: Assuming field 'type' is equal to igc_i225
if (hw->mac.type != igc_i225)
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5989:2: note: Taking false branch
if (hw->mac.type != igc_i225)
^
drivers/net/ethernet/intel/igc/igc_main.c:5992:8: note: Calling 'igc_save_launchtime_params'
err = igc_save_launchtime_params(adapter, qopt->queue, qopt->enable);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5914:2: note: 'ring' declared without an initial value
struct igc_ring *ring;
^~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5916:6: note: Assuming 'queue' is >= 0
if (queue < 0 || queue >= adapter->num_tx_queues)
^~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5916:6: note: Left side of '||' is false
drivers/net/ethernet/intel/igc/igc_main.c:5916:19: note: Assuming 'queue' is < field 'num_tx_queues'
if (queue < 0 || queue >= adapter->num_tx_queues)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:5916:2: note: Taking false branch
if (queue < 0 || queue >= adapter->num_tx_queues)
^
drivers/net/ethernet/intel/igc/igc_main.c:5919:6: note: Access to field 'preemptible' results in a dereference of an undefined pointer value (loaded from variable 'ring')
if (ring->preemptible) {
^~~~
drivers/net/ethernet/intel/igc/igc_main.c:6169:2: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(data, 0, IGC_FP_SMD_FRAME_SIZE);
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:6169:2: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(data, 0, IGC_FP_SMD_FRAME_SIZE);
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:6533:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(&hw->mac.ops, ei->mac_ops, sizeof(hw->mac.ops));
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:6533:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(&hw->mac.ops, ei->mac_ops, sizeof(hw->mac.ops));
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:6534:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(&hw->phy.ops, ei->phy_ops, sizeof(hw->phy.ops));
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:6534:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(&hw->phy.ops, ei->phy_ops, sizeof(hw->phy.ops));
^~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:6651:2: warning: Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'strncpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
strncpy(netdev->name, "eth%d", IFNAMSIZ);
^~~~~~~
drivers/net/ethernet/intel/igc/igc_main.c:6651:2: note: Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'strncpy_s' in case of C11
strncpy(netdev->name, "eth%d", IFNAMSIZ);
^~~~~~~
Suppressed 93 warnings (91 in non-user code, 2 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
68 warnings generated.
drivers/net/ethernet/brocade/bna/bna_enet.c:201:3: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(stats_dst, 0, sizeof(struct bfi_enet_stats_rxf));
^~~~~~
drivers/net/ethernet/brocade/bna/bna_enet.c:201:3: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(stats_dst, 0, sizeof(struct bfi_enet_stats_rxf));
^~~~~~
drivers/net/ethernet/brocade/bna/bna_enet.c:216:3: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(stats_dst, 0, sizeof(struct bfi_enet_stats_txf));
^~~~~~
drivers/net/ethernet/brocade/bna/bna_enet.c:216:3: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(stats_dst, 0, sizeof(struct bfi_enet_stats_txf));
^~~~~~
drivers/net/ethernet/brocade/bna/bna_enet.c:1732:2: warning: Value stored to 'kva' is never read [clang-analyzer-deadcode.DeadStores]
kva += bfa_msgq_meminfo();
^ ~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/brocade/bna/bna_enet.c:1732:2: note: Value stored to 'kva' is never read
kva += bfa_msgq_meminfo();
^ ~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/brocade/bna/bna_enet.c:1733:2: warning: Value stored to 'dma' is never read [clang-analyzer-deadcode.DeadStores]
dma += bfa_msgq_meminfo();
^ ~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/brocade/bna/bna_enet.c:1733:2: note: Value stored to 'dma' is never read
dma += bfa_msgq_meminfo();
^ ~~~~~~~~~~~~~~~~~~
Suppressed 64 warnings (64 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
72 warnings generated.
drivers/net/ethernet/brocade/bna/bna_tx_rx.c:305:2: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memcpy(&req->table[0], rxf->rit, rxf->rit_size);
^~~~~~
drivers/net/ethernet/brocade/bna/bna_tx_rx.c:305:2: note: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11
memcpy(&req->table[0], rxf->rit, rxf->rit_size);
^~~~~~
drivers/net/ethernet/brocade/bna/bna_tx_rx.c:640:2: warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(rxf->vlan_filter_table, 0,
^~~~~~
drivers/net/ethernet/brocade/bna/bna_tx_rx.c:640:2: note: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(rxf->vlan_filter_table, 0,
^~~~~~
drivers/net/ethernet/brocade/bna/bna_tx_rx.c:912:3: warning: Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
vim +5919 drivers/net/ethernet/intel/igc/igc_main.c
5f2958052c5820 Vinicius Costa Gomes 2019-12-02 5910
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5911 static int igc_save_launchtime_params(struct igc_adapter *adapter, int queue,
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5912 bool enable)
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5913 {
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5914 struct igc_ring *ring;
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5915
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5916 if (queue < 0 || queue >= adapter->num_tx_queues)
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5917 return -EINVAL;
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5918
a42e940bc53c40 Vinicius Costa Gomes 2022-05-19 @5919 if (ring->preemptible) {
a42e940bc53c40 Vinicius Costa Gomes 2022-05-19 5920 netdev_err(adapter->netdev, "Cannot enable LaunchTime on a preemptible queue\n");
a42e940bc53c40 Vinicius Costa Gomes 2022-05-19 5921 return -EINVAL;
a42e940bc53c40 Vinicius Costa Gomes 2022-05-19 5922 }
a42e940bc53c40 Vinicius Costa Gomes 2022-05-19 5923
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5924 ring = adapter->tx_ring[queue];
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5925 ring->launchtime_enable = enable;
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5926
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5927 return 0;
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5928 }
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5929
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption
2022-05-22 10:18 [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption kernel test robot
@ 2022-05-24 8:26 ` kernel test robot
0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-05-24 8:26 UTC (permalink / raw)
To: Vinicius Costa Gomes, netdev; +Cc: llvm, kbuild-all
Hi Vinicius,
Thanks for your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Vinicius-Costa-Gomes/ethtool-Add-support-for-frame-preemption/20220520-092800
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git df98714e432abf5cbdac3e4c1a13f94c65ddb8d3
config: arm-randconfig-c002-20220522 (https://download.01.org/0day-ci/archive/20220522/202205221852.CJ4p5boS-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 1443dbaba6f0e57be066995db9164f89fb57b413)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/a42e940bc53c40ee4e33a1bbf022a663bb28a9c7
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Vinicius-Costa-Gomes/ethtool-Add-support-for-frame-preemption/20220520-092800
git checkout a42e940bc53c40ee4e33a1bbf022a663bb28a9c7
# save the config file
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <yujie.liu@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/intel/igc/igc_main.c:5919:6: warning: Access to field 'preemptible' results in a dereference of an undefined pointer value (loaded from variable 'ring') [clang-analyzer-core.NullDereference]
if (ring->preemptible) {
^
vim +5919 drivers/net/ethernet/intel/igc/igc_main.c
5f2958052c5820 Vinicius Costa Gomes 2019-12-02 5910
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5911 static int igc_save_launchtime_params(struct igc_adapter *adapter, int queue,
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5912 bool enable)
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5913 {
82faa9b799500f Vinicius Costa Gomes 2020-02-14 @5914 struct igc_ring *ring;
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5915
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5916 if (queue < 0 || queue >= adapter->num_tx_queues)
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5917 return -EINVAL;
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5918
a42e940bc53c40 Vinicius Costa Gomes 2022-05-19 @5919 if (ring->preemptible) {
a42e940bc53c40 Vinicius Costa Gomes 2022-05-19 5920 netdev_err(adapter->netdev, "Cannot enable LaunchTime on a preemptible queue\n");
a42e940bc53c40 Vinicius Costa Gomes 2022-05-19 5921 return -EINVAL;
a42e940bc53c40 Vinicius Costa Gomes 2022-05-19 5922 }
a42e940bc53c40 Vinicius Costa Gomes 2022-05-19 5923
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5924 ring = adapter->tx_ring[queue];
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5925 ring->launchtime_enable = enable;
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5926
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5927 return 0;
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5928 }
82faa9b799500f Vinicius Costa Gomes 2020-02-14 5929
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption
2022-05-20 1:15 ` [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption Vinicius Costa Gomes
2022-05-20 6:11 ` kernel test robot
@ 2022-05-20 11:06 ` Vladimir Oltean
1 sibling, 0 replies; 5+ messages in thread
From: Vladimir Oltean @ 2022-05-20 11:06 UTC (permalink / raw)
To: Vinicius Costa Gomes
Cc: netdev, jhs, xiyou.wangcong, jiri, davem, Po Liu, boon.leong.ong,
intel-wired-lan
On Thu, May 19, 2022 at 06:15:37PM -0700, Vinicius Costa Gomes wrote:
> Frame Preemption and LaunchTime cannot be enabled on the same queue.
> If that situation happens, emit an error to the user, and log the
> error.
>
> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> ---
> drivers/net/ethernet/intel/igc/igc_main.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
> index 69e96e9a3ec8..96ad00e33f4b 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -5916,6 +5916,11 @@ static int igc_save_launchtime_params(struct igc_adapter *adapter, int queue,
> if (queue < 0 || queue >= adapter->num_tx_queues)
> return -EINVAL;
>
> + if (ring->preemptible) {
> + netdev_err(adapter->netdev, "Cannot enable LaunchTime on a preemptible queue\n");
> + return -EINVAL;
> + }
> +
> ring = adapter->tx_ring[queue];
> ring->launchtime_enable = enable;
>
> --
> 2.35.3
>
I'm kind of concerned about this. I was thinking of adapting some
scripts I had into some functional kselftests for frame preemption.
I am sending 2 streams, one preemptable and one express. With SO_TXTIME
I am controlling their scheduled TX times, and I am forcing collisions
in the MAC merge layer by making the express packet have a scheduled TX
time equal to the preemptable packet's scheduled TX time, then I gradually
increase the express packet's scheduled time by small amounts (8 ns or so).
I take hardware TX timestamps of both packets and I plot when the express
packet is actually sent by the MAC. That is, I measure how long it takes
for the MAC to preempt and to reschedule the express packet.
My point is, if the LaunchTime feature cannot be enabled on preemptable
queues, how can I know that the igc does something functionally valid with
preemptable packets on TX, other than to reassemble the mPackets on RX?
Otherwise, if there isn't any other disagreement on the UAPI, would you
mind posting the iproute2 patch as well, so we could work in parallel
(me on enetc + the selftest) until net-next reopens? I'd like to write a
selftest that covers your hardware as well, but then again, not sure how
to cover it.
Do you have any sort of counters from the list in clause 30.14
Management for MAC Merge Sublayer? I see that structured ethtool counters
are becoming more popular, see struct ethtool_eth_mac_stats for example.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption
2022-05-20 1:15 ` [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption Vinicius Costa Gomes
@ 2022-05-20 6:11 ` kernel test robot
2022-05-20 11:06 ` Vladimir Oltean
1 sibling, 0 replies; 5+ messages in thread
From: kernel test robot @ 2022-05-20 6:11 UTC (permalink / raw)
To: Vinicius Costa Gomes, netdev
Cc: llvm, kbuild-all, Vinicius Costa Gomes, jhs, xiyou.wangcong,
jiri, davem, vladimir.oltean, po.liu, boon.leong.ong,
intel-wired-lan
Hi Vinicius,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Vinicius-Costa-Gomes/ethtool-Add-support-for-frame-preemption/20220520-092800
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git df98714e432abf5cbdac3e4c1a13f94c65ddb8d3
config: s390-buildonly-randconfig-r002-20220519 (https://download.01.org/0day-ci/archive/20220520/202205201422.84XYwlpY-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project e00cbbec06c08dc616a0d52a20f678b8fbd4e304)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/a42e940bc53c40ee4e33a1bbf022a663bb28a9c7
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Vinicius-Costa-Gomes/ethtool-Add-support-for-frame-preemption/20220520-092800
git checkout a42e940bc53c40ee4e33a1bbf022a663bb28a9c7
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash drivers/net/ethernet/intel/igc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/net/ethernet/intel/igc/igc_main.c:6:
In file included from include/linux/if_vlan.h:10:
In file included from include/linux/netdevice.h:38:
In file included from include/net/net_namespace.h:40:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
^
In file included from drivers/net/ethernet/intel/igc/igc_main.c:6:
In file included from include/linux/if_vlan.h:10:
In file included from include/linux/netdevice.h:38:
In file included from include/net/net_namespace.h:40:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
#define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
^
In file included from drivers/net/ethernet/intel/igc/igc_main.c:6:
In file included from include/linux/if_vlan.h:10:
In file included from include/linux/netdevice.h:38:
In file included from include/net/net_namespace.h:40:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/s390/include/asm/io.h:75:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> drivers/net/ethernet/intel/igc/igc_main.c:5919:6: warning: variable 'ring' is uninitialized when used here [-Wuninitialized]
if (ring->preemptible) {
^~~~
drivers/net/ethernet/intel/igc/igc_main.c:5914:23: note: initialize the variable 'ring' to silence this warning
struct igc_ring *ring;
^
= NULL
13 warnings generated.
vim +/ring +5919 drivers/net/ethernet/intel/igc/igc_main.c
5910
5911 static int igc_save_launchtime_params(struct igc_adapter *adapter, int queue,
5912 bool enable)
5913 {
5914 struct igc_ring *ring;
5915
5916 if (queue < 0 || queue >= adapter->num_tx_queues)
5917 return -EINVAL;
5918
> 5919 if (ring->preemptible) {
5920 netdev_err(adapter->netdev, "Cannot enable LaunchTime on a preemptible queue\n");
5921 return -EINVAL;
5922 }
5923
5924 ring = adapter->tx_ring[queue];
5925 ring->launchtime_enable = enable;
5926
5927 return 0;
5928 }
5929
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption
2022-05-20 1:15 [PATCH net-next v5 00/11] ethtool: Add support for frame preemption Vinicius Costa Gomes
@ 2022-05-20 1:15 ` Vinicius Costa Gomes
2022-05-20 6:11 ` kernel test robot
2022-05-20 11:06 ` Vladimir Oltean
0 siblings, 2 replies; 5+ messages in thread
From: Vinicius Costa Gomes @ 2022-05-20 1:15 UTC (permalink / raw)
To: netdev
Cc: Vinicius Costa Gomes, jhs, xiyou.wangcong, jiri, davem,
vladimir.oltean, po.liu, boon.leong.ong, intel-wired-lan
Frame Preemption and LaunchTime cannot be enabled on the same queue.
If that situation happens, emit an error to the user, and log the
error.
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
---
drivers/net/ethernet/intel/igc/igc_main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 69e96e9a3ec8..96ad00e33f4b 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -5916,6 +5916,11 @@ static int igc_save_launchtime_params(struct igc_adapter *adapter, int queue,
if (queue < 0 || queue >= adapter->num_tx_queues)
return -EINVAL;
+ if (ring->preemptible) {
+ netdev_err(adapter->netdev, "Cannot enable LaunchTime on a preemptible queue\n");
+ return -EINVAL;
+ }
+
ring = adapter->tx_ring[queue];
ring->launchtime_enable = enable;
--
2.35.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-24 8:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22 10:18 [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption kernel test robot
2022-05-24 8:26 ` kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2022-05-20 1:15 [PATCH net-next v5 00/11] ethtool: Add support for frame preemption Vinicius Costa Gomes
2022-05-20 1:15 ` [PATCH net-next v5 10/11] igc: Check incompatible configs for Frame Preemption Vinicius Costa Gomes
2022-05-20 6:11 ` kernel test robot
2022-05-20 11:06 ` Vladimir Oltean
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.