Skip to content
Commit 91dfd982 authored by David Rientjes's avatar David Rientjes Committed by Herbert Xu
Browse files

crypto: ccp - Avoid page allocation failure warning for SEV_GET_ID2



For SEV_GET_ID2, the user provided length does not have a specified
limitation because the length of the ID may change in the future.  The
kernel memory allocation, however, is implicitly limited to 4MB on x86 by
the page allocator, otherwise the kzalloc() will fail.

When this happens, it is best not to spam the kernel log with the warning.
Simply fail the allocation and return ENOMEM to the user.

Fixes: d6112ea0 ("crypto: ccp - introduce SEV_GET_ID2 command")
Reported-by: default avatarAndy Nguyen <theflow@google.com>
Reported-by: default avatarPeter Gonda <pgonda@google.com>
Suggested-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
Acked-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 8e613cec
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment