Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4247013rwl; Wed, 28 Dec 2022 01:12:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXuZbA4rbKS/5FTqbpUXeJmh/cCAK3lrwa8wzkiHGZ/0HBaFmPC/Cdeha4I+qTqtUr+HFW7X X-Received: by 2002:a17:906:1410:b0:7c0:dfb7:4476 with SMTP id p16-20020a170906141000b007c0dfb74476mr18771863ejc.57.1672218758814; Wed, 28 Dec 2022 01:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672218758; cv=none; d=google.com; s=arc-20160816; b=TKeX4klIJLq73BZqr80KAuN5MQlgcBAkaLsbHElh+amu+ga/g7CP0EFqGcelOzrpFH vFjgTIipzM7dkdomdFNf1DJej4ELwuZHLKeeSoH1o97rQ/4Vehyw/df1VP+nz/jjoEsb FK37nAYqxpXpME+qoflL+1MWzs8bubESHQriEyQpAdo5fJDKhRnkfgjEspXX4dK4V7Se Gf55SG7AGa6zx0h11ey+BHTg9kPeu9vCsT9uE99PRSms4229ztKjMa/xrJs18P4214qu hhg/+gXCoAocmgRwBsCrhjLaSPhxeqqdywqVOssbeeNsaulQHdKNuHGsHCivfuDT7tqj D5RA== 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=4H6oIlYieZDIotEDq8TeYuLZ0PglGjPeeS9Y4g+g7Hc=; b=smpYxETo+O7vA8gKO9rqL28arNhs9WK/y06OBVblW9wIo4EwP/JmlqcpafCwrInUlh kZ6qTOdtXb51KvDuNYCvvCkkII+Vj9dw+/djIMM7hD58u4X1rdK4jc2MXpa2hwo4qbrs STPkmJVUUuOMXIYSDtwOnu1T67E0v7suOCvm5MjIT+2LlGX8vZOGHu0JjNvGa4xYCVu1 /sTT2MzA+xwbI9P1+gl+QXVpGyPCligeOozVonBtOxmMQYfzKjJ9oJDoGozErylZ0IAN T81SgKkGn4IwLEQJzlqoWS2PQmE1k56Vjk1e+vYtWrSQrBK31TU3IX3ErFQAG0vZsJ7S yjYA== 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 t13-20020a170906178d00b007c16fb7f178si10412757eje.962.2022.12.28.01.12.15; Wed, 28 Dec 2022 01:12:38 -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 S230024AbiL1IuA (ORCPT + 99 others); Wed, 28 Dec 2022 03:50:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbiL1Ito (ORCPT ); Wed, 28 Dec 2022 03:49:44 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFAFE268; Wed, 28 Dec 2022 00:49:43 -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 1pAS85-00BU4A-0b; Wed, 28 Dec 2022 16:49:42 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Wed, 28 Dec 2022 16:49:41 +0800 Date: Wed, 28 Dec 2022 16:49:41 +0800 From: Herbert Xu To: David Rientjes Cc: Peter Gonda , Andy Nguyen , stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, John Allen , "Thomas . Lendacky" Subject: Re: [PATCH] crypto: ccp - Limit memory allocation in SEV_GET_ID2 ioctl Message-ID: References: <20221214202046.719598-1-pgonda@google.com> <762d33dc-b5fd-d1ef-848c-7de3a6695557@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <762d33dc-b5fd-d1ef-848c-7de3a6695557@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 Tue, Dec 27, 2022 at 05:42:31PM -0800, David Rientjes wrote: > > The goal was to be more explicit about that, but setting __GFP_NOWARN > would result in the same functional behavior. If we're to go that route, > it would likely be best to add a comment about the limitation. > > That said, if AMD would prefer this to be an EINVAL instead of a ENOMEM by > introducing a more formal limitation on the length that can be used, that > would be preferred so that we don't need to rely on the page allocator's > max length to enforce this arbitrarily. Ideally the limit should be set according to the object that you're trying to allocate. But if that is truly unlimited, and you don't want to see a warning, then GFP_NOWARN seems to fit the bill. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt