All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used
@ 2021-06-19 10:26 kernel test robot
  2021-06-20 19:50 ` Jhih Ming Huang
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2021-06-19 10:26 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/0day-ci/linux/commits/UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056
head:   ed0359e3fa64928e48021387a694f211bc840ff7
commit: ed0359e3fa64928e48021387a694f211bc840ff7 rtw_security: fix cast to restricted __le32
date:   3 hours ago
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.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://github.com/0day-ci/linux/commit/ed0359e3fa64928e48021387a694f211bc840ff7
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056
        git checkout ed0359e3fa64928e48021387a694f211bc840ff7
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh 

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

   drivers/staging/rtl8723bs/core/rtw_security.c: In function 'rtw_wep_decrypt':
>> drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used [-Wunused-but-set-variable]
      95 |  __le32 crc;
         |         ^~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
   Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
   Selected by
   - SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
   - SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC


vim +/crc +95 drivers/staging/rtl8723bs/core/rtw_security.c

    91	
    92	void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
    93	{
    94		/*  exclude ICV */
  > 95		__le32 crc;
    96		signed int	length;
    97		u32 keylength;
    98		u8 *pframe, *payload, *iv, wepkey[16];
    99		u8  keyindex;
   100		struct	rx_pkt_attrib	 *prxattrib = &(((union recv_frame *)precvframe)->u.hdr.attrib);
   101		struct	security_priv *psecuritypriv = &padapter->securitypriv;
   102		struct arc4_ctx *ctx = &psecuritypriv->recv_arc4_ctx;
   103	
   104		pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
   105	
   106		/* start to decrypt recvframe */
   107		if ((prxattrib->encrypt == _WEP40_) || (prxattrib->encrypt == _WEP104_)) {
   108			iv = pframe+prxattrib->hdrlen;
   109			/* keyindex =(iv[3]&0x3); */
   110			keyindex = prxattrib->key_index;
   111			keylength = psecuritypriv->dot11DefKeylen[keyindex];
   112			memcpy(&wepkey[0], iv, 3);
   113			/* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); */
   114			memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
   115			length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
   116	
   117			payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;
   118	
   119			/* decrypt payload include icv */
   120			arc4_setkey(ctx, wepkey, 3 + keylength);
   121			arc4_crypt(ctx, payload, payload,  length);
   122	
   123			/* calculate icv and compare the icv */
   124			crc = cpu_to_le32(~crc32_le(~0, payload, length - 4));
   125	
   126		}
   127	}
   128	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 54837 bytes --]

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

* Re: drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used
  2021-06-19 10:26 drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used kernel test robot
@ 2021-06-20 19:50 ` Jhih Ming Huang
  2021-06-21  0:18   ` Rong Chen
  0 siblings, 1 reply; 5+ messages in thread
From: Jhih Ming Huang @ 2021-06-20 19:50 UTC (permalink / raw)
  To: kbuild-all

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

On Sat, Jun 19, 2021 at 6:27 PM kernel test robot <lkp@intel.com> wrote:
>
> tree:   https://github.com/0day-ci/linux/commits/UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056
> head:   ed0359e3fa64928e48021387a694f211bc840ff7
> commit: ed0359e3fa64928e48021387a694f211bc840ff7 rtw_security: fix cast to restricted __le32
> date:   3 hours ago
> config: sh-allmodconfig (attached as .config)
> compiler: sh4-linux-gcc (GCC) 9.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://github.com/0day-ci/linux/commit/ed0359e3fa64928e48021387a694f211bc840ff7
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056
>         git checkout ed0359e3fa64928e48021387a694f211bc840ff7
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
>
> 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 >>):
>
>    drivers/staging/rtl8723bs/core/rtw_security.c: In function 'rtw_wep_decrypt':
> >> drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used [-Wunused-but-set-variable]
>       95 |  __le32 crc;
>          |         ^~~
>
> Kconfig warnings: (for reference only)
>    WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
>    Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
>    Selected by
>    - SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
>    - SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC
>
>
> vim +/crc +95 drivers/staging/rtl8723bs/core/rtw_security.c
>
>     91
>     92  void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
>     93  {
>     94          /*  exclude ICV */
>   > 95          __le32 crc;
>     96          signed int      length;
>     97          u32 keylength;
>     98          u8 *pframe, *payload, *iv, wepkey[16];
>     99          u8  keyindex;
>    100          struct  rx_pkt_attrib    *prxattrib = &(((union recv_frame *)precvframe)->u.hdr.attrib);
>    101          struct  security_priv *psecuritypriv = &padapter->securitypriv;
>    102          struct arc4_ctx *ctx = &psecuritypriv->recv_arc4_ctx;
>    103
>    104          pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
>    105
>    106          /* start to decrypt recvframe */
>    107          if ((prxattrib->encrypt == _WEP40_) || (prxattrib->encrypt == _WEP104_)) {
>    108                  iv = pframe+prxattrib->hdrlen;
>    109                  /* keyindex =(iv[3]&0x3); */
>    110                  keyindex = prxattrib->key_index;
>    111                  keylength = psecuritypriv->dot11DefKeylen[keyindex];
>    112                  memcpy(&wepkey[0], iv, 3);
>    113                  /* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); */
>    114                  memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
>    115                  length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
>    116
>    117                  payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;
>    118
>    119                  /* decrypt payload include icv */
>    120                  arc4_setkey(ctx, wepkey, 3 + keylength);
>    121                  arc4_crypt(ctx, payload, payload,  length);
>    122
>    123                  /* calculate icv and compare the icv */
>    124                  crc = cpu_to_le32(~crc32_le(~0, payload, length - 4));
>    125
>    126          }
>    127  }
>    128
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

This warning was introduced by my pull request,
but I am fixing the sparse warning and the unused variable was
declared in the previous commit.
The original author did not compare the crc and payload in
rtw_wep_decrypt, so the variable 'crc' was set but not used.

Should I fix this in my pull request?
BTW, in the following message, it mentioned *If you fix the issue,
kindly add following tag as appropriate*,
What's the meaning of the _tag_?

thanks.

--jmhuang

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

* Re: drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used
  2021-06-20 19:50 ` Jhih Ming Huang
@ 2021-06-21  0:18   ` Rong Chen
  2021-06-21  6:25     ` Jhih-Ming Huang
  0 siblings, 1 reply; 5+ messages in thread
From: Rong Chen @ 2021-06-21  0:18 UTC (permalink / raw)
  To: kbuild-all

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



On 6/21/21 3:50 AM, Jhih Ming Huang wrote:
> On Sat, Jun 19, 2021 at 6:27 PM kernel test robot <lkp@intel.com> wrote:
>> tree:   https://github.com/0day-ci/linux/commits/UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056
>> head:   ed0359e3fa64928e48021387a694f211bc840ff7
>> commit: ed0359e3fa64928e48021387a694f211bc840ff7 rtw_security: fix cast to restricted __le32
>> date:   3 hours ago
>> config: sh-allmodconfig (attached as .config)
>> compiler: sh4-linux-gcc (GCC) 9.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://github.com/0day-ci/linux/commit/ed0359e3fa64928e48021387a694f211bc840ff7
>>          git remote add linux-review https://github.com/0day-ci/linux
>>          git fetch --no-tags linux-review UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056
>>          git checkout ed0359e3fa64928e48021387a694f211bc840ff7
>>          # save the attached .config to linux build tree
>>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
>>
>> 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 >>):
>>
>>     drivers/staging/rtl8723bs/core/rtw_security.c: In function 'rtw_wep_decrypt':
>>>> drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used [-Wunused-but-set-variable]
>>        95 |  __le32 crc;
>>           |         ^~~
>>
>> Kconfig warnings: (for reference only)
>>     WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
>>     Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
>>     Selected by
>>     - SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
>>     - SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC
>>
>>
>> vim +/crc +95 drivers/staging/rtl8723bs/core/rtw_security.c
>>
>>      91
>>      92  void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
>>      93  {
>>      94          /*  exclude ICV */
>>    > 95          __le32 crc;
>>      96          signed int      length;
>>      97          u32 keylength;
>>      98          u8 *pframe, *payload, *iv, wepkey[16];
>>      99          u8  keyindex;
>>     100          struct  rx_pkt_attrib    *prxattrib = &(((union recv_frame *)precvframe)->u.hdr.attrib);
>>     101          struct  security_priv *psecuritypriv = &padapter->securitypriv;
>>     102          struct arc4_ctx *ctx = &psecuritypriv->recv_arc4_ctx;
>>     103
>>     104          pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
>>     105
>>     106          /* start to decrypt recvframe */
>>     107          if ((prxattrib->encrypt == _WEP40_) || (prxattrib->encrypt == _WEP104_)) {
>>     108                  iv = pframe+prxattrib->hdrlen;
>>     109                  /* keyindex =(iv[3]&0x3); */
>>     110                  keyindex = prxattrib->key_index;
>>     111                  keylength = psecuritypriv->dot11DefKeylen[keyindex];
>>     112                  memcpy(&wepkey[0], iv, 3);
>>     113                  /* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); */
>>     114                  memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
>>     115                  length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
>>     116
>>     117                  payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;
>>     118
>>     119                  /* decrypt payload include icv */
>>     120                  arc4_setkey(ctx, wepkey, 3 + keylength);
>>     121                  arc4_crypt(ctx, payload, payload,  length);
>>     122
>>     123                  /* calculate icv and compare the icv */
>>     124                  crc = cpu_to_le32(~crc32_le(~0, payload, length - 4));
>>     125
>>     126          }
>>     127  }
>>     128
>>
>> ---
>> 0-DAY CI Kernel Test Service, Intel Corporation
>> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
> This warning was introduced by my pull request,
> but I am fixing the sparse warning and the unused variable was
> declared in the previous commit.
> The original author did not compare the crc and payload in
> rtw_wep_decrypt, so the variable 'crc' was set but not used.
>
> Should I fix this in my pull request?
> BTW, in the following message, it mentioned *If you fix the issue,
> kindly add following tag as appropriate*,
> What's the meaning of the _tag_?

Hi jmhuang,

It means you can add 'Reported-by' tag in a fix commit, but
you can ignore it if you fix it in the original patch.

Best Regards,
Rong Chen

>
> thanks.
>
> --jmhuang
> _______________________________________________
> kbuild-all mailing list -- kbuild-all(a)lists.01.org
> To unsubscribe send an email to kbuild-all-leave(a)lists.01.org

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

* Re: drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used
  2021-06-21  0:18   ` Rong Chen
@ 2021-06-21  6:25     ` Jhih-Ming Huang
  0 siblings, 0 replies; 5+ messages in thread
From: Jhih-Ming Huang @ 2021-06-21  6:25 UTC (permalink / raw)
  To: kbuild-all

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

On Mon, Jun 21, 2021 at 08:18:46AM +0800, Rong Chen wrote:
> 
> 
> On 6/21/21 3:50 AM, Jhih Ming Huang wrote:
> > On Sat, Jun 19, 2021 at 6:27 PM kernel test robot <lkp@intel.com> wrote:
> > > tree:   https://github.com/0day-ci/linux/commits/UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056
> > > head:   ed0359e3fa64928e48021387a694f211bc840ff7
> > > commit: ed0359e3fa64928e48021387a694f211bc840ff7 rtw_security: fix cast to restricted __le32
> > > date:   3 hours ago
> > > config: sh-allmodconfig (attached as .config)
> > > compiler: sh4-linux-gcc (GCC) 9.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://github.com/0day-ci/linux/commit/ed0359e3fa64928e48021387a694f211bc840ff7
> > >          git remote add linux-review https://github.com/0day-ci/linux
> > >          git fetch --no-tags linux-review UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056
> > >          git checkout ed0359e3fa64928e48021387a694f211bc840ff7
> > >          # save the attached .config to linux build tree
> > >          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
> > > 
> > > 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 >>):
> > > 
> > >     drivers/staging/rtl8723bs/core/rtw_security.c: In function 'rtw_wep_decrypt':
> > > > > drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used [-Wunused-but-set-variable]
> > >        95 |  __le32 crc;
> > >           |         ^~~
> > > 
> > > Kconfig warnings: (for reference only)
> > >     WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
> > >     Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
> > >     Selected by
> > >     - SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
> > >     - SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC
> > > 
> > > 
> > > vim +/crc +95 drivers/staging/rtl8723bs/core/rtw_security.c
> > > 
> > >      91
> > >      92  void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
> > >      93  {
> > >      94          /*  exclude ICV */
> > >    > 95          __le32 crc;
> > >      96          signed int      length;
> > >      97          u32 keylength;
> > >      98          u8 *pframe, *payload, *iv, wepkey[16];
> > >      99          u8  keyindex;
> > >     100          struct  rx_pkt_attrib    *prxattrib = &(((union recv_frame *)precvframe)->u.hdr.attrib);
> > >     101          struct  security_priv *psecuritypriv = &padapter->securitypriv;
> > >     102          struct arc4_ctx *ctx = &psecuritypriv->recv_arc4_ctx;
> > >     103
> > >     104          pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
> > >     105
> > >     106          /* start to decrypt recvframe */
> > >     107          if ((prxattrib->encrypt == _WEP40_) || (prxattrib->encrypt == _WEP104_)) {
> > >     108                  iv = pframe+prxattrib->hdrlen;
> > >     109                  /* keyindex =(iv[3]&0x3); */
> > >     110                  keyindex = prxattrib->key_index;
> > >     111                  keylength = psecuritypriv->dot11DefKeylen[keyindex];
> > >     112                  memcpy(&wepkey[0], iv, 3);
> > >     113                  /* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); */
> > >     114                  memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
> > >     115                  length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
> > >     116
> > >     117                  payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;
> > >     118
> > >     119                  /* decrypt payload include icv */
> > >     120                  arc4_setkey(ctx, wepkey, 3 + keylength);
> > >     121                  arc4_crypt(ctx, payload, payload,  length);
> > >     122
> > >     123                  /* calculate icv and compare the icv */
> > >     124                  crc = cpu_to_le32(~crc32_le(~0, payload, length - 4));
> > >     125
> > >     126          }
> > >     127  }
> > >     128
> > > 
> > > ---
> > > 0-DAY CI Kernel Test Service, Intel Corporation
> > > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
> > This warning was introduced by my pull request,
> > but I am fixing the sparse warning and the unused variable was
> > declared in the previous commit.
> > The original author did not compare the crc and payload in
> > rtw_wep_decrypt, so the variable 'crc' was set but not used.
> > 
> > Should I fix this in my pull request?
> > BTW, in the following message, it mentioned *If you fix the issue,
> > kindly add following tag as appropriate*,
> > What's the meaning of the _tag_?
> 
> Hi jmhuang,
> 
> It means you can add 'Reported-by' tag in a fix commit, but
> you can ignore it if you fix it in the original patch.
> 
> Best Regards,
> Rong Chen
> 

Hi Rong,

Got it.
Thanks for your explanation. 

--jmhuang
> > 
> > thanks.
> > 
> > --jmhuang
> > _______________________________________________
> > kbuild-all mailing list -- kbuild-all(a)lists.01.org
> > To unsubscribe send an email to kbuild-all-leave(a)lists.01.org
> 

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

* drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used
@ 2021-06-21 13:55 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2021-06-21 13:55 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/0day-ci/linux/commits/UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056
head:   ed0359e3fa64928e48021387a694f211bc840ff7
commit: ed0359e3fa64928e48021387a694f211bc840ff7 rtw_security: fix cast to restricted __le32
date:   2 days ago
config: x86_64-randconfig-a013-20210621 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project e1adf90826a57b674eee79b071fb46c1f5683cd0)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/ed0359e3fa64928e48021387a694f211bc840ff7
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review UPDATE-20210619-155350/Jhih-Ming-Huang/rtw_security-fix-cast-to-restricted-__le32/20210616-131056
        git checkout ed0359e3fa64928e48021387a694f211bc840ff7
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

>> drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used [-Wunused-but-set-variable]
           __le32 crc;
                  ^
   1 warning generated.


vim +/crc +95 drivers/staging/rtl8723bs/core/rtw_security.c

    91	
    92	void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
    93	{
    94		/*  exclude ICV */
  > 95		__le32 crc;
    96		signed int	length;
    97		u32 keylength;
    98		u8 *pframe, *payload, *iv, wepkey[16];
    99		u8  keyindex;
   100		struct	rx_pkt_attrib	 *prxattrib = &(((union recv_frame *)precvframe)->u.hdr.attrib);
   101		struct	security_priv *psecuritypriv = &padapter->securitypriv;
   102		struct arc4_ctx *ctx = &psecuritypriv->recv_arc4_ctx;
   103	
   104		pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
   105	
   106		/* start to decrypt recvframe */
   107		if ((prxattrib->encrypt == _WEP40_) || (prxattrib->encrypt == _WEP104_)) {
   108			iv = pframe+prxattrib->hdrlen;
   109			/* keyindex =(iv[3]&0x3); */
   110			keyindex = prxattrib->key_index;
   111			keylength = psecuritypriv->dot11DefKeylen[keyindex];
   112			memcpy(&wepkey[0], iv, 3);
   113			/* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); */
   114			memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
   115			length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;
   116	
   117			payload = pframe+prxattrib->iv_len+prxattrib->hdrlen;
   118	
   119			/* decrypt payload include icv */
   120			arc4_setkey(ctx, wepkey, 3 + keylength);
   121			arc4_crypt(ctx, payload, payload,  length);
   122	
   123			/* calculate icv and compare the icv */
   124			crc = cpu_to_le32(~crc32_le(~0, payload, length - 4));
   125	
   126		}
   127	}
   128	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 43452 bytes --]

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

end of thread, other threads:[~2021-06-21 13:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-19 10:26 drivers/staging/rtl8723bs/core/rtw_security.c:95:9: warning: variable 'crc' set but not used kernel test robot
2021-06-20 19:50 ` Jhih Ming Huang
2021-06-21  0:18   ` Rong Chen
2021-06-21  6:25     ` Jhih-Ming Huang
2021-06-21 13:55 kernel test robot

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.