driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [staging:staging-next 201/268] drivers/staging/rtl8723bs/core/rtw_security.c:89:6: warning: stack frame size of 1120 bytes in function 'rtw_wep_encrypt'
@ 2021-05-20  9:03 kernel test robot
  2021-05-21 14:26 ` Fabio Aiuto
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-05-20  9:03 UTC (permalink / raw)
  To: Fabio Aiuto; +Cc: devel, clang-built-linux, kbuild-all, Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 17417 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next
head:   b9f38e913a926b455e5048a95f53a993b515509f
commit: 1b11e893eda0907fc9b28696271e2d9c4337e42d [201/268] staging: rtl8723bs: replace private arc4 encryption with in-kernel one
config: powerpc64-randconfig-r011-20210520 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project bf9ef3efaa99c02e7bfc4c57207301b8de39a278)
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 powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?id=1b11e893eda0907fc9b28696271e2d9c4337e42d
        git remote add staging https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
        git fetch --no-tags staging staging-next
        git checkout 1b11e893eda0907fc9b28696271e2d9c4337e42d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

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 >>):

   arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:126:1: note: expanded from here
   __do_insw
   ^
   arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
   #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:20:
   In file included from drivers/staging/rtl8723bs/include/osdep_service.h:15:
   In file included from drivers/staging/rtl8723bs/include/osdep_service_linux.h:19:
   In file included from include/linux/netdevice.h:37:
   In file included from include/net/net_namespace.h:38:
   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/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:128:1: note: expanded from here
   __do_insl
   ^
   arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
   #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:20:
   In file included from drivers/staging/rtl8723bs/include/osdep_service.h:15:
   In file included from drivers/staging/rtl8723bs/include/osdep_service_linux.h:19:
   In file included from include/linux/netdevice.h:37:
   In file included from include/net/net_namespace.h:38:
   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/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:130:1: note: expanded from here
   __do_outsb
   ^
   arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
   #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:20:
   In file included from drivers/staging/rtl8723bs/include/osdep_service.h:15:
   In file included from drivers/staging/rtl8723bs/include/osdep_service_linux.h:19:
   In file included from include/linux/netdevice.h:37:
   In file included from include/net/net_namespace.h:38:
   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/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:132:1: note: expanded from here
   __do_outsw
   ^
   arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
   #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from drivers/staging/rtl8723bs/core/rtw_security.c:8:
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:20:
   In file included from drivers/staging/rtl8723bs/include/osdep_service.h:15:
   In file included from drivers/staging/rtl8723bs/include/osdep_service_linux.h:19:
   In file included from include/linux/netdevice.h:37:
   In file included from include/net/net_namespace.h:38:
   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/powerpc/include/asm/io.h:619:
   arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:134:1: note: expanded from here
   __do_outsl
   ^
   arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
   #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
>> drivers/staging/rtl8723bs/core/rtw_security.c:89:6: warning: stack frame size of 1120 bytes in function 'rtw_wep_encrypt' [-Wframe-larger-than=]
   void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
        ^
>> drivers/staging/rtl8723bs/core/rtw_security.c:145:6: warning: stack frame size of 1088 bytes in function 'rtw_wep_decrypt' [-Wframe-larger-than=]
   void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
        ^
>> drivers/staging/rtl8723bs/core/rtw_security.c:514:5: warning: stack frame size of 1136 bytes in function 'rtw_tkip_encrypt' [-Wframe-larger-than=]
   u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
       ^
>> drivers/staging/rtl8723bs/core/rtw_security.c:586:5: warning: stack frame size of 1104 bytes in function 'rtw_tkip_decrypt' [-Wframe-larger-than=]
   u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
       ^
   10 warnings generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for MAC80211_LEDS
   Depends on NET && WIRELESS && MAC80211 && (LEDS_CLASS || LEDS_CLASS
   Selected by
   - CARL9170_LEDS && NETDEVICES && WLAN && WLAN_VENDOR_ATH && CARL9170


vim +/rtw_wep_encrypt +89 drivers/staging/rtl8723bs/core/rtw_security.c

554c0a3abf216c9 Hans de Goede 2017-03-29   84  
554c0a3abf216c9 Hans de Goede 2017-03-29   85  
554c0a3abf216c9 Hans de Goede 2017-03-29   86  /*
554c0a3abf216c9 Hans de Goede 2017-03-29   87  	Need to consider the fragment  situation
554c0a3abf216c9 Hans de Goede 2017-03-29   88  */
554c0a3abf216c9 Hans de Goede 2017-03-29  @89  void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
554c0a3abf216c9 Hans de Goede 2017-03-29   90  {																	/*  exclude ICV */
554c0a3abf216c9 Hans de Goede 2017-03-29   91  
554c0a3abf216c9 Hans de Goede 2017-03-29   92  	unsigned char crc[4];
1b11e893eda0907 Fabio Aiuto   2021-05-07   93  	struct arc4_ctx	mycontext;
554c0a3abf216c9 Hans de Goede 2017-03-29   94  
d495c5503d1339c Marco Cesati  2021-03-12   95  	signed int	curfragnum, length;
554c0a3abf216c9 Hans de Goede 2017-03-29   96  	u32 keylength;
554c0a3abf216c9 Hans de Goede 2017-03-29   97  
554c0a3abf216c9 Hans de Goede 2017-03-29   98  	u8 *pframe, *payload, *iv;    /* wepkey */
554c0a3abf216c9 Hans de Goede 2017-03-29   99  	u8 wepkey[16];
554c0a3abf216c9 Hans de Goede 2017-03-29  100  	u8 hw_hdr_offset = 0;
554c0a3abf216c9 Hans de Goede 2017-03-29  101  	struct pkt_attrib *pattrib = &((struct xmit_frame *)pxmitframe)->attrib;
554c0a3abf216c9 Hans de Goede 2017-03-29  102  	struct security_priv *psecuritypriv = &padapter->securitypriv;
554c0a3abf216c9 Hans de Goede 2017-03-29  103  	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
554c0a3abf216c9 Hans de Goede 2017-03-29  104  
554c0a3abf216c9 Hans de Goede 2017-03-29  105  	if (((struct xmit_frame *)pxmitframe)->buf_addr == NULL)
554c0a3abf216c9 Hans de Goede 2017-03-29  106  		return;
554c0a3abf216c9 Hans de Goede 2017-03-29  107  
554c0a3abf216c9 Hans de Goede 2017-03-29  108  	hw_hdr_offset = TXDESC_OFFSET;
554c0a3abf216c9 Hans de Goede 2017-03-29  109  	pframe = ((struct xmit_frame *)pxmitframe)->buf_addr + hw_hdr_offset;
554c0a3abf216c9 Hans de Goede 2017-03-29  110  
554c0a3abf216c9 Hans de Goede 2017-03-29  111  	/* start to encrypt each fragment */
554c0a3abf216c9 Hans de Goede 2017-03-29  112  	if ((pattrib->encrypt == _WEP40_) || (pattrib->encrypt == _WEP104_)) {
554c0a3abf216c9 Hans de Goede 2017-03-29  113  		keylength = psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyKeyIndex];
554c0a3abf216c9 Hans de Goede 2017-03-29  114  
554c0a3abf216c9 Hans de Goede 2017-03-29  115  		for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) {
554c0a3abf216c9 Hans de Goede 2017-03-29  116  			iv = pframe+pattrib->hdrlen;
554c0a3abf216c9 Hans de Goede 2017-03-29  117  			memcpy(&wepkey[0], iv, 3);
554c0a3abf216c9 Hans de Goede 2017-03-29  118  			memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength);
554c0a3abf216c9 Hans de Goede 2017-03-29  119  			payload = pframe+pattrib->iv_len+pattrib->hdrlen;
554c0a3abf216c9 Hans de Goede 2017-03-29  120  
554c0a3abf216c9 Hans de Goede 2017-03-29  121  			if ((curfragnum+1) == pattrib->nr_frags) {	/* the last fragment */
554c0a3abf216c9 Hans de Goede 2017-03-29  122  
554c0a3abf216c9 Hans de Goede 2017-03-29  123  				length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
554c0a3abf216c9 Hans de Goede 2017-03-29  124  
554c0a3abf216c9 Hans de Goede 2017-03-29  125  				*((__le32 *)crc) = getcrc32(payload, length);
554c0a3abf216c9 Hans de Goede 2017-03-29  126  
1b11e893eda0907 Fabio Aiuto   2021-05-07  127  				arc4_setkey(&mycontext, wepkey, 3 + keylength);
1b11e893eda0907 Fabio Aiuto   2021-05-07  128  				arc4_crypt(&mycontext, payload, payload, length);
1b11e893eda0907 Fabio Aiuto   2021-05-07  129  				arc4_crypt(&mycontext, payload + length, crc, 4);
554c0a3abf216c9 Hans de Goede 2017-03-29  130  
554c0a3abf216c9 Hans de Goede 2017-03-29  131  			} else {
554c0a3abf216c9 Hans de Goede 2017-03-29  132  				length = pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
554c0a3abf216c9 Hans de Goede 2017-03-29  133  				*((__le32 *)crc) = getcrc32(payload, length);
1b11e893eda0907 Fabio Aiuto   2021-05-07  134  				arc4_setkey(&mycontext, wepkey, 3 + keylength);
1b11e893eda0907 Fabio Aiuto   2021-05-07  135  				arc4_crypt(&mycontext, payload, payload, length);
1b11e893eda0907 Fabio Aiuto   2021-05-07  136  				arc4_crypt(&mycontext, payload + length, crc, 4);
554c0a3abf216c9 Hans de Goede 2017-03-29  137  
554c0a3abf216c9 Hans de Goede 2017-03-29  138  				pframe += pxmitpriv->frag_len;
87fe08d74ca66d8 Ross Schmidt  2020-10-03  139  				pframe = (u8 *)round_up((SIZE_PTR)(pframe), 4);
554c0a3abf216c9 Hans de Goede 2017-03-29  140  			}
554c0a3abf216c9 Hans de Goede 2017-03-29  141  		}
554c0a3abf216c9 Hans de Goede 2017-03-29  142  	}
554c0a3abf216c9 Hans de Goede 2017-03-29  143  }
554c0a3abf216c9 Hans de Goede 2017-03-29  144  
554c0a3abf216c9 Hans de Goede 2017-03-29 @145  void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
554c0a3abf216c9 Hans de Goede 2017-03-29  146  {
554c0a3abf216c9 Hans de Goede 2017-03-29  147  	/*  exclude ICV */
554c0a3abf216c9 Hans de Goede 2017-03-29  148  	u8 crc[4];
1b11e893eda0907 Fabio Aiuto   2021-05-07  149  	struct arc4_ctx	 mycontext;
d495c5503d1339c Marco Cesati  2021-03-12  150  	signed int	length;
554c0a3abf216c9 Hans de Goede 2017-03-29  151  	u32 keylength;
554c0a3abf216c9 Hans de Goede 2017-03-29  152  	u8 *pframe, *payload, *iv, wepkey[16];
554c0a3abf216c9 Hans de Goede 2017-03-29  153  	u8  keyindex;
554c0a3abf216c9 Hans de Goede 2017-03-29  154  	struct	rx_pkt_attrib	 *prxattrib = &(((union recv_frame *)precvframe)->u.hdr.attrib);
554c0a3abf216c9 Hans de Goede 2017-03-29  155  	struct	security_priv *psecuritypriv = &padapter->securitypriv;
554c0a3abf216c9 Hans de Goede 2017-03-29  156  
554c0a3abf216c9 Hans de Goede 2017-03-29  157  	pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
554c0a3abf216c9 Hans de Goede 2017-03-29  158  
554c0a3abf216c9 Hans de Goede 2017-03-29  159  	/* start to decrypt recvframe */
554c0a3abf216c9 Hans de Goede 2017-03-29  160  	if ((prxattrib->encrypt == _WEP40_) || (prxattrib->encrypt == _WEP104_)) {
554c0a3abf216c9 Hans de Goede 2017-03-29  161  		iv = pframe+prxattrib->hdrlen;
554c0a3abf216c9 Hans de Goede 2017-03-29  162  		/* keyindex =(iv[3]&0x3); */
554c0a3abf216c9 Hans de Goede 2017-03-29  163  		keyindex = prxattrib->key_index;
554c0a3abf216c9 Hans de Goede 2017-03-29  164  		keylength = psecuritypriv->dot11DefKeylen[keyindex];
554c0a3abf216c9 Hans de Goede 2017-03-29  165  		memcpy(&wepkey[0], iv, 3);
554c0a3abf216c9 Hans de Goede 2017-03-29  166  		/* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); */
554c0a3abf216c9 Hans de Goede 2017-03-29  167  		memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
554c0a3abf216c9 Hans de Goede 2017-03-29  168  		length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
554c0a3abf216c9 Hans de Goede 2017-03-29  169  
554c0a3abf216c9 Hans de Goede 2017-03-29  170  		payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;
554c0a3abf216c9 Hans de Goede 2017-03-29  171  
554c0a3abf216c9 Hans de Goede 2017-03-29  172  		/* decrypt payload include icv */
1b11e893eda0907 Fabio Aiuto   2021-05-07  173  		arc4_setkey(&mycontext, wepkey, 3 + keylength);
1b11e893eda0907 Fabio Aiuto   2021-05-07  174  		arc4_crypt(&mycontext, payload, payload,  length);
554c0a3abf216c9 Hans de Goede 2017-03-29  175  
554c0a3abf216c9 Hans de Goede 2017-03-29  176  		/* calculate icv and compare the icv */
554c0a3abf216c9 Hans de Goede 2017-03-29  177  		*((u32 *)crc) = le32_to_cpu(getcrc32(payload, length-4));
554c0a3abf216c9 Hans de Goede 2017-03-29  178  
554c0a3abf216c9 Hans de Goede 2017-03-29  179  	}
554c0a3abf216c9 Hans de Goede 2017-03-29  180  }
554c0a3abf216c9 Hans de Goede 2017-03-29  181  

:::::: The code at line 89 was first introduced by commit
:::::: 554c0a3abf216c991c5ebddcdb2c08689ecd290b staging: Add rtl8723bs sdio wifi driver

:::::: TO: Hans de Goede <hdegoede@redhat.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
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: 31095 bytes --]

[-- Attachment #3: Type: text/plain, Size: 169 bytes --]

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [staging:staging-next 201/268] drivers/staging/rtl8723bs/core/rtw_security.c:89:6: warning: stack frame size of 1120 bytes in function 'rtw_wep_encrypt'
  2021-05-20  9:03 [staging:staging-next 201/268] drivers/staging/rtl8723bs/core/rtw_security.c:89:6: warning: stack frame size of 1120 bytes in function 'rtw_wep_encrypt' kernel test robot
@ 2021-05-21 14:26 ` Fabio Aiuto
  2021-05-21 19:19   ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Aiuto @ 2021-05-21 14:26 UTC (permalink / raw)
  To: kernel test robot
  Cc: devel, clang-built-linux, kbuild-all, Greg Kroah-Hartman

Hi robot,

On Thu, May 20, 2021 at 05:03:14PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next
> head:   b9f38e913a926b455e5048a95f53a993b515509f
> commit: 1b11e893eda0907fc9b28696271e2d9c4337e42d [201/268] staging: rtl8723bs: replace private arc4 encryption with in-kernel one
> config: powerpc64-randconfig-r011-20210520 (attached as .config)
> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project bf9ef3efaa99c02e7bfc4c57207301b8de39a278)
> 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 powerpc64 cross compiling tool for clang build
>         # apt-get install binutils-powerpc64-linux-gnu
>         # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?id=1b11e893eda0907fc9b28696271e2d9c4337e42d
>         git remote add staging https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
>         git fetch --no-tags staging staging-next
>         git checkout 1b11e893eda0907fc9b28696271e2d9c4337e42d
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

can't compile this, I get the following error:

make CONFIG_OF_ALL_DTBS=y CONFIG_DTC=y HOSTCC=/home/fabio/0day/clang/bin/clang CC=/home/fabio/0day/clang/bin/clang LD=/home/fabio/0day/clang/bin/ld.lld HOSTLD=/home/fabio/0day/clang/bin/ld.lld AR=/home/fabio/0day/clang/bin/llvm-ar NM=/home/fabio/0day/clang/bin/llvm-nm STRIP=/home/fabio/0day/clang/bin/llvm-strip OBJDUMP=/home/fabio/0day/clang/bin/llvm-objdump OBJSIZE=/home/fabio/0day/clang/bin/llvm-size READELF=/home/fabio/0day/clang/bin/llvm-readelf HOSTCXX=/home/fabio/0day/clang/bin/clang++ HOSTAR=/home/fabio/0day/clang/bin/llvm-ar CROSS_COMPILE=powerpc-linux-gnu- --jobs=8 LLVM_IAS=1 ARCH=powerpc drivers/staging/rtl8723bs/
  CC      scripts/mod/empty.o
clang: error: unsupported argument '-me500' to option 'Wa,'
make[1]: *** [scripts/Makefile.build:272: scripts/mod/empty.o] Error 1
make[1]: *** Attesa per i processi non terminati....
make: *** [Makefile:1226: prepare0] Error 2

moreover I had to add LLVM_IAS=1, and ARCH=powerpc64 is not a valid architecture (used powerpc instead).

Could you help me?

thank you,

fabio
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [staging:staging-next 201/268] drivers/staging/rtl8723bs/core/rtw_security.c:89:6: warning: stack frame size of 1120 bytes in function 'rtw_wep_encrypt'
  2021-05-21 14:26 ` Fabio Aiuto
@ 2021-05-21 19:19   ` Nathan Chancellor
  2021-05-22  7:48     ` Fabio Aiuto
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2021-05-21 19:19 UTC (permalink / raw)
  To: Fabio Aiuto; +Cc: devel, clang-built-linux, kbuild-all, Greg Kroah-Hartman

Hi Fabio,

On Fri, May 21, 2021 at 04:26:57PM +0200, Fabio Aiuto wrote:
> Hi robot,
> 
> On Thu, May 20, 2021 at 05:03:14PM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next
> > head:   b9f38e913a926b455e5048a95f53a993b515509f
> > commit: 1b11e893eda0907fc9b28696271e2d9c4337e42d [201/268] staging: rtl8723bs: replace private arc4 encryption with in-kernel one
> > config: powerpc64-randconfig-r011-20210520 (attached as .config)
> > compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project bf9ef3efaa99c02e7bfc4c57207301b8de39a278)
> > 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 powerpc64 cross compiling tool for clang build
> >         # apt-get install binutils-powerpc64-linux-gnu
> >         # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?id=1b11e893eda0907fc9b28696271e2d9c4337e42d
> >         git remote add staging https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> >         git fetch --no-tags staging staging-next
> >         git checkout 1b11e893eda0907fc9b28696271e2d9c4337e42d
> >         # save the attached .config to linux build tree
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 
> 
> can't compile this, I get the following error:
> 
> make CONFIG_OF_ALL_DTBS=y CONFIG_DTC=y HOSTCC=/home/fabio/0day/clang/bin/clang CC=/home/fabio/0day/clang/bin/clang LD=/home/fabio/0day/clang/bin/ld.lld HOSTLD=/home/fabio/0day/clang/bin/ld.lld AR=/home/fabio/0day/clang/bin/llvm-ar NM=/home/fabio/0day/clang/bin/llvm-nm STRIP=/home/fabio/0day/clang/bin/llvm-strip OBJDUMP=/home/fabio/0day/clang/bin/llvm-objdump OBJSIZE=/home/fabio/0day/clang/bin/llvm-size READELF=/home/fabio/0day/clang/bin/llvm-readelf HOSTCXX=/home/fabio/0day/clang/bin/clang++ HOSTAR=/home/fabio/0day/clang/bin/llvm-ar CROSS_COMPILE=powerpc-linux-gnu- --jobs=8 LLVM_IAS=1 ARCH=powerpc drivers/staging/rtl8723bs/
>   CC      scripts/mod/empty.o
> clang: error: unsupported argument '-me500' to option 'Wa,'
> make[1]: *** [scripts/Makefile.build:272: scripts/mod/empty.o] Error 1
> make[1]: *** Attesa per i processi non terminati....
> make: *** [Makefile:1226: prepare0] Error 2
> 
> moreover I had to add LLVM_IAS=1, and ARCH=powerpc64 is not a valid architecture (used powerpc instead).
> 
> Could you help me?
> 

This is not a clang specific issue, I would not bother with trying to
use the bot's reproducer steps.

I can reproduce it with GCC 11.1.0 using the following commands:

$ make -skj"$(nproc)" ARCH=i386 defconfig

$ scripts/config -e MMC -e STAGING -m RTL8723BS

$ make -skj"$(nproc)" ARCH=i386 olddefconfig drivers/staging/rtl8723bs/
drivers/staging/rtl8723bs/core/rtw_security.c: In function ‘rtw_wep_encrypt’:
drivers/staging/rtl8723bs/core/rtw_security.c:91:1: warning: the frame size of 1084 bytes is larger than 1024 bytes [-Wframe-larger-than=]
   91 | }
      | ^
drivers/staging/rtl8723bs/core/rtw_security.c: In function ‘rtw_wep_decrypt’:
drivers/staging/rtl8723bs/core/rtw_security.c:128:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
  128 | }
      | ^
drivers/staging/rtl8723bs/core/rtw_security.c: In function ‘rtw_tkip_encrypt’:
drivers/staging/rtl8723bs/core/rtw_security.c:531:1: warning: the frame size of 1112 bytes is larger than 1024 bytes [-Wframe-larger-than=]
  531 | }
      | ^
drivers/staging/rtl8723bs/core/rtw_security.c: In function ‘rtw_tkip_decrypt’:
drivers/staging/rtl8723bs/core/rtw_security.c:633:1: warning: the frame size of 1084 bytes is larger than 1024 bytes [-Wframe-larger-than=]
  633 | }
      | ^

Your commit introduced this because the size of the arc4_ctx structure
is 1032 bytes so allocating it on the stack will cause it to go over the
32-bit limit of 1024 bytes. The previous arc4context was only 264 bytes.
For that large of structure, I would recommend allocating it on the heap
with kzalloc() and freeing with kfree_sensitive().

Cheers,
Nathan
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [staging:staging-next 201/268] drivers/staging/rtl8723bs/core/rtw_security.c:89:6: warning: stack frame size of 1120 bytes in function 'rtw_wep_encrypt'
  2021-05-21 19:19   ` Nathan Chancellor
