CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Jakub Jelinek <[email protected]>
CC: "Peter Zijlstra (Intel)" <[email protected]>
CC: Andrew Morton <[email protected]>
CC: Linux Memory Management List <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   9ff50bf2f2ff5fab01cac26d8eed21a89308e6ef
commit: 2f78788b55baa3410b1ec91a576286abe1ad4d6a ilog2: improve ilog2 for 
constant arguments
date:   8 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 8 months ago
config: arm-randconfig-c002-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
44d0a99a12ec7ead4d2f5ef649ba05b40f6d463d)
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=2f78788b55baa3410b1ec91a576286abe1ad4d6a
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2f78788b55baa3410b1ec91a576286abe1ad4d6a
        # save the attached .config 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 >>)
                                             ^~~~
   include/crypto/skcipher.h:499:2: note: Taking true branch
           if (likely(req))
           ^
   fs/crypto/keysetup_v1.c:63:8: note: Returned allocated memory
           req = skcipher_request_alloc(tfm, GFP_KERNEL);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/crypto/keysetup_v1.c:64:7: note: 'req' is non-null
           if (!req) {
                ^~~
   fs/crypto/keysetup_v1.c:64:2: note: Taking false branch
           if (!req) {
           ^
   fs/crypto/keysetup_v1.c:72:6: note: Assuming 'res' is < 0
           if (res < 0)
               ^~~~~~~
   fs/crypto/keysetup_v1.c:72:2: note: Taking true branch
           if (res < 0)
           ^
   fs/crypto/keysetup_v1.c:73:3: note: Control jumps to line 81
                   goto out;
                   ^
   fs/crypto/keysetup_v1.c:82:2: note: Potential leak of memory pointed to by 
'req'
           crypto_free_skcipher(tfm);
           ^
   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/base/regmap/regmap-mmio.c:52:3: warning: Value stored to 
'min_stride' is never read [clang-analyzer-deadcode.DeadStores]
                   min_stride = 0;
                   ^            ~
   drivers/base/regmap/regmap-mmio.c:52:3: note: Value stored to 'min_stride' 
is never read
                   min_stride = 0;
                   ^            ~
   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.
   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.
   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.
   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.
   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.
   7 warnings generated.
   drivers/misc/eeprom/idt_89hpesx.c:977:3: warning: Value stored to 
'csraddr_len' is never read [clang-analyzer-deadcode.DeadStores]
                   csraddr_len = strnlen(csraddr_str, count);
                   ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/eeprom/idt_89hpesx.c:977:3: note: Value stored to 'csraddr_len' 
is never read
                   csraddr_len = strnlen(csraddr_str, count);
                   ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 6 warnings (3 in non-user code, 3 with check filters).
   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.
   5 warnings generated.
   Suppressed 5 warnings (5 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.
   Suppressed 5 warnings (5 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.
   3 warnings generated.
>> fs/verity/open.c:244:2: warning: Attempt to free released memory 
>> [clang-analyzer-unix.Malloc]
           kfree(vi->tree_params.hashstate);
           ^
   fs/verity/open.c:306:6: note: Assuming the condition is false
           if (!IS_VERITY(inode))
               ^~~~~~~~~~~~~~~~~
   fs/verity/open.c:306:2: note: Taking false branch
           if (!IS_VERITY(inode))
           ^
   fs/verity/open.c:309:6: note: Assuming the condition is false
           if (filp->f_mode & FMODE_WRITE) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/verity/open.c:309:2: note: Taking false branch
           if (filp->f_mode & FMODE_WRITE) {
           ^
   fs/verity/open.c:315:9: note: Calling 'ensure_verity_info'
           return ensure_verity_info(inode);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/verity/open.c:255:6: note: Assuming 'vi' is null
           if (vi)
               ^~
   fs/verity/open.c:255:2: note: Taking false branch
           if (vi)
           ^
   fs/verity/open.c:259:6: note: Assuming 'res' is >= 0
           if (res < 0) {
               ^~~~~~~
   fs/verity/open.c:259:2: note: Taking false branch
           if (res < 0) {
           ^
   fs/verity/open.c:264:6: note: Assuming 'res' is <= 
FS_VERITY_MAX_DESCRIPTOR_SIZE
           if (res > FS_VERITY_MAX_DESCRIPTOR_SIZE) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/verity/open.c:264:2: note: Taking false branch
           if (res > FS_VERITY_MAX_DESCRIPTOR_SIZE) {
           ^
   fs/verity/open.c:270:6: note: Assuming 'desc' is non-null
           if (!desc)
               ^~~~~
   fs/verity/open.c:270:2: note: Taking false branch
           if (!desc)
           ^
   fs/verity/open.c:273:6: note: Assuming 'res' is >= 0
           if (res < 0) {
               ^~~~~~~
   fs/verity/open.c:273:2: note: Taking false branch
           if (res < 0) {
           ^
   fs/verity/open.c:278:7: note: Calling 'fsverity_create_info'
           vi = fsverity_create_info(inode, desc, res);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/verity/open.c:155:6: note: Assuming the condition is false
           if (desc_size < sizeof(*desc)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~
   fs/verity/open.c:155:2: note: Taking false branch
           if (desc_size < sizeof(*desc)) {
           ^
   fs/verity/open.c:161:6: note: Assuming field 'version' is equal to 1
           if (desc->version != 1) {
               ^~~~~~~~~~~~~~~~~~
   fs/verity/open.c:161:2: note: Taking false branch
           if (desc->version != 1) {
           ^
   fs/verity/open.c:167:6: note: Assuming the condition is false
           if (memchr_inv(desc->__reserved, 0, sizeof(desc->__reserved))) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/verity/open.c:167:2: note: Taking false branch
           if (memchr_inv(desc->__reserved, 0, sizeof(desc->__reserved))) {
           ^
   fs/verity/open.c:172:6: note: Assuming the condition is false
           if (desc->salt_size > sizeof(desc->salt)) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/verity/open.c:172:2: note: Taking false branch
           if (desc->salt_size > sizeof(desc->salt)) {
           ^
   fs/verity/open.c:177:6: note: Assuming field 'data_size' is equal to field 
'i_size'
           if (le64_to_cpu(desc->data_size) != inode->i_size) {
               ^
   include/linux/byteorder/generic.h:87:21: note: expanded from macro 
'le64_to_cpu'
   #define le64_to_cpu __le64_to_cpu
                       ^
   include/uapi/linux/byteorder/little_endian.h:32:26: note: expanded from 
macro '__le64_to_cpu'
   #define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
                            ^
   fs/verity/open.c:177:2: note: Taking false branch
           if (le64_to_cpu(desc->data_size) != inode->i_size) {
           ^
   fs/verity/open.c:185:6: note: Assuming 'vi' is non-null
           if (!vi)
               ^~~
   fs/verity/open.c:185:2: note: Taking false branch
           if (!vi)
           ^
   fs/verity/open.c:189:8: note: Calling 'fsverity_init_merkle_tree_params'
           err = fsverity_init_merkle_tree_params(&vi->tree_params, inode,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/verity/open.c:43:2: note: Taking false branch
           if (IS_ERR(hash_alg))
           ^
   fs/verity/open.c:50:2: note: Taking false branch
           if (IS_ERR(params->hashstate)) {

vim +244 fs/verity/open.c

fd2d1acfcadfe2 Eric Biggers 2019-07-22  239  
fd2d1acfcadfe2 Eric Biggers 2019-07-22  240  void fsverity_free_info(struct 
fsverity_info *vi)
fd2d1acfcadfe2 Eric Biggers 2019-07-22  241  {
fd2d1acfcadfe2 Eric Biggers 2019-07-22  242     if (!vi)
fd2d1acfcadfe2 Eric Biggers 2019-07-22  243             return;
fd2d1acfcadfe2 Eric Biggers 2019-07-22 @244     
kfree(vi->tree_params.hashstate);
fd2d1acfcadfe2 Eric Biggers 2019-07-22  245     
kmem_cache_free(fsverity_info_cachep, vi);
fd2d1acfcadfe2 Eric Biggers 2019-07-22  246  }
fd2d1acfcadfe2 Eric Biggers 2019-07-22  247  

:::::: The code at line 244 was first introduced by commit
:::::: fd2d1acfcadfe2e42567afaec5e989b38061a7d2 fs-verity: add the hook for 
file ->open()

:::::: TO: Eric Biggers <[email protected]>
:::::: CC: Eric Biggers <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to