:::::: :::::: Manual check reason: "low confidence bisect report" :::::: Manual check reason: "commit no functional change" :::::: Manual check reason: "low confidence static check warning: security/integrity/evm/evm_main.c:460:17: warning: use of uninitialized value '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]" ::::::
CC: [email protected] BCC: [email protected] CC: Linux Memory Management List <[email protected]> TO: Christian Brauner <[email protected]> CC: Seth Forshee <[email protected]> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 7c5e07b73ff3011c9b82d4a3286a3362b951ad2b commit: 35faf3109a78516f60ca13f957083d5e5535fde0 [4526/13542] fs: port to iattr ownership update helpers :::::: branch date: 4 hours ago :::::: commit date: 5 weeks ago config: arm-randconfig-c002-20220727 (https://download.01.org/0day-ci/archive/20220728/[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/next/linux-next.git/commit/?id=35faf3109a78516f60ca13f957083d5e5535fde0 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 35faf3109a78516f60ca13f957083d5e5535fde0 # 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 >>) security/integrity/evm/evm_main.c: In function 'evm_xattr_acl_change': >> security/integrity/evm/evm_main.c:460:17: warning: use of uninitialized >> value '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 460 | umode_t mode; | ^~~~ 'evm_xattr_change': events 1-4 | | 504 | static int evm_xattr_change(struct user_namespace *mnt_userns, | | ^~~~~~~~~~~~~~~~ | | | | | (1) entry to 'evm_xattr_change' |...... | 511 | if (posix_xattr_acl(xattr_name)) | | ~ | | | | | (2) following 'true' branch... | 512 | return evm_xattr_acl_change(mnt_userns, dentry, xattr_name, | | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | | | (4) calling 'evm_xattr_acl_change' from 'evm_xattr_change' | | (3) ...to here | 513 | xattr_value, xattr_value_len); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | +--> 'evm_xattr_acl_change': events 5-6 | | 455 | static int evm_xattr_acl_change(struct user_namespace *mnt_userns, | | ^~~~~~~~~~~~~~~~~~~~ | | | | | (5) entry to 'evm_xattr_acl_change' |...... | 460 | umode_t mode; | | ~~~~ | | | | | (6) use of uninitialized value '<unknown>' here | security/integrity/evm/evm_main.c:461:40: warning: use of uninitialized value '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 461 | struct posix_acl *acl = NULL, *acl_res; | ^~~~~~~ 'evm_xattr_change': events 1-4 | | 504 | static int evm_xattr_change(struct user_namespace *mnt_userns, | | ^~~~~~~~~~~~~~~~ | | | | | (1) entry to 'evm_xattr_change' |...... | 511 | if (posix_xattr_acl(xattr_name)) | | ~ | | | | | (2) following 'true' branch... | 512 | return evm_xattr_acl_change(mnt_userns, dentry, xattr_name, | | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | | | (4) calling 'evm_xattr_acl_change' from 'evm_xattr_change' | | (3) ...to here | 513 | xattr_value, xattr_value_len); | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | +--> 'evm_xattr_acl_change': events 5-6 | | 455 | static int evm_xattr_acl_change(struct user_namespace *mnt_userns, | | ^~~~~~~~~~~~~~~~~~~~ | | | | | (5) entry to 'evm_xattr_acl_change' |...... | 461 | struct posix_acl *acl = NULL, *acl_res; | | ~~~~~~~ | | | | | (6) use of uninitialized value '<unknown>' here | vim +460 security/integrity/evm/evm_main.c 7102ebcd65c1cdb Mimi Zohar 2011-05-12 442 1886ab01a3fb98e Roberto Sassu 2021-05-14 443 /* 1886ab01a3fb98e Roberto Sassu 2021-05-14 444 * evm_xattr_acl_change - check if passed ACL changes the inode mode 1886ab01a3fb98e Roberto Sassu 2021-05-14 445 * @mnt_userns: user namespace of the idmapped mount 1886ab01a3fb98e Roberto Sassu 2021-05-14 446 * @dentry: pointer to the affected dentry 1886ab01a3fb98e Roberto Sassu 2021-05-14 447 * @xattr_name: requested xattr 1886ab01a3fb98e Roberto Sassu 2021-05-14 448 * @xattr_value: requested xattr value 1886ab01a3fb98e Roberto Sassu 2021-05-14 449 * @xattr_value_len: requested xattr value length 1886ab01a3fb98e Roberto Sassu 2021-05-14 450 * 1886ab01a3fb98e Roberto Sassu 2021-05-14 451 * Check if passed ACL changes the inode mode, which is protected by EVM. 1886ab01a3fb98e Roberto Sassu 2021-05-14 452 * 1886ab01a3fb98e Roberto Sassu 2021-05-14 453 * Returns 1 if passed ACL causes inode mode change, 0 otherwise. 1886ab01a3fb98e Roberto Sassu 2021-05-14 454 */ 1886ab01a3fb98e Roberto Sassu 2021-05-14 455 static int evm_xattr_acl_change(struct user_namespace *mnt_userns, 1886ab01a3fb98e Roberto Sassu 2021-05-14 456 struct dentry *dentry, const char *xattr_name, 1886ab01a3fb98e Roberto Sassu 2021-05-14 457 const void *xattr_value, size_t xattr_value_len) 1886ab01a3fb98e Roberto Sassu 2021-05-14 458 { 1886ab01a3fb98e Roberto Sassu 2021-05-14 459 #ifdef CONFIG_FS_POSIX_ACL 1886ab01a3fb98e Roberto Sassu 2021-05-14 @460 umode_t mode; 1886ab01a3fb98e Roberto Sassu 2021-05-14 461 struct posix_acl *acl = NULL, *acl_res; 1886ab01a3fb98e Roberto Sassu 2021-05-14 462 struct inode *inode = d_backing_inode(dentry); 1886ab01a3fb98e Roberto Sassu 2021-05-14 463 int rc; 1886ab01a3fb98e Roberto Sassu 2021-05-14 464 1886ab01a3fb98e Roberto Sassu 2021-05-14 465 /* 1886ab01a3fb98e Roberto Sassu 2021-05-14 466 * user_ns is not relevant here, ACL_USER/ACL_GROUP don't have impact 1886ab01a3fb98e Roberto Sassu 2021-05-14 467 * on the inode mode (see posix_acl_equiv_mode()). 1886ab01a3fb98e Roberto Sassu 2021-05-14 468 */ 1886ab01a3fb98e Roberto Sassu 2021-05-14 469 acl = posix_acl_from_xattr(&init_user_ns, xattr_value, xattr_value_len); 1886ab01a3fb98e Roberto Sassu 2021-05-14 470 if (IS_ERR_OR_NULL(acl)) 1886ab01a3fb98e Roberto Sassu 2021-05-14 471 return 1; 1886ab01a3fb98e Roberto Sassu 2021-05-14 472 1886ab01a3fb98e Roberto Sassu 2021-05-14 473 acl_res = acl; 1886ab01a3fb98e Roberto Sassu 2021-05-14 474 /* 1886ab01a3fb98e Roberto Sassu 2021-05-14 475 * Passing mnt_userns is necessary to correctly determine the GID in 1886ab01a3fb98e Roberto Sassu 2021-05-14 476 * an idmapped mount, as the GID is used to clear the setgid bit in 1886ab01a3fb98e Roberto Sassu 2021-05-14 477 * the inode mode. 1886ab01a3fb98e Roberto Sassu 2021-05-14 478 */ 1886ab01a3fb98e Roberto Sassu 2021-05-14 479 rc = posix_acl_update_mode(mnt_userns, inode, &mode, &acl_res); 1886ab01a3fb98e Roberto Sassu 2021-05-14 480 1886ab01a3fb98e Roberto Sassu 2021-05-14 481 posix_acl_release(acl); 1886ab01a3fb98e Roberto Sassu 2021-05-14 482 1886ab01a3fb98e Roberto Sassu 2021-05-14 483 if (rc) 1886ab01a3fb98e Roberto Sassu 2021-05-14 484 return 1; 1886ab01a3fb98e Roberto Sassu 2021-05-14 485 1886ab01a3fb98e Roberto Sassu 2021-05-14 486 if (inode->i_mode != mode) 1886ab01a3fb98e Roberto Sassu 2021-05-14 487 return 1; 1886ab01a3fb98e Roberto Sassu 2021-05-14 488 #endif 1886ab01a3fb98e Roberto Sassu 2021-05-14 489 return 0; 1886ab01a3fb98e Roberto Sassu 2021-05-14 490 } 1886ab01a3fb98e Roberto Sassu 2021-05-14 491 :::::: The code at line 460 was first introduced by commit :::::: 1886ab01a3fb98ee7f7739ae50eb9492f5df3641 evm: Allow setxattr() and setattr() for unmodified metadata :::::: TO: Roberto Sassu <[email protected]> :::::: CC: Mimi Zohar <[email protected]> -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
