Re: [PATCH 3/3] staging: rtl8712: Use existing arc4 implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christophe,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/Christophe-JAILLET/staging-rtl8188eu-Use-existing-arc4-implementation/20210410-213656
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 32abcac8037da5dc570c22abf266cbb92eee9fc9
config: arm-randconfig-s032-20210410 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-279-g6d5d9b42-dirty
        # https://github.com/0day-ci/linux/commit/ea2709e5f53370e588967f79d2eb847555ea9d3b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Christophe-JAILLET/staging-rtl8188eu-Use-existing-arc4-implementation/20210410-213656
        git checkout ea2709e5f53370e588967f79d2eb847555ea9d3b
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/staging/rtl8712/rtl871x_security.c: In function 'r8712_wep_encrypt':
>> drivers/staging/rtl8712/rtl871x_security.c:147:1: warning: the frame size of 1072 bytes is larger than 1024 bytes [-Wframe-larger-than=]
     147 | }
         | ^
   drivers/staging/rtl8712/rtl871x_security.c: In function 'r8712_wep_decrypt':
   drivers/staging/rtl8712/rtl871x_security.c:182:1: warning: the frame size of 1056 bytes is larger than 1024 bytes [-Wframe-larger-than=]
     182 | }
         | ^
   drivers/staging/rtl8712/rtl871x_security.c: In function 'r8712_tkip_encrypt':
   drivers/staging/rtl8712/rtl871x_security.c:576:1: warning: the frame size of 1088 bytes is larger than 1024 bytes [-Wframe-larger-than=]
     576 | }
         | ^
   drivers/staging/rtl8712/rtl871x_security.c: In function 'r8712_tkip_decrypt':
   drivers/staging/rtl8712/rtl871x_security.c:631:1: warning: the frame size of 1072 bytes is larger than 1024 bytes [-Wframe-larger-than=]
     631 | }
         | ^


vim +147 drivers/staging/rtl8712/rtl871x_security.c

2865d42c78a912 Larry Finger        2010-08-20   88  
2865d42c78a912 Larry Finger        2010-08-20   89  /*
09b080f73a4191 Vijai Kumar K       2016-11-20   90   * Need to consider the fragment situation
2865d42c78a912 Larry Finger        2010-08-20   91   */
2865d42c78a912 Larry Finger        2010-08-20   92  void r8712_wep_encrypt(struct _adapter *padapter, u8 *pxmitframe)
2865d42c78a912 Larry Finger        2010-08-20   93  {	/* exclude ICV */
2865d42c78a912 Larry Finger        2010-08-20   94  	unsigned char	crc[4];
ea2709e5f53370 Christophe JAILLET  2021-04-10   95  	struct arc4_ctx  mycontext;
b78559b60518eb Martin Homuth       2017-12-19   96  	u32 curfragnum, length, keylength, pki;
2865d42c78a912 Larry Finger        2010-08-20   97  	u8 *pframe, *payload, *iv;    /*,*wepkey*/
2865d42c78a912 Larry Finger        2010-08-20   98  	u8 wepkey[16];
2865d42c78a912 Larry Finger        2010-08-20   99  	struct	pkt_attrib  *pattrib = &((struct xmit_frame *)
2865d42c78a912 Larry Finger        2010-08-20  100  				       pxmitframe)->attrib;
2865d42c78a912 Larry Finger        2010-08-20  101  	struct	security_priv *psecuritypriv = &padapter->securitypriv;
2865d42c78a912 Larry Finger        2010-08-20  102  	struct	xmit_priv *pxmitpriv = &padapter->xmitpriv;
2865d42c78a912 Larry Finger        2010-08-20  103  
2865d42c78a912 Larry Finger        2010-08-20  104  	if (((struct xmit_frame *)pxmitframe)->buf_addr == NULL)
2865d42c78a912 Larry Finger        2010-08-20  105  		return;
2865d42c78a912 Larry Finger        2010-08-20  106  	pframe = ((struct xmit_frame *)pxmitframe)->buf_addr + TXDESC_OFFSET;
2865d42c78a912 Larry Finger        2010-08-20  107  	/*start to encrypt each fragment*/
2865d42c78a912 Larry Finger        2010-08-20  108  	if ((pattrib->encrypt == _WEP40_) || (pattrib->encrypt == _WEP104_)) {
b78559b60518eb Martin Homuth       2017-12-19  109  		pki = psecuritypriv->PrivacyKeyIndex;
b78559b60518eb Martin Homuth       2017-12-19  110  		keylength = psecuritypriv->DefKeylen[pki];
2865d42c78a912 Larry Finger        2010-08-20  111  		for (curfragnum = 0; curfragnum < pattrib->nr_frags;
2865d42c78a912 Larry Finger        2010-08-20  112  		     curfragnum++) {
2865d42c78a912 Larry Finger        2010-08-20  113  			iv = pframe + pattrib->hdrlen;
2865d42c78a912 Larry Finger        2010-08-20  114  			memcpy(&wepkey[0], iv, 3);
2865d42c78a912 Larry Finger        2010-08-20  115  			memcpy(&wepkey[3], &psecuritypriv->DefKey[
2865d42c78a912 Larry Finger        2010-08-20  116  				psecuritypriv->PrivacyKeyIndex].skey[0],
2865d42c78a912 Larry Finger        2010-08-20  117  				keylength);
2865d42c78a912 Larry Finger        2010-08-20  118  			payload = pframe + pattrib->iv_len + pattrib->hdrlen;
2865d42c78a912 Larry Finger        2010-08-20  119  			if ((curfragnum + 1) == pattrib->nr_frags) {
b78559b60518eb Martin Homuth       2017-12-19  120  				length = pattrib->last_txcmdsz -
b78559b60518eb Martin Homuth       2017-12-19  121  					pattrib->hdrlen -
b78559b60518eb Martin Homuth       2017-12-19  122  					pattrib->iv_len -
2865d42c78a912 Larry Finger        2010-08-20  123  					pattrib->icv_len;
dd9161483f420c Jannik Becher       2016-12-20  124  				*((__le32 *)crc) = cpu_to_le32(getcrc32(
2865d42c78a912 Larry Finger        2010-08-20  125  						payload, length));
ea2709e5f53370 Christophe JAILLET  2021-04-10  126  				arc4_setkey(&mycontext, wepkey, 3 + keylength);
ea2709e5f53370 Christophe JAILLET  2021-04-10  127  				arc4_crypt(&mycontext, payload, payload,
2865d42c78a912 Larry Finger        2010-08-20  128  					   length);
ea2709e5f53370 Christophe JAILLET  2021-04-10  129  				arc4_crypt(&mycontext, payload + length,
2865d42c78a912 Larry Finger        2010-08-20  130  					   crc, 4);
2865d42c78a912 Larry Finger        2010-08-20  131  			} else {
4ef2de5ae0377b Luis de Bethencourt 2015-10-19  132  				length = pxmitpriv->frag_len -
4ef2de5ae0377b Luis de Bethencourt 2015-10-19  133  					 pattrib->hdrlen - pattrib->iv_len -
4ef2de5ae0377b Luis de Bethencourt 2015-10-19  134  					 pattrib->icv_len;
dd9161483f420c Jannik Becher       2016-12-20  135  				*((__le32 *)crc) = cpu_to_le32(getcrc32(
2865d42c78a912 Larry Finger        2010-08-20  136  						payload, length));
ea2709e5f53370 Christophe JAILLET  2021-04-10  137  				arc4_setkey(&mycontext, wepkey, 3 + keylength);
ea2709e5f53370 Christophe JAILLET  2021-04-10  138  				arc4_crypt(&mycontext, payload, payload,
2865d42c78a912 Larry Finger        2010-08-20  139  					   length);
ea2709e5f53370 Christophe JAILLET  2021-04-10  140  				arc4_crypt(&mycontext, payload + length,
2865d42c78a912 Larry Finger        2010-08-20  141  					   crc, 4);
2865d42c78a912 Larry Finger        2010-08-20  142  				pframe += pxmitpriv->frag_len;
2865d42c78a912 Larry Finger        2010-08-20  143  				pframe = (u8 *)RND4((addr_t)(pframe));
2865d42c78a912 Larry Finger        2010-08-20  144  			}
2865d42c78a912 Larry Finger        2010-08-20  145  		}
2865d42c78a912 Larry Finger        2010-08-20  146  	}
2865d42c78a912 Larry Finger        2010-08-20 @147  }
2865d42c78a912 Larry Finger        2010-08-20  148  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux