:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: Manual check reason: "low confidence static check warning: 
drivers/md/dm-verity-loadpin.c:16:13: warning: use of uninitialized value 
'<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]"
:::::: 

CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Matthias Kaehlcke <[email protected]>
CC: Kees Cook <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git 
for-next/kspp
head:   27603a606fda0806d7c08914bc976931aa42020e
commit: b6c1c5745ccc68ac5d57c7ffb51ea25a86d0e97b [5/11] dm: Add verity helpers 
for LoadPin
:::::: branch date: 4 days ago
:::::: commit date: 3 weeks ago
config: arm-randconfig-c002-20220731 
(https://download.01.org/0day-ci/archive/20220802/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?id=b6c1c5745ccc68ac5d57c7ffb51ea25a86d0e97b
        git remote add kees 
https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
        git fetch --no-tags kees for-next/kspp
        git checkout b6c1c5745ccc68ac5d57c7ffb51ea25a86d0e97b
        # save the config file
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross 
ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error' 

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

gcc-analyzer warnings: (new ones prefixed by >>)
   drivers/md/dm-verity-loadpin.c: In function 'is_trusted_verity_target':
>> drivers/md/dm-verity-loadpin.c:16:13: warning: use of uninitialized value 
>> '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
      16 |         u8 *root_digest;
         |             ^~~~~~~~~~~
     'is_trusted_verity_target': event 1
       |
       |   16 |         u8 *root_digest;
       |      |             ^~~~~~~~~~~
       |      |             |
       |      |             (1) use of uninitialized value '<unknown>' here
       |
   drivers/md/dm-verity-loadpin.c:17:22: warning: use of uninitialized value 
'<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
      17 |         unsigned int digest_size;
         |                      ^~~~~~~~~~~
     'is_trusted_verity_target': event 1
       |
       |   17 |         unsigned int digest_size;
       |      |                      ^~~~~~~~~~~
       |      |                      |
       |      |                      (1) use of uninitialized value '<unknown>' 
here
       |
   drivers/md/dm-verity-loadpin.c: In function 
'dm_verity_loadpin_is_bdev_trusted':
   drivers/md/dm-verity-loadpin.c:49:13: warning: use of uninitialized value 
'<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
      49 |         int srcu_idx;
         |             ^~~~~~~~
     'dm_verity_loadpin_is_bdev_trusted': event 1
       |
       |   49 |         int srcu_idx;
       |      |             ^~~~~~~~
       |      |             |
       |      |             (1) use of uninitialized value '<unknown>' here
       |

vim +16 drivers/md/dm-verity-loadpin.c

b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  13  
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  14  static bool 
is_trusted_verity_target(struct dm_target *ti)
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  15  {
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27 @16         u8 *root_digest;
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  17         unsigned int 
digest_size;
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  18         struct 
dm_verity_loadpin_trusted_root_digest *trd;
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  19         bool trusted = false;
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  20  
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  21         if 
(!dm_is_verity_target(ti))
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  22                 return false;
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  23  
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  24         if 
(dm_verity_get_root_digest(ti, &root_digest, &digest_size))
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  25                 return false;
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  26  
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  27         
list_for_each_entry(trd, &dm_verity_loadpin_trusted_root_digests, node) {
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  28                 if ((trd->len 
== digest_size) &&
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  29                     
!memcmp(trd->data, root_digest, digest_size)) {
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  30                         trusted 
= true;
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  31                         break;
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  32                 }
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  33         }
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  34  
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  35         kfree(root_digest);
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  36  
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  37         return trusted;
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  38  }
b6c1c5745ccc68 Matthias Kaehlcke 2022-06-27  39  

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

Reply via email to