CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Tudor Ambarus <[email protected]>
CC: Herbert Xu <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   038101e6b2cd5c55f888f85db42ea2ad3aecb4b6
commit: 817b804ca36747f0c9db667d7d8aa9fdd55335c7 crypto: atmel-tdes - Handle 
error messages
date:   7 months ago
:::::: branch date: 18 hours ago
:::::: commit date: 7 months ago
config: riscv-randconfig-c006-20220216 
(https://download.01.org/0day-ci/archive/20220222/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 
0e628a783b935c70c80815db6c061ec84f884af5)
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 riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=817b804ca36747f0c9db667d7d8aa9fdd55335c7
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 817b804ca36747f0c9db667d7d8aa9fdd55335c7
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 
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 >>)
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   4 warnings generated.
   drivers/media/usb/uvc/uvc_ctrl.c:836:37: warning: The result of the left 
shift is undefined because the left operand is negative 
[clang-analyzer-core.UndefinedBinaryOperatorResult]
                   *data = (*data & ~mask) | ((value << offset) & mask);
                                               ~~~~~ ^
   drivers/media/usb/uvc/uvc_ctrl.c:828:6: note: Assuming field 'v4l2_type' is 
equal to V4L2_CTRL_TYPE_BUTTON
           if (mapping->v4l2_type == V4L2_CTRL_TYPE_BUTTON)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/usb/uvc/uvc_ctrl.c:828:2: note: Taking true branch
           if (mapping->v4l2_type == V4L2_CTRL_TYPE_BUTTON)
           ^
   drivers/media/usb/uvc/uvc_ctrl.c:834:9: note: Assuming 'bits' is > 0
           for (; bits > 0; data++) {
                  ^~~~~~~~
   drivers/media/usb/uvc/uvc_ctrl.c:834:2: note: Loop condition is true.  
Entering loop body
           for (; bits > 0; data++) {
           ^
   drivers/media/usb/uvc/uvc_ctrl.c:837:13: note: Assuming 'offset' is 0
                   value >>= offset ? offset : 8;
                             ^~~~~~
   drivers/media/usb/uvc/uvc_ctrl.c:837:13: note: '?' condition is false
   drivers/media/usb/uvc/uvc_ctrl.c:837:3: note: The value -1 is assigned to 
'value'
                   value >>= offset ? offset : 8;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/usb/uvc/uvc_ctrl.c:834:9: note: Assuming 'bits' is > 0
           for (; bits > 0; data++) {
                  ^~~~~~~~
   drivers/media/usb/uvc/uvc_ctrl.c:834:2: note: Loop condition is true.  
Entering loop body
           for (; bits > 0; data++) {
           ^
   drivers/media/usb/uvc/uvc_ctrl.c:836:37: note: The result of the left shift 
is undefined because the left operand is negative
                   *data = (*data & ~mask) | ((value << offset) & mask);
                                               ~~~~~ ^
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   4 warnings generated.
   sound/usb/line6/midi.c:229:2: 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(rmidi->id, line6->properties->id);
           ^~~~~~
   sound/usb/line6/midi.c:229:2: 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(rmidi->id, line6->properties->id);
           ^~~~~~
   sound/usb/line6/midi.c:230:2: 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(rmidi->name, line6->properties->name);
           ^~~~~~
   sound/usb/line6/midi.c:230:2: 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(rmidi->name, line6->properties->name);
           ^~~~~~
   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.
   3 warnings generated.
   sound/usb/line6/pcm.c:489:2: 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(pcm->name, line6->properties->name);
           ^~~~~~
   sound/usb/line6/pcm.c:489:2: 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(pcm->name, line6->properties->name);
           ^~~~~~
   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.
   3 warnings generated.
>> drivers/crypto/atmel-tdes.c:683:17: warning: Value stored to 'dev' during 
>> its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = ctx->dd->dev;
                          ^~~   ~~~~~~~~~~~~
   drivers/crypto/atmel-tdes.c:683:17: note: Value stored to 'dev' during its 
initialization is never read
           struct device *dev = ctx->dd->dev;
                          ^~~   ~~~~~~~~~~~~
   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.
   4 warnings generated.
   Suppressed 4 warnings (4 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.
   4 warnings generated.
   Suppressed 4 warnings (4 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.
   4 warnings generated.
   Suppressed 4 warnings (4 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   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.
   5 warnings generated.
   drivers/mmc/host/bcm2835.c:195:17: warning: Value stored to 'dev' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &host->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~
   drivers/mmc/host/bcm2835.c:195:17: note: Value stored to 'dev' during its 
initialization is never read
           struct device *dev = &host->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~
   drivers/mmc/host/bcm2835.c:210:17: warning: Value stored to 'dev' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &host->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~
   drivers/mmc/host/bcm2835.c:210:17: note: Value stored to 'dev' during its 
initialization is never read
           struct device *dev = &host->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~
   drivers/mmc/host/bcm2835.c:718:17: warning: Value stored to 'dev' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device *dev = &host->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~
   drivers/mmc/host/bcm2835.c:718:17: note: Value stored to 'dev' during its 
initialization is never read
           struct device *dev = &host->pdev->dev;
                          ^~~   ~~~~~~~~~~~~~~~~
   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.
   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.
   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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   4 warnings generated.
   drivers/media/usb/gspca/topro.c:4745:3: warning: Value stored to 'ret' is 
never read [clang-analyzer-deadcode.DeadStores]
                   ret = gspca_expo_autogain(gspca_dev, luma,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/media/usb/gspca/topro.c:4745:3: note: Value stored to 'ret' is never 
read
                   ret = gspca_expo_autogain(gspca_dev, luma,
                   ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   3 warnings generated.
   Suppressed 3 warnings (3 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.
   4 warnings generated.
   drivers/media/usb/gspca/vc032x.c:2793:8: warning: Excessive padding in 
'struct sensor_info' (2 padding bytes, where 0 is optimal). 
   Optimal fields order: 
   VpId, 
   sensorId, 
   I2cAdd, 
   IdAdd, 
   m1, 
   m2, 
   op, 
   consider reordering the fields or adding explicit padding members 
[clang-analyzer-optin.performance.Padding]
   struct sensor_info {
   ~~~~~~~^~~~~~~~~~~~~
   drivers/media/usb/gspca/vc032x.c:2793:8: note: Excessive padding in 'struct 
sensor_info' (2 padding bytes, where 0 is optimal). Optimal fields order: VpId, 
sensorId, I2cAdd, IdAdd, m1, m2, op, consider reordering the fields or adding 
explicit padding members
   struct sensor_info {
   ~~~~~~~^~~~~~~~~~~~~
   Suppressed 3 warnings (3 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.

vim +/dev +683 drivers/crypto/atmel-tdes.c

13802005d8f2db Nicolas Royer  2012-07-01  677  
967d4910ef0e83 Ard Biesheuvel 2019-11-09  678  static int 
atmel_tdes_crypt(struct skcipher_request *req, unsigned long mode)
13802005d8f2db Nicolas Royer  2012-07-01  679  {
61b0dd664fa187 Tudor Ambarus  2019-11-15  680   struct crypto_skcipher 
*skcipher = crypto_skcipher_reqtfm(req);
61b0dd664fa187 Tudor Ambarus  2019-11-15  681   struct atmel_tdes_ctx *ctx = 
crypto_skcipher_ctx(skcipher);
967d4910ef0e83 Ard Biesheuvel 2019-11-09  682   struct atmel_tdes_reqctx *rctx 
= skcipher_request_ctx(req);
817b804ca36747 Tudor Ambarus  2021-07-20 @683   struct device *dev = 
ctx->dd->dev;
13802005d8f2db Nicolas Royer  2012-07-01  684  
848572f8177214 Tudor Ambarus  2019-12-05  685   switch (mode & 
TDES_FLAGS_OPMODE_MASK) {
848572f8177214 Tudor Ambarus  2019-12-05  686   case TDES_FLAGS_CFB8:
967d4910ef0e83 Ard Biesheuvel 2019-11-09  687           if 
(!IS_ALIGNED(req->cryptlen, CFB8_BLOCK_SIZE)) {
817b804ca36747 Tudor Ambarus  2021-07-20  688                   dev_dbg(dev, 
"request size is not exact amount of CFB8 blocks\n");
13802005d8f2db Nicolas Royer  2012-07-01  689                   return -EINVAL;
13802005d8f2db Nicolas Royer  2012-07-01  690           }
1f858040c2f780 Nicolas Royer  2013-02-20  691           ctx->block_size = 
CFB8_BLOCK_SIZE;
848572f8177214 Tudor Ambarus  2019-12-05  692           break;
848572f8177214 Tudor Ambarus  2019-12-05  693  
848572f8177214 Tudor Ambarus  2019-12-05  694   case TDES_FLAGS_CFB16:
967d4910ef0e83 Ard Biesheuvel 2019-11-09  695           if 
(!IS_ALIGNED(req->cryptlen, CFB16_BLOCK_SIZE)) {
817b804ca36747 Tudor Ambarus  2021-07-20  696                   dev_dbg(dev, 
"request size is not exact amount of CFB16 blocks\n");
13802005d8f2db Nicolas Royer  2012-07-01  697                   return -EINVAL;
13802005d8f2db Nicolas Royer  2012-07-01  698           }
1f858040c2f780 Nicolas Royer  2013-02-20  699           ctx->block_size = 
CFB16_BLOCK_SIZE;
848572f8177214 Tudor Ambarus  2019-12-05  700           break;
848572f8177214 Tudor Ambarus  2019-12-05  701  
848572f8177214 Tudor Ambarus  2019-12-05  702   case TDES_FLAGS_CFB32:
967d4910ef0e83 Ard Biesheuvel 2019-11-09  703           if 
(!IS_ALIGNED(req->cryptlen, CFB32_BLOCK_SIZE)) {
817b804ca36747 Tudor Ambarus  2021-07-20  704                   dev_dbg(dev, 
"request size is not exact amount of CFB32 blocks\n");
13802005d8f2db Nicolas Royer  2012-07-01  705                   return -EINVAL;
13802005d8f2db Nicolas Royer  2012-07-01  706           }
1f858040c2f780 Nicolas Royer  2013-02-20  707           ctx->block_size = 
CFB32_BLOCK_SIZE;
848572f8177214 Tudor Ambarus  2019-12-05  708           break;
848572f8177214 Tudor Ambarus  2019-12-05  709  
848572f8177214 Tudor Ambarus  2019-12-05  710   default:
967d4910ef0e83 Ard Biesheuvel 2019-11-09  711           if 
(!IS_ALIGNED(req->cryptlen, DES_BLOCK_SIZE)) {
817b804ca36747 Tudor Ambarus  2021-07-20  712                   dev_dbg(dev, 
"request size is not exact amount of DES blocks\n");
13802005d8f2db Nicolas Royer  2012-07-01  713                   return -EINVAL;
13802005d8f2db Nicolas Royer  2012-07-01  714           }
1f858040c2f780 Nicolas Royer  2013-02-20  715           ctx->block_size = 
DES_BLOCK_SIZE;
848572f8177214 Tudor Ambarus  2019-12-05  716           break;
1f858040c2f780 Nicolas Royer  2013-02-20  717   }
13802005d8f2db Nicolas Royer  2012-07-01  718  
1f858040c2f780 Nicolas Royer  2013-02-20  719   rctx->mode = mode;
1f858040c2f780 Nicolas Royer  2013-02-20  720  
c65d123742a7bf Tudor Ambarus  2019-12-05  721   if ((mode & 
TDES_FLAGS_OPMODE_MASK) != TDES_FLAGS_ECB &&
c65d123742a7bf Tudor Ambarus  2019-12-05  722       !(mode & 
TDES_FLAGS_ENCRYPT) && req->src == req->dst) {
61b0dd664fa187 Tudor Ambarus  2019-11-15  723           unsigned int ivsize = 
crypto_skcipher_ivsize(skcipher);
61b0dd664fa187 Tudor Ambarus  2019-11-15  724  
61b0dd664fa187 Tudor Ambarus  2019-11-15  725           if (req->cryptlen >= 
ivsize)
61b0dd664fa187 Tudor Ambarus  2019-11-15  726                   
scatterwalk_map_and_copy(rctx->lastc, req->src,
61b0dd664fa187 Tudor Ambarus  2019-11-15  727                                   
         req->cryptlen - ivsize,
61b0dd664fa187 Tudor Ambarus  2019-11-15  728                                   
         ivsize, 0);
61b0dd664fa187 Tudor Ambarus  2019-11-15  729   }
61b0dd664fa187 Tudor Ambarus  2019-11-15  730  
1f858040c2f780 Nicolas Royer  2013-02-20  731   return 
atmel_tdes_handle_queue(ctx->dd, req);
1f858040c2f780 Nicolas Royer  2013-02-20  732  }
1f858040c2f780 Nicolas Royer  2013-02-20  733  

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