Skip to content

Commit 864884a

Browse files
nikunjadbp3tk0v
authored andcommitted
virt: sev-guest: Replace GFP_KERNEL_ACCOUNT with GFP_KERNEL
Replace GFP_KERNEL_ACCOUNT with GFP_KERNEL in the sev-guest driver code. GFP_KERNEL_ACCOUNT is typically used for accounting untrusted userspace allocations. After auditing the sev-guest code, the following changes are necessary: * snp_init_crypto(): Use GFP_KERNEL as this is a trusted device probe path. Retain GFP_KERNEL_ACCOUNT in the following cases for robustness and specific path requirements: * alloc_shared_pages(): Although all allocations are limited, retain GFP_KERNEL_ACCOUNT for future robustness. * get_report() and get_ext_report(): These functions are on the unlocked ioctl path and should continue using GFP_KERNEL_ACCOUNT. Suggested-by: Borislav Petkov <[email protected]> Signed-off-by: Nikunj A Dadhania <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8234177 commit 864884a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/virt/coco/sev-guest/sev-guest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static struct aesgcm_ctx *snp_init_crypto(u8 *key, size_t keylen)
141141
{
142142
struct aesgcm_ctx *ctx;
143143

144-
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL_ACCOUNT);
144+
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
145145
if (!ctx)
146146
return NULL;
147147

0 commit comments

Comments
 (0)