lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202206121811.nCGepk59-lkp@intel.com>
Date:   Sun, 12 Jun 2022 19:04:23 +0800
From:   kernel test robot <lkp@...el.com>
To:     Felix Fietkau <nbd@....name>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/net/ethernet/mediatek/mtk_ppe.c:572:18: warning: array
 subscript 'struct mtk_flow_entry[0]' is partly outside array bounds of
 'unsigned char[24]'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7a68065eb9cd194cf03f135c9211eeb2d5c4c0a0
commit: 33fc42de33278b2b3ec6f3390512987bc29a62b7 net: ethernet: mtk_eth_soc: support creating mac address based offload entries
date:   10 weeks ago
config: mips-randconfig-r024-20220612 (https://download.01.org/0day-ci/archive/20220612/202206121811.nCGepk59-lkp@intel.com/config)
compiler: mipsel-linux-gcc (GCC) 11.3.0
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=33fc42de33278b2b3ec6f3390512987bc29a62b7
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 33fc42de33278b2b3ec6f3390512987bc29a62b7
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/net/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   {standard input}: Assembler messages:
   {standard input}:25: Error: found '(', expected: ')'
   {standard input}:25: Error: found '(', expected: ')'
   {standard input}:25: Error: non-constant expression in ".if" statement
   {standard input}:25: Error: junk at end of line, first unrecognized character is `('
   {standard input}:49: Error: found '(', expected: ')'
   {standard input}:49: Error: found '(', expected: ')'
   {standard input}:49: Error: non-constant expression in ".if" statement
   {standard input}:49: Error: junk at end of line, first unrecognized character is `('
   {standard input}:73: Error: found '(', expected: ')'
   {standard input}:73: Error: found '(', expected: ')'
   {standard input}:73: Error: non-constant expression in ".if" statement
   {standard input}:73: Error: junk at end of line, first unrecognized character is `('
   drivers/net/ethernet/mediatek/mtk_ppe.c: In function 'mtk_foe_entry_commit_subflow':
>> drivers/net/ethernet/mediatek/mtk_ppe.c:572:18: warning: array subscript 'struct mtk_flow_entry[0]' is partly outside array bounds of 'unsigned char[24]' [-Warray-bounds]
     572 |         flow_info->l2_data.base_flow = entry;
         |                  ^~
   drivers/net/ethernet/mediatek/mtk_ppe.c:567:21: note: referencing an object of size 24 allocated by 'kzalloc.constprop'
     567 |         flow_info = kzalloc(offsetof(struct mtk_flow_entry, l2_data.end),
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     568 |                             GFP_ATOMIC);
         |                             ~~~~~~~~~~~
   drivers/net/ethernet/mediatek/mtk_ppe.c:573:18: warning: array subscript 'struct mtk_flow_entry[0]' is partly outside array bounds of 'unsigned char[24]' [-Warray-bounds]
     573 |         flow_info->type = MTK_FLOW_TYPE_L2_SUBFLOW;
         |                  ^~
   drivers/net/ethernet/mediatek/mtk_ppe.c:567:21: note: referencing an object of size 24 allocated by 'kzalloc.constprop'
     567 |         flow_info = kzalloc(offsetof(struct mtk_flow_entry, l2_data.end),
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     568 |                             GFP_ATOMIC);
         |                             ~~~~~~~~~~~
   drivers/net/ethernet/mediatek/mtk_ppe.c:574:18: warning: array subscript 'struct mtk_flow_entry[0]' is partly outside array bounds of 'unsigned char[24]' [-Warray-bounds]
     574 |         flow_info->hash = hash;
         |                  ^~
   drivers/net/ethernet/mediatek/mtk_ppe.c:567:21: note: referencing an object of size 24 allocated by 'kzalloc.constprop'
     567 |         flow_info = kzalloc(offsetof(struct mtk_flow_entry, l2_data.end),
         |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     568 |                             GFP_ATOMIC);
         |                             ~~~~~~~~~~~
   {standard input}:2572: Error: found '(', expected: ')'
   {standard input}:2572: Error: found '(', expected: ')'
   {standard input}:2572: Error: non-constant expression in ".if" statement
   {standard input}:2572: Error: junk at end of line, first unrecognized character is `('
   {standard input}:5006: Error: found '(', expected: ')'
   {standard input}:5006: Error: found '(', expected: ')'
   {standard input}:5006: Error: non-constant expression in ".if" statement
   {standard input}:5006: Error: junk at end of line, first unrecognized character is `('
   {standard input}:5567: Error: found '(', expected: ')'
   {standard input}:5567: Error: found '(', expected: ')'
   {standard input}:5567: Error: non-constant expression in ".if" statement
   {standard input}:5567: Error: junk at end of line, first unrecognized character is `('
   {standard input}:7090: Error: found '(', expected: ')'
   {standard input}:7090: Error: found '(', expected: ')'
   {standard input}:7090: Error: non-constant expression in ".if" statement
   {standard input}:7090: Error: junk at end of line, first unrecognized character is `('


vim +572 drivers/net/ethernet/mediatek/mtk_ppe.c

   556	
   557	static void
   558	mtk_foe_entry_commit_subflow(struct mtk_ppe *ppe, struct mtk_flow_entry *entry,
   559				     u16 hash)
   560	{
   561		struct mtk_flow_entry *flow_info;
   562		struct mtk_foe_entry foe, *hwe;
   563		struct mtk_foe_mac_info *l2;
   564		u32 ib1_mask = MTK_FOE_IB1_PACKET_TYPE | MTK_FOE_IB1_UDP;
   565		int type;
   566	
   567		flow_info = kzalloc(offsetof(struct mtk_flow_entry, l2_data.end),
   568				    GFP_ATOMIC);
   569		if (!flow_info)
   570			return;
   571	
 > 572		flow_info->l2_data.base_flow = entry;
   573		flow_info->type = MTK_FLOW_TYPE_L2_SUBFLOW;
   574		flow_info->hash = hash;
   575		hlist_add_head(&flow_info->list, &ppe->foe_flow[hash / 2]);
   576		hlist_add_head(&flow_info->l2_data.list, &entry->l2_flows);
   577	
   578		hwe = &ppe->foe_table[hash];
   579		memcpy(&foe, hwe, sizeof(foe));
   580		foe.ib1 &= ib1_mask;
   581		foe.ib1 |= entry->data.ib1 & ~ib1_mask;
   582	
   583		l2 = mtk_foe_entry_l2(&foe);
   584		memcpy(l2, &entry->data.bridge.l2, sizeof(*l2));
   585	
   586		type = FIELD_GET(MTK_FOE_IB1_PACKET_TYPE, foe.ib1);
   587		if (type == MTK_PPE_PKT_TYPE_IPV4_HNAPT)
   588			memcpy(&foe.ipv4.new, &foe.ipv4.orig, sizeof(foe.ipv4.new));
   589		else if (type >= MTK_PPE_PKT_TYPE_IPV6_ROUTE_3T && l2->etype == ETH_P_IP)
   590			l2->etype = ETH_P_IPV6;
   591	
   592		*mtk_foe_entry_ib2(&foe) = entry->data.bridge.ib2;
   593	
   594		__mtk_foe_entry_commit(ppe, &foe, hash);
   595	}
   596	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