crypto: ccp - Avoid page allocation failure warning for SEV_GET_ID2
stable inclusion from stable-v5.10.173 commit 4c33e01fe1d294b46c0212f213b8553e53604375 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8BFR3 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4c33e01fe1d294b46c0212f213b8553e53604375 -------------------------------- [ Upstream commit 91dfd982 ] 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:Andy Nguyen <theflow@google.com> Reported-by:
Peter Gonda <pgonda@google.com> Suggested-by:
Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by:
David Rientjes <rientjes@google.com> Acked-by:
Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by:
Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment