Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14724853rwb; Mon, 28 Nov 2022 04:26:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf6pO5yLlO51w1BZv4IYSyXugWvOKevyGkat2aFyttHsL7vJbr1vCjfgEr1nE2snmCNKxf+r X-Received: by 2002:a17:906:4cc1:b0:7ae:50c6:fd0a with SMTP id q1-20020a1709064cc100b007ae50c6fd0amr9254655ejt.184.1669638377297; Mon, 28 Nov 2022 04:26:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669638377; cv=none; d=google.com; s=arc-20160816; b=GCPAbWf7danHTVN4uAj1nouR18I9tU/aIlcTmCvWyEsSuuY3Gy9OaFgz9ENz+MrkX2 LTlE8zRgH2jKV+1g8HIx4kWm7Tyf6rL46Wv9nvQJQgvZrCUDEvsmxCy0GGS2QvKWECu8 yGnHUIjyhM0Djzcbx04h5mPJTxLsFMnnhTdjch2CO3sYiJe/ReWGjurIWbW63BG4KfwW YQbRuCAmZhR7K8SUqJcdSxM3uc9sSojQBasowL3N+VivXzxHyFZ4BrKZBAqCVk471W6M CdJaMRpO/h7emcyGTc0lU9rx+RPHrpOV3ZxRvz+bD91C3psuNH597FN2ydjXnSkUwhn/ 4hZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=klWn6s9HgqXSJFGTMwfnlQ5gmz0ingAf7NVXALtqelo=; b=Kxhlp8/JNrEDNdC+WlSbTQVfXQjxERbgI1nOpJtaubxugYepro/9hcOf6k0aPuEHAo zdEZFd0OQog+zQfJi6Lg1y8vKfPt66/PEOGvWD2vBdqgplH2//CbxJFkB40OsugC7dO4 UAgiuV3xPd1qh0B9eXBRUOt1mKVwVvUlmYVG/5OxZvd6PAlGFLQol3AKQtyNB5RxVodl l4/vJ3ftdX4sQvtgs6Wqh0CmOsVtquqs1xffBLp1uN8xz9bvqRBV751HmM9ub6OuDk/b O3QDbUwuTd7W92SNAIAviljZASqD25aUU764Ia17j7rUSLEjc0f8dLyDJJ8t89e11M9G Wl8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lVRfKVjt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go36-20020a1709070da400b00781b6ce15e1si11533756ejc.101.2022.11.28.04.25.52; Mon, 28 Nov 2022 04:26:17 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=lVRfKVjt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbiK1MYY (ORCPT + 99 others); Mon, 28 Nov 2022 07:24:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230513AbiK1MXb (ORCPT ); Mon, 28 Nov 2022 07:23:31 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 901D9F37 for ; Mon, 28 Nov 2022 04:21:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669638117; x=1701174117; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jtrjTLoFxeHXbBXIQ2xVpfJgMN0Z3onTRjpMjDRlHBU=; b=lVRfKVjtPA22QhkSX5nxQAOe07k09e4KooDfbiS5qNjsktn78tHcZEzP td6BNPd5qq547K2yXQ7q9EXCY3yJ42ndSZlV/BIVDdqN0k5Il55CFzoI7 /oU8Ll/gHSVJUTu4ya2P5wexS25aUEn2Ao+pV99YmVavBo9n3zepvIN9G y5Dr2TNiJc90Wz//wGDifv/nQU4uHhmVR1ik1RSt7RDjqCtTX5vetDXRj VILKRVRhkQbsN0UQMkiuZ0cirEO5KBUHYS+nlorSKG1sUGLjfoq4OzN66 JG6lw05AiHzpOb/T/iDKXQjKIDnM3rtFeWEhkej4K92xKUQ/33LbwnRgX Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="313517855" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="313517855" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 04:21:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10544"; a="817806190" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="817806190" Received: from silpixa00400314.ir.intel.com (HELO silpixa00400314.ger.corp.intel.com) ([10.237.222.76]) by orsmga005.jf.intel.com with ESMTP; 28 Nov 2022 04:21:54 -0800 From: Giovanni Cabiddu To: herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com, Vlad Dronov , Giovanni Cabiddu Subject: [PATCH v3 11/12] crypto: acomp - define max size for destination Date: Mon, 28 Nov 2022 12:21:22 +0000 Message-Id: <20221128122123.130459-12-giovanni.cabiddu@intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221128122123.130459-1-giovanni.cabiddu@intel.com> References: <20221128122123.130459-1-giovanni.cabiddu@intel.com> MIME-Version: 1.0 Organization: Intel Research and Development Ireland Ltd - Co. Reg. #308263 - Collinstown Industrial Park, Leixlip, County Kildare - Ireland Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 The acomp API allows to send requests with a NULL destination buffer. In this case, the algorithm implementation needs to allocate the destination scatter list, perform the operation and return the buffer to the user. For decompression, data is likely to expand and be bigger than the allocated buffer. Define the maximum size (128KB) that acomp implementations will allocate for decompression operations as destination buffer when they receive a request with a NULL destination buffer. Suggested-by: Herbert Xu Signed-off-by: Giovanni Cabiddu --- include/crypto/acompress.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/crypto/acompress.h b/include/crypto/acompress.h index cb3d6b1c655d..e4bc96528902 100644 --- a/include/crypto/acompress.h +++ b/include/crypto/acompress.h @@ -11,6 +11,7 @@ #include #define CRYPTO_ACOMP_ALLOC_OUTPUT 0x00000001 +#define CRYPTO_ACOMP_DST_MAX 131072 /** * struct acomp_req - asynchronous (de)compression request -- 2.38.1