CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Corentin Labbe <[email protected]>
CC: Herbert Xu <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   2b14864acbaaf03d9c01982e243a84632524c3ac
commit: 46c5338db7bd45b2cf99570560f00389d60fd6b4 crypto: sl3516 - Add sl3516 
crypto engine
date:   6 months ago
:::::: branch date: 29 hours ago
:::::: commit date: 6 months ago
config: arm-randconfig-c002-20211209 
(https://download.01.org/0day-ci/archive/20211217/[email protected]/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=46c5338db7bd45b2cf99570560f00389d60fd6b4
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 46c5338db7bd45b2cf99570560f00389d60fd6b4
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   2 warnings generated.
   Suppressed 2 warnings (2 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   10 warnings generated.
   drivers/rtc/rtc-s5m.c:491:2: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
           ret = s5m_check_peding_alarm_interrupt(info, alrm);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/rtc/rtc-s5m.c:491:2: note: Value stored to 'ret' is never read
           ret = s5m_check_peding_alarm_interrupt(info, alrm);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   11 warnings generated.
   fs/btrfs/extent_map.c:615:3: warning: Value stored to 'ret' is never read 
[clang-analyzer-deadcode.DeadStores]
                   ret = 0;
                   ^     ~
   fs/btrfs/extent_map.c:615:3: note: Value stored to 'ret' is never read
                   ret = 0;
                   ^     ~
   Suppressed 10 warnings (10 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.
   11 warnings generated.
   crypto/asymmetric_keys/public_key.c:91:3: warning: Call to function 'strcpy' 
is insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
                   strcpy(alg_name, pkey->pkey_algo);
                   ^~~~~~
   crypto/asymmetric_keys/public_key.c:91:3: note: Call to function 'strcpy' is 
insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcpy'. CWE-119
                   strcpy(alg_name, pkey->pkey_algo);
                   ^~~~~~
   Suppressed 10 warnings (10 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.
   8 warnings generated.
   Suppressed 8 warnings (8 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.
   10 warnings generated.
   Suppressed 10 warnings (10 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   10 warnings generated.
   drivers/gpu/drm/drm_self_refresh_helper.c:85:3: warning: Value stored to 
'ret' is never read [clang-analyzer-deadcode.DeadStores]
                   ret = -ENOMEM;
                   ^     ~~~~~~~
   drivers/gpu/drm/drm_self_refresh_helper.c:85:3: note: Value stored to 'ret' 
is never read
                   ret = -ENOMEM;
                   ^     ~~~~~~~
   Suppressed 9 warnings (9 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.
   9 warnings generated.
   Suppressed 9 warnings (9 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.
   10 warnings generated.
   drivers/gpu/drm/drm_fb_helper.c:156:24: warning: Value stored to 'helper' 
during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct drm_fb_helper *helper = info->par;
                                 ^~~~~~   ~~~~~~~~~
   drivers/gpu/drm/drm_fb_helper.c:156:24: note: Value stored to 'helper' 
during its initialization is never read
           struct drm_fb_helper *helper = info->par;
                                 ^~~~~~   ~~~~~~~~~
   Suppressed 9 warnings (9 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.
   13 warnings generated.
   drivers/crypto/gemini/sl3516-ce-cipher.c:27:22: warning: Value stored to 
'in_sg' during its initialization is never read 
[clang-analyzer-deadcode.DeadStores]
           struct scatterlist *in_sg = areq->src;
                               ^~~~~   ~~~~~~~~~
   drivers/crypto/gemini/sl3516-ce-cipher.c:27:22: note: Value stored to 
'in_sg' during its initialization is never read
           struct scatterlist *in_sg = areq->src;
                               ^~~~~   ~~~~~~~~~
   drivers/crypto/gemini/sl3516-ce-cipher.c:28:22: warning: Value stored to 
'out_sg' during its initialization is never read 
[clang-analyzer-deadcode.DeadStores]
           struct scatterlist *out_sg = areq->dst;
                               ^~~~~~   ~~~~~~~~~
   drivers/crypto/gemini/sl3516-ce-cipher.c:28:22: note: Value stored to 
'out_sg' during its initialization is never read
           struct scatterlist *out_sg = areq->dst;
                               ^~~~~~   ~~~~~~~~~
>> drivers/crypto/gemini/sl3516-ce-cipher.c:365:24: warning: Value stored to 
>> 'ce' during its initialization is never read 
>> [clang-analyzer-deadcode.DeadStores]
           struct sl3516_ce_dev *ce = op->ce;
                                 ^~   ~~~~~~
   drivers/crypto/gemini/sl3516-ce-cipher.c:365:24: note: Value stored to 'ce' 
during its initialization is never read
           struct sl3516_ce_dev *ce = op->ce;
                                 ^~   ~~~~~~
   Suppressed 10 warnings (10 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.
   10 warnings generated.
   Suppressed 10 warnings (10 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.
   15 warnings generated.
   drivers/crypto/inside-secure/safexcel.c:139:36: warning: The result of the 
left shift is undefined because the left operand is negative 
[clang-analyzer-core.UndefinedBinaryOperatorResult]
                   val = EIP197_CS_RC_NEXT(i + 1) | EIP197_CS_RC_PREV(i - 1);
                                                    ^
   drivers/crypto/inside-secure/safexcel.h:492:37: note: expanded from macro 
'EIP197_CS_RC_PREV'
   #define EIP197_CS_RC_PREV(x)                    ((x) << 10)
                                                        ^
   drivers/crypto/inside-secure/safexcel.c:591:2: note: Taking false branch
           dev_dbg(priv->dev, "HW init: using %d pipe(s) and %d ring(s)\n",
           ^
   include/linux/dev_printk.h:130:2: note: expanded from macro 'dev_dbg'
           if (0)                                                          \
           ^
   drivers/crypto/inside-secure/safexcel.c:598:6: note: Assuming the condition 
is true
           if (priv->flags & SAFEXCEL_HW_EIP197) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/crypto/inside-secure/safexcel.c:598:2: note: Taking true branch
           if (priv->flags & SAFEXCEL_HW_EIP197) {
           ^
   drivers/crypto/inside-secure/safexcel.c:599:9: note: Loop condition is 
false.  Exiting loop
                   val = readl(EIP197_HIA_AIC(priv) + EIP197_HIA_MST_CTRL);
                         ^
   arch/arm/include/asm/io.h:303:50: note: expanded from macro 'readl'
   #define readl(c)                ({ u32 __v = readl_relaxed(c); __iormb(); 
__v; })
                                                                  ^
   arch/arm/include/asm/io.h:168:20: note: expanded from macro '__iormb'
   #define __iormb()               do { } while (0)
                                   ^
   drivers/crypto/inside-secure/safexcel.c:601:3: note: Loop condition is 
false.  Exiting loop
                   writel(val, EIP197_HIA_AIC(priv) + EIP197_HIA_MST_CTRL);
                   ^
   arch/arm/include/asm/io.h:307:25: note: expanded from macro 'writel'
   #define writel(v,c)             ({ __iowmb(); writel_relaxed(v,c); })
                                      ^
   arch/arm/include/asm/io.h:169:20: note: expanded from macro '__iowmb'
   #define __iowmb()               do { } while (0)
                                   ^
   drivers/crypto/inside-secure/safexcel.c:605:2: note: Loop condition is 
false.  Exiting loop
           writel(EIP197_MST_CTRL_RD_CACHE(RD_CACHE_4BITS) |
           ^
   arch/arm/include/asm/io.h:307:25: note: expanded from macro 'writel'
   #define writel(v,c)             ({ __iowmb(); writel_relaxed(v,c); })
                                      ^
   arch/arm/include/asm/io.h:169:20: note: expanded from macro '__iowmb'
   #define __iowmb()               do { } while (0)
                                   ^
   drivers/crypto/inside-secure/safexcel.c:612:2: note: Loop condition is 
false.  Exiting loop
           writel(0, EIP197_HIA_AIC_G(priv) + EIP197_HIA_AIC_G_ENABLE_CTRL);
           ^
   arch/arm/include/asm/io.h:307:25: note: expanded from macro 'writel'
   #define writel(v,c)             ({ __iowmb(); writel_relaxed(v,c); })
                                      ^
   arch/arm/include/asm/io.h:169:20: note: expanded from macro '__iowmb'
   #define __iowmb()               do { } while (0)
                                   ^
   drivers/crypto/inside-secure/safexcel.c:615:2: note: Loop condition is 
false.  Exiting loop
           writel(GENMASK(31, 0), EIP197_HIA_AIC_G(priv) + 
EIP197_HIA_AIC_G_ACK);
           ^
   arch/arm/include/asm/io.h:307:25: note: expanded from macro 'writel'
   #define writel(v,c)             ({ __iowmb(); writel_relaxed(v,c); })
                                      ^
   arch/arm/include/asm/io.h:169:20: note: expanded from macro '__iowmb'
   #define __iowmb()               do { } while (0)
                                   ^
   drivers/crypto/inside-secure/safexcel.c:618:15: note: Assuming 'pe' is >= 
field 'pes'
           for (pe = 0; pe < priv->config.pes; pe++) {
                        ^~~~~~~~~~~~~~~~~~~~~
   drivers/crypto/inside-secure/safexcel.c:618:2: note: Loop condition is 
false. Execution continues on line 712
           for (pe = 0; pe < priv->config.pes; pe++) {
           ^
   drivers/crypto/inside-secure/safexcel.c:712:14: note: Assuming 'i' is < 
field 'rings'
           for (i = 0; i < priv->config.rings; i++) {
                       ^~~~~~~~~~~~~~~~~~~~~~
   drivers/crypto/inside-secure/safexcel.c:712:2: note: Loop condition is true. 
 Entering loop body
           for (i = 0; i < priv->config.rings; i++) {
           ^
   drivers/crypto/inside-secure/safexcel.c:714:3: note: Loop condition is 
false.  Exiting loop
                   writel(GENMASK(31, 0),
                   ^
   arch/arm/include/asm/io.h:307:25: note: expanded from macro 'writel'
   #define writel(v,c)             ({ __iowmb(); writel_relaxed(v,c); })
                                      ^
   arch/arm/include/asm/io.h:169:20: note: expanded from macro '__iowmb'
   #define __iowmb()               do { } while (0)
                                   ^
   drivers/crypto/inside-secure/safexcel.c:718:3: note: Loop condition is 
false.  Exiting loop
                   writel(0, EIP197_HIA_CDR(priv, i) + EIP197_HIA_xDR_CFG);
                   ^
   arch/arm/include/asm/io.h:307:25: note: expanded from macro 'writel'
   #define writel(v,c)             ({ __iowmb(); writel_relaxed(v,c); })

vim +/ce +365 drivers/crypto/gemini/sl3516-ce-cipher.c

46c5338db7bd45b Corentin Labbe 2021-06-01  360  
46c5338db7bd45b Corentin Labbe 2021-06-01  361  int sl3516_ce_aes_setkey(struct 
crypto_skcipher *tfm, const u8 *key,
46c5338db7bd45b Corentin Labbe 2021-06-01  362                           
unsigned int keylen)
46c5338db7bd45b Corentin Labbe 2021-06-01  363  {
46c5338db7bd45b Corentin Labbe 2021-06-01  364          struct 
sl3516_ce_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm);
46c5338db7bd45b Corentin Labbe 2021-06-01 @365          struct sl3516_ce_dev 
*ce = op->ce;

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to