arch/x86/coco/sev/core.c:2838:12-13: WARNING opportunity for kfree_sensitive/kvfree_sensitive (memset at line 2837)
kernel test robot
build botBCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Nikunj A Dadhania <[email protected]>
CC: "Borislav Petkov (AMD)" <[email protected]>
CC: Tom Lendacky <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: dd9b004b7ff3289fb7bae35130c0a5c0537266af commit: c5529418d05079384af4dbbb6f6156344c2ffce2 x86/sev: Carve out and export SNP guest messaging init routines date: 12 months ago
:::::: branch date: 2 days ago
:::::: commit date: 12 months ago
config: x86_64-randconfig-104-20251217 (https://download.01.org/0day-ci/archive/20251220/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
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 <[email protected]> | Reported-by: Julia Lawall <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/
cocci warnings: (new ones prefixed by >>)
>> arch/x86/coco/sev/core.c:2838:12-13: WARNING opportunity for kfree_sensitive/kvfree_sensitive (memset at line 2837)
vim +2838 arch/x86/coco/sev/core.c
c5529418d05079 Nikunj A Dadhania 2025-01-06 2825
c5529418d05079 Nikunj A Dadhania 2025-01-06 2826 void snp_msg_free(struct snp_msg_desc *mdesc)
c5529418d05079 Nikunj A Dadhania 2025-01-06 2827 {
c5529418d05079 Nikunj A Dadhania 2025-01-06 2828 if (!mdesc)
c5529418d05079 Nikunj A Dadhania 2025-01-06 2829 return;
c5529418d05079 Nikunj A Dadhania 2025-01-06 2830
c5529418d05079 Nikunj A Dadhania 2025-01-06 2831 kfree(mdesc->ctx);
c5529418d05079 Nikunj A Dadhania 2025-01-06 2832 free_shared_pages(mdesc->response, sizeof(struct snp_guest_msg));
c5529418d05079 Nikunj A Dadhania 2025-01-06 2833 free_shared_pages(mdesc->request, sizeof(struct snp_guest_msg));
c5529418d05079 Nikunj A Dadhania 2025-01-06 2834 free_shared_pages(mdesc->certs_data, SEV_FW_BLOB_MAX_SIZE);
c5529418d05079 Nikunj A Dadhania 2025-01-06 2835 iounmap((__force void __iomem *)mdesc->secrets);
c5529418d05079 Nikunj A Dadhania 2025-01-06 2836 c5529418d05079 Nikunj A Dadhania 2025-01-06 @2837 memset(mdesc, 0, sizeof(*mdesc));c5529418d05079 Nikunj A Dadhania 2025-01-06 @2838 kfree(mdesc);
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki