From patchwork Sun Feb 7 14:39:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 378108 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp3953822jah; Sun, 7 Feb 2021 06:41:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyL6lXswvCMZqsEmakoGSYq+KnOhZbO+VyE6/PeAFlYv/+SXaDZscnRSYvjCzBgce3IXVZM X-Received: by 2002:aa7:c911:: with SMTP id b17mr2692024edt.382.1612708914777; Sun, 07 Feb 2021 06:41:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612708914; cv=none; d=google.com; s=arc-20160816; b=IlB+dnDLy/oe4qkzYTBPOSdZZLTnpn0WrfChcE2rjLrzErBjlq+hvS5yhlri9eq0jw R+iQTjCFIw7+/6bNuFa1eLJs0SBjq6+P8T8BinBX+gNPNV/O8Uhp1hv3o+pRUbkcCv2e caw4lNG66K0xTHdjPXn9sro7MB/oViLVImVpItJoRzYF5Q+VD7AR++L/YJGL1H9TfLeG Z7Oxi78VWjuTctB0ZYtqFTnAtZ1Pa2hOmE5XjmQOgBa7sUappcnLWhgOI3eA1RWMYwWf Osp12EgdcZ5iHSRlnefKMM7myWPpNsZsKReEdvD0+k5PRpixFW6nStVQpt8Gl6kZJHJh GFKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=oxGs1yBu+RHlc7f/sQSTfaUp4aGAp+KSIV/KFpeORIA=; b=Fpvhk12bBaZmPCVwooqhFsL74+oFC8rWkgziQf+4ANbLQ/errhcvz2jWBW4TdIGuh/ unjzfYtsH0r+47QfmywhKdbsqwhBvMlzzSAqDQYvJhWsN4zUbqm1oNMp+KuEob4pdTBA 2n0udje6G3Sqo6S+VyAKQe4gb7krLYcKES27BwanZb+ssO9nqvG0aN402yv8Qiqk2XNz jHUD4ZpAbc0uWw/fAccrXNhW4dj7KlAikj1xGQsAU2Tpt8DL3osAvMVVCc+g/gYD10zl lAWkR1fCIFP1aQPHpGehJoz95MjFnWj1xlC4oB75v1tWrk9TSFQDpirWDUNWa8aP9cwW K/PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uTiCSSpc; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g26si9550734edy.55.2021.02.07.06.41.54; Sun, 07 Feb 2021 06:41:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uTiCSSpc; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbhBGOka (ORCPT + 2 others); Sun, 7 Feb 2021 09:40:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbhBGOk3 (ORCPT ); Sun, 7 Feb 2021 09:40:29 -0500 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBA89C06174A for ; Sun, 7 Feb 2021 06:39:48 -0800 (PST) Received: by mail-qk1-x72b.google.com with SMTP id u20so11932880qku.7 for ; Sun, 07 Feb 2021 06:39:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oxGs1yBu+RHlc7f/sQSTfaUp4aGAp+KSIV/KFpeORIA=; b=uTiCSSpc+2us0Sf62KQQXb9V1tJWZouXjNCJRweu7WIXEPrM+lLUBhwSJH5rtxZ5sC J9MME7WswVDWYUV9oJN1hEB3BuW9mVAL6btAnjIrDwVm5C5gbtADtlDSQ7+KnzIx/45Q qSZOhTUU2U1ZkIq7ljVkGWF4cXq0JDjCpdejNErswEpY1TejHZQwq133Tb/vqG28bd2d JUOO06zfItsWtO286BXh8aW+efnamudomJVn0PQQvj67GKLE2YI3LJ1H5P1e29fMKRbg qZ73fC4r7q3NMAEeA/hnFAUe6S82zjK0/TzDTuaHkLpDgMTNxw7g7j3VSso+YIxRzlcq URgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oxGs1yBu+RHlc7f/sQSTfaUp4aGAp+KSIV/KFpeORIA=; b=G3UoRjYU3mnPjvE7/0O4hfiJInaUtA+yQNH7EqsewpmYiP9w9Jn4lMoU51GP2KzsK/ VhJz6mzcA1yubBn6B6wRiG5MS6nPy/DpZ1S1+Cmotsbv32Ry/EUyZurYkuG4f79oqjxM F/woivyVqCLeJt5a8w9noVNkKky4h6xTgx+IhgdzUiIlbY+KH6Xpwmc6s4AaFYC0U776 ytg1ZFOnb8DeuBX2+pBkAcQnV7KMpRLqjWJVIJitX4HZNbPL0XgNbqFmDfeHzT1iO6iz ziOj9pKz9I66ZMG6bfHx03wNGs5Kfna5XShUfyZiG9Yk2hcBZ/MfzWy2JcWBTbVbb9ZE 9Irw== X-Gm-Message-State: AOAM5300tidDMda5dCSMFzCdsrQJnzTmoNF2F+cUtBQVi8ubADHryWaE s+3M+6tdH4MGpkf/FpRfdUkA99UuqgzPoQ== X-Received: by 2002:a05:620a:1485:: with SMTP id w5mr11750002qkj.201.1612708788069; Sun, 07 Feb 2021 06:39:48 -0800 (PST) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id c81sm13941493qkb.88.2021.02.07.06.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 06:39:47 -0800 (PST) From: Thara Gopinath To: herbert@gondor.apana.org.au, davem@davemloft.net, bjorn.andersson@linaro.org Cc: ebiggers@google.com, ardb@kernel.org, sivaprak@codeaurora.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 00/11] Regression fixes/clean ups in the Qualcomm crypto engine driver Date: Sun, 7 Feb 2021 09:39:35 -0500 Message-Id: <20210207143946.2099859-1-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch series is a result of running kernel crypto fuzz tests (by enabling CONFIG_CRYPTO_MANAGER_EXTRA_TESTS) on the transformations currently supported via the Qualcomm crypto engine on sdm845. The first nine patches are fixes for various regressions found during testing. The last two patches are minor clean ups of unused variable and parameters. v5->v6: - Return 0 for zero length messages instead of -EOPNOTSUPP in the cipher algorithms as pointed out by Eric Biggers. - Remove the wrong TODO in patch 6 which implied that AES CBC can do partial block sizes when it is actually CTS mode that can as pointed out my Eric Biggers. v4->v5: - Fixed build warning/error in patch for wrong assignment of const pointer as reported by kernel test robot . - Rebased to 5.11-rc6. v3->v4: - Fixed the bug where only two bytes of byte_count were getting saved and restored instead of all eight bytes. Thanks Bjorn for catching this. - Split patch 3 "Fix regressions found during fuzz testing" into 6 patches as requested by Bjorn. - Dropped crypto from all subject headers. - Rebased to 5.11-rc5 v2->v3: - Made the comparison between keys to check if any two keys are same for triple des algorithms constant-time as per Nym Seddon's suggestion. - Rebased to 5.11-rc4. v1->v2: - Introduced custom struct qce_sha_saved_state to store and restore partial sha transformation. - Rebased to 5.11-rc3. Thara Gopinath (11): crypto: qce: sha: Restore/save ahash state with custom struct in export/import crypto: qce: sha: Hold back a block of data to be transferred as part of final crypto: qce: skcipher: Return unsupported if key1 and key 2 are same for AES XTS algorithm crypto: qce: skcipher: Return unsupported if any three keys are same for DES3 algorithms crypto: qce: skcipher: Return error for zero length messages crypto: qce: skcipher: Return error for non-blocksize data(ECB/CBC algorithms) crypto: qce: skcipher: Set ivsize to 0 for ecb(aes) crypto: qce: skcipher: Improve the conditions for requesting AES fallback cipher crypto: qce: common: Set data unit size to message length for AES XTS transformation crypto: qce: Remover src_tbl from qce_cipher_reqctx crypto: qce: Remove totallen and offset in qce_start drivers/crypto/qce/cipher.h | 1 - drivers/crypto/qce/common.c | 25 +++--- drivers/crypto/qce/common.h | 3 +- drivers/crypto/qce/sha.c | 143 +++++++++++++--------------------- drivers/crypto/qce/skcipher.c | 69 +++++++++++++--- 5 files changed, 126 insertions(+), 115 deletions(-) -- 2.25.1