Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2511122rwl; Fri, 6 Jan 2023 07:25:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXu9xgr/CqkiWZ6YPwaMpScAYCfYlPvlBzIranTxoXCCtRimn979LlHLTyre/JG+ZgQSt/HF X-Received: by 2002:a62:1550:0:b0:583:41aa:b4ff with SMTP id 77-20020a621550000000b0058341aab4ffmr2421225pfv.34.1673018709268; Fri, 06 Jan 2023 07:25:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673018709; cv=none; d=google.com; s=arc-20160816; b=b+Mckh6r5Rvn5U4EDZPbc6tNs24JwQ8r8ROM9JML9gOdWejLs7ZREI+vD7mJDk0zmf 7VF18Qlmp+pB8IAXn42AGJ3ZXV8hy7HhXC/NhwNZuGMgmKs/uHT/Zoz2RdBlqg11G2At 6/9/a7TMWB+EWA3UDQ5XMrkpwA7XZXrdDYJ64YoY0D7Gb2A70ihdGiYMLw23EtJyiUU9 2YxAXSHi8f0pYH5TkBICsE78lq/0xOD0VmkljXJXWWdQ9R4t3l8iUKO3hY6CaSSRkaKT Pgoe3Mn1T87WIEXQKnZReaXbRqiiRvyuW8/BQZu5mlo8by7fJrLNqqJ8tpqHWHSkpw0M LKHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=PfF539VJtdiZfUPsT2KV6WgO3HJ6WvOBfmznC30nMIg=; b=RX1YQZuJ8J+Mu+Fxltgaqu+hxurMg9teEWvkYmV7WcFxP1LyoIB9zLOVKil2RBqQTU gUwemGW+tLPpw7xE2mr5xv+gc7XoeUEtYzBfZ6Ef1nn1krB3Xz5Bi/bVV9uZW+O6Tnae T4TQaGOTJz1rf1zCestx35/IW/Et59lFK2oXumx1EInl//JQKwuCEhpoidLP0b4GVqyC CrrxY25KtUToT1zbMtW5g0WCYBJcjq4xUC6rcuiBLTZ94YKaEEuTn2A2l30OTtczin32 F+L9hyJvVRQOeTxychKX7tLRjiR3qXayIhnO6ZPoWgQG56gNskKN82wlBIC6xZI+8oTa QJww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g18-20020a056a0023d200b00571fe971a74si1741209pfc.41.2023.01.06.07.24.54; Fri, 06 Jan 2023 07:25:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbjAFPUD (ORCPT + 99 others); Fri, 6 Jan 2023 10:20:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234291AbjAFPTD (ORCPT ); Fri, 6 Jan 2023 10:19:03 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77825831AE; Fri, 6 Jan 2023 07:19:02 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1pDoUj-00Eby5-6V; Fri, 06 Jan 2023 23:18:58 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 06 Jan 2023 23:18:57 +0800 Date: Fri, 6 Jan 2023 23:18:57 +0800 From: Herbert Xu To: David Rientjes Cc: "David S. Miller" , Peter Gonda , Andy Nguyen , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, John Allen , Tom Lendacky Subject: Re: [patch] crypto: ccp - Avoid page allocation failure warning for SEV_GET_ID2 Message-ID: References: <20221214202046.719598-1-pgonda@google.com> <762d33dc-b5fd-d1ef-848c-7de3a6695557@google.com> <826b3dda-5b48-2d42-96b8-c49ccebfdfed@google.com> <833b4dd0-7f85-b336-0786-965f3f573f74@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <833b4dd0-7f85-b336-0786-965f3f573f74@google.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Dec 30, 2022 at 02:18:46PM -0800, David Rientjes wrote: > 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: d6112ea0cb34 ("crypto: ccp - introduce SEV_GET_ID2 command") > Reported-by: Andy Nguyen > Reported-by: Peter Gonda > Suggested-by: Herbert Xu > Signed-off-by: David Rientjes > --- > drivers/crypto/ccp/sev-dev.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt