tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 7c547c6bbe6b6a9cedf63d7cdadb2529404df633 commit: 24ac42fb86c6acfcb89b76d3b2fd6fba9bfd89de [1474/1474] ima: rot: Adapt VirtCCA into Rot config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20241117/202411170355.mew4P3B3-lkp@i...) compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 592c0fe55f6d9a811028b5f3507be91458ab2713) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241117/202411170355.mew4P3B3-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/202411170355.mew4P3B3-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from security/integrity/ima/ima_virtcca.c:7: In file included from security/integrity/ima/ima.h:19: In file included from include/linux/security.h:33: In file included from include/linux/mm.h:2247: include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 509 | item]; | ~~~~ include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 516 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 528 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 536 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 537 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~
security/integrity/ima/ima_virtcca.c:30:5: warning: no previous prototype for function 'ima_virtcca_init' [-Wmissing-prototypes]
30 | int ima_virtcca_init(struct ima_rot *rot) | ^ security/integrity/ima/ima_virtcca.c:30:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 30 | int ima_virtcca_init(struct ima_rot *rot) | ^ | static
security/integrity/ima/ima_virtcca.c:59:5: warning: no previous prototype for function 'ima_calc_virtcca_boot_aggregate' [-Wmissing-prototypes]
59 | int ima_calc_virtcca_boot_aggregate(struct ima_digest_data *hash) | ^ security/integrity/ima/ima_virtcca.c:59:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 59 | int ima_calc_virtcca_boot_aggregate(struct ima_digest_data *hash) | ^ | static
security/integrity/ima/ima_virtcca.c:81:5: warning: no previous prototype for function 'ima_virtcca_extend' [-Wmissing-prototypes]
81 | int ima_virtcca_extend(struct tpm_digest *digests_arg, const void *args) | ^ security/integrity/ima/ima_virtcca.c:81:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 81 | int ima_virtcca_extend(struct tpm_digest *digests_arg, const void *args) | ^ | static 8 warnings generated.
vim +/ima_virtcca_init +30 security/integrity/ima/ima_virtcca.c
29
30 int ima_virtcca_init(struct ima_rot *rot)
31 { 32 int rc; 33 34 if (!is_virtcca_cvm_world() || tsi_get_version() == SMCCC_RET_NOT_SUPPORTED) 35 return -ENODEV; 36 37 rc = ima_virtcca_init_algo(); 38 if (rc) 39 return rc; 40 41 if (virtcca_algo != ima_hash_algo) { 42 pr_info("VirtCCA's algo (%s) is different from ima_hash_algo (%s)\n", 43 hash_algo_name[virtcca_algo], hash_algo_name[ima_hash_algo]); 44 45 rot->allocated_banks = kcalloc(1, sizeof(*rot->allocated_banks), GFP_KERNEL); 46 if (!rot->allocated_banks) 47 return -ENOMEM; 48 49 rot->nr_allocated_banks = 1; 50 rot->allocated_banks[0].alg_id = (virtcca_algo == HASH_ALGO_SHA512) ? 51 TPM_ALG_SHA512 : TPM_ALG_SHA256; 52 rot->allocated_banks[0].digest_size = hash_digest_size[virtcca_algo]; 53 rot->allocated_banks[0].crypto_id = virtcca_algo; 54 } 55 56 return 0; 57 } 58
59 int ima_calc_virtcca_boot_aggregate(struct ima_digest_data *hash)
60 { 61 unsigned long result; 62 struct virtcca_cvm_measurement cm = { 0 }; 63 64 hash->algo = virtcca_algo; 65 hash->length = hash_digest_size[virtcca_algo]; 66 67 /* Read the measurement result of RIM as the boot aggregate */ 68 cm.index = RIM_MEASUREMENT_SLOT; 69 70 result = tsi_measurement_read(&cm); 71 if (result != TSI_SUCCESS) { 72 pr_err("Error reading cvm measurement 0 for boot aggregate\n"); 73 return -EFAULT; 74 } 75 76 memcpy(hash->digest, cm.value, hash->length); 77 78 return 0; 79 } 80
81 int ima_virtcca_extend(struct tpm_digest *digests_arg, const void *args)