The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* arch/x86/coco/sev/core.c:2838:12-13: WARNING opportunity for kfree_sensitive/kvfree_sensitive (memset at line 2837) (fwd)
@ 2025-12-20 14:25 Julia Lawall
  2026-01-12 11:41 ` [PATCH] x86/sev: Use kfree_sensitive() when freeing a SNP message descriptor Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2025-12-20 14:25 UTC (permalink / raw)
  To: Nikunj A Dadhania, Borislav Petkov (AMD), Tom Lendacky,
	linux-kernel, oe-kbuild-all



---------- Forwarded message ----------
Date: Sat, 20 Dec 2025 22:23:02 +0800
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: arch/x86/coco/sev/core.c:2838:12-13: WARNING opportunity for
    kfree_sensitive/kvfree_sensitive (memset at line 2837)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Nikunj A Dadhania <nikunj@amd.com>
CC: "Borislav Petkov (AMD)" <bp@alien8.de>
CC: Tom Lendacky <thomas.lendacky@amd.com>

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/202512202235.WHPQkLZu-lkp@intel.com/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 <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202512202235.WHPQkLZu-lkp@intel.com/

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);

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-20 10:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-20 14:25 arch/x86/coco/sev/core.c:2838:12-13: WARNING opportunity for kfree_sensitive/kvfree_sensitive (memset at line 2837) (fwd) Julia Lawall
2026-01-12 11:41 ` [PATCH] x86/sev: Use kfree_sensitive() when freeing a SNP message descriptor Borislav Petkov
2026-01-12 16:38   ` Tom Lendacky
2026-01-20 10:30   ` [tip: x86/sev] " tip-bot2 for Borislav Petkov (AMD)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox