tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 0e6ac87df9e5122747ac5d9e7da9a45555f16374 commit: 0e45634e06109de7611c36f8d25c0ab35baa0624 [3269/3388] ima: Introduce new securityfs files config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240224/202402241932.aJqB4j0N-lkp@i...) compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240224/202402241932.aJqB4j0N-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202402241932.aJqB4j0N-lkp@intel.com/
All warnings (new ones prefixed by >>):
security/integrity/ima/ima_fs.c:773:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
773 | if (IS_ERR(digest_list_data_del)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ security/integrity/ima/ima_fs.c:791:9: note: uninitialized use occurs here 791 | return ret; | ^~~ security/integrity/ima/ima_fs.c:773:2: note: remove the 'if' if its condition is always false 773 | if (IS_ERR(digest_list_data_del)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 774 | goto out; | ~~~~~~~~ security/integrity/ima/ima_fs.c:767:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 767 | if (IS_ERR(digest_list_data)) | ^~~~~~~~~~~~~~~~~~~~~~~~ security/integrity/ima/ima_fs.c:791:9: note: uninitialized use occurs here 791 | return ret; | ^~~ security/integrity/ima/ima_fs.c:767:2: note: remove the 'if' if its condition is always false 767 | if (IS_ERR(digest_list_data)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 768 | goto out; | ~~~~~~~~ security/integrity/ima/ima_fs.c:761:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 761 | if (IS_ERR(digests_count)) | ^~~~~~~~~~~~~~~~~~~~~ security/integrity/ima/ima_fs.c:791:9: note: uninitialized use occurs here 791 | return ret; | ^~~ security/integrity/ima/ima_fs.c:761:2: note: remove the 'if' if its condition is always false 761 | if (IS_ERR(digests_count)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ 762 | goto out; | ~~~~~~~~ security/integrity/ima/ima_fs.c:690:9: note: initialize the variable 'ret' to silence this warning 690 | int ret; | ^ | = 0 3 warnings generated.
vim +773 security/integrity/ima/ima_fs.c
687 688 int __init ima_fs_init(void) 689 { 690 int ret; 691 692 ima_dir = securityfs_create_dir("ima", integrity_dir); 693 if (IS_ERR(ima_dir)) 694 return PTR_ERR(ima_dir); 695 696 ima_symlink = securityfs_create_symlink("ima", NULL, "integrity/ima", 697 NULL); 698 if (IS_ERR(ima_symlink)) { 699 ret = PTR_ERR(ima_symlink); 700 goto out; 701 } 702 703 binary_runtime_measurements = 704 securityfs_create_file("binary_runtime_measurements", 705 S_IRUSR | S_IRGRP, ima_dir, NULL, 706 &ima_measurements_ops); 707 if (IS_ERR(binary_runtime_measurements)) { 708 ret = PTR_ERR(binary_runtime_measurements); 709 goto out; 710 } 711 712 ascii_runtime_measurements = 713 securityfs_create_file("ascii_runtime_measurements", 714 S_IRUSR | S_IRGRP, ima_dir, NULL, 715 &ima_ascii_measurements_ops); 716 if (IS_ERR(ascii_runtime_measurements)) { 717 ret = PTR_ERR(ascii_runtime_measurements); 718 goto out; 719 } 720 721 runtime_measurements_count = 722 securityfs_create_file("runtime_measurements_count", 723 S_IRUSR | S_IRGRP, ima_dir, NULL, 724 #ifdef CONFIG_IMA_DIGEST_LIST 725 &ima_htable_value_ops); 726 #else 727 &ima_measurements_count_ops); 728 #endif 729 if (IS_ERR(runtime_measurements_count)) { 730 ret = PTR_ERR(runtime_measurements_count); 731 goto out; 732 } 733 734 violations = 735 securityfs_create_file("violations", S_IRUSR | S_IRGRP, 736 #ifdef CONFIG_IMA_DIGEST_LIST 737 ima_dir, NULL, &ima_htable_value_ops); 738 #else 739 ima_dir, NULL, &ima_htable_violations_ops); 740 #endif 741 if (IS_ERR(violations)) { 742 ret = PTR_ERR(violations); 743 goto out; 744 } 745 746 ima_policy = securityfs_create_file("policy", POLICY_FILE_FLAGS, 747 ima_dir, NULL, 748 #ifdef CONFIG_IMA_DIGEST_LIST 749 &ima_data_upload_ops); 750 #else 751 &ima_measure_policy_ops); 752 #endif 753 if (IS_ERR(ima_policy)) { 754 ret = PTR_ERR(ima_policy); 755 goto out; 756 } 757 #ifdef CONFIG_IMA_DIGEST_LIST 758 digests_count = securityfs_create_file("digests_count", 759 S_IRUSR | S_IRGRP, ima_dir, 760 NULL, &ima_htable_value_ops); 761 if (IS_ERR(digests_count)) 762 goto out; 763 764 digest_list_data = securityfs_create_file("digest_list_data", S_IWUSR, 765 ima_dir, NULL, 766 &ima_data_upload_ops); 767 if (IS_ERR(digest_list_data)) 768 goto out; 769 770 digest_list_data_del = securityfs_create_file("digest_list_data_del", 771 S_IWUSR, ima_dir, NULL, 772 &ima_data_upload_ops);
773 if (IS_ERR(digest_list_data_del))