@ 2021-05-22  7:48     ` Fabio Aiuto
  0 siblings, 0 replies; 4+ messages in thread
From: Fabio Aiuto @ 2021-05-22  7:48 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: devel, clang-built-linux, kbuild-all, Greg Kroah-Hartman

Hello Nathan,

On Fri, May 21, 2021 at 12:19:39PM -0700, Nathan Chancellor wrote:
> Hi Fabio,
> 
> On Fri, May 21, 2021 at 04:26:57PM +0200, Fabio Aiuto wrote:
> > Hi robot,
> > 
> > On Thu, May 20, 2021 at 05:03:14PM +0800, kernel test robot wrote:
> > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next
> > > head:   b9f38e913a926b455e5048a95f53a993b515509f
> > > commit: 1b11e893eda0907fc9b28696271e2d9c4337e42d [201/268] staging: rtl8723bs: replace private arc4 encryption with in-kernel one
> > > config: powerpc64-randconfig-r011-20210520 (attached as .config)
> > > compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project bf9ef3efaa99c02e7bfc4c57207301b8de39a278)
> > > 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 powerpc64 cross compiling tool for clang build
> > >         # apt-get install binutils-powerpc64-linux-gnu
> > >         # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/commit/?id=1b11e893eda0907fc9b28696271e2d9c4337e42d
> > >         git remote add staging https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> > >         git fetch --no-tags staging staging-next
> > >         git checkout 1b11e893eda0907fc9b28696271e2d9c4337e42d
> > >         # save the attached .config to linux build tree
> > >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 
> > 
> > can't compile this, I get the following error:
> > 
> > make CONFIG_OF_ALL_DTBS=y CONFIG_DTC=y HOSTCC=/home/fabio/0day/clang/bin/clang CC=/home/fabio/0day/clang/bin/clang LD=/home/fabio/0day/clang/bin/ld.lld HOSTLD=/home/fabio/0day/clang/bin/ld.lld AR=/home/fabio/0day/clang/bin/llvm-ar NM=/home/fabio/0day/clang/bin/llvm-nm STRIP=/home/fabio/0day/clang/bin/llvm-strip OBJDUMP=/home/fabio/0day/clang/bin/llvm-objdump OBJSIZE=/home/fabio/0day/clang/bin/llvm-size READELF=/home/fabio/0day/clang/bin/llvm-readelf HOSTCXX=/home/fabio/0day/clang/bin/clang++ HOSTAR=/home/fabio/0day/clang/bin/llvm-ar CROSS_COMPILE=powerpc-linux-gnu- --jobs=8 LLVM_IAS=1 ARCH=powerpc drivers/staging/rtl8723bs/
> >   CC      scripts/mod/empty.o
> > clang: error: unsupported argument '-me500' to option 'Wa,'
> > make[1]: *** [scripts/Makefile.build:272: scripts/mod/empty.o] Error 1
> > make[1]: *** Attesa per i processi non terminati....
> > make: *** [Makefile:1226: prepare0] Error 2
> > 
> > moreover I had to add LLVM_IAS=1, and ARCH=powerpc64 is not a valid architecture (used powerpc instead).
> > 
> > Could you help me?
> > 
> 
> This is not a clang specific issue, I would not bother with trying to
> use the bot's reproducer steps.
> 
> I can reproduce it with GCC 11.1.0 using the following commands:
> 
> $ make -skj"$(nproc)" ARCH=i386 defconfig
> 
> $ scripts/config -e MMC -e STAGING -m RTL8723BS
> 
> $ make -skj"$(nproc)" ARCH=i386 olddefconfig drivers/staging/rtl8723bs/
> drivers/staging/rtl8723bs/core/rtw_security.c: In function ‘rtw_wep_encrypt’:
> drivers/staging/rtl8723bs/core/rtw_security.c:91:1: warning: the frame size of 1084 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>    91 | }
>       | ^
> drivers/staging/rtl8723bs/core/rtw_security.c: In function ‘rtw_wep_decrypt’:
> drivers/staging/rtl8723bs/core/rtw_security.c:128:1: warning: the frame size of 1060 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>   128 | }
>       | ^
> drivers/staging/rtl8723bs/core/rtw_security.c: In function ‘rtw_tkip_encrypt’:
> drivers/staging/rtl8723bs/core/rtw_security.c:531:1: warning: the frame size of 1112 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>   531 | }
>       | ^
> drivers/staging/rtl8723bs/core/rtw_security.c: In function ‘rtw_tkip_decrypt’:
> drivers/staging/rtl8723bs/core/rtw_security.c:633:1: warning: the frame size of 1084 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>   633 | }
>       | ^

I could not get these warnings in a x86_64 build, so I tried
to reproduce exactly what the robot says. I should have tried
simply an i386 build :)

> 
> Your commit introduced this because the size of the arc4_ctx structure
> is 1032 bytes so allocating it on the stack will cause it to go over the
> 32-bit limit of 1024 bytes. The previous arc4context was only 264 bytes.
> For that large of structure, I would recommend allocating it on the heap
> with kzalloc() and freeing with kfree_sensitive().

I have already I fixed it by putting two arc4_ctx field in security_priv struct without
locally allocating each time encryption-decryption functions are called.
Hope this is good...

> 
> Cheers,
> Nathan

thank you for help,

fabio
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-22  7:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20  9:03 [staging:staging-next 201/268] drivers/staging/rtl8723bs/core/rtw_security.c:89:6: warning: stack frame size of 1120 bytes in function 'rtw_wep_encrypt' kernel test robot
2021-05-21 14:26 ` Fabio Aiuto
2021-05-21 19:19   ` Nathan Chancellor
2021-05-22  7:48     ` Fabio Aiuto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).