From patchwork Thu Feb 11 20:01:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 381029 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp2372230jah; Thu, 11 Feb 2021 12:02:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUFSGDhI0P4Ns3UByeUF2VSB9DwvAPFyt6PEmvEpdaFu9oNeYSzVwl3IpxGhvTA3M/I+Rn X-Received: by 2002:a05:6402:2683:: with SMTP id w3mr9866758edd.378.1613073754177; Thu, 11 Feb 2021 12:02:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613073754; cv=none; d=google.com; s=arc-20160816; b=wV7TgBCRPkBrdfkSb61soNiqj247uqjMCmT+1zUkvDH//GI6RI+m07DsMcwoYUqmw0 qv40AymCzVGcJH3Zi2An1UNnPZlWhlG2RUcqG0dPV1vJmCQ4DU9tBtfwq413SprYdnj0 zOdnkHK34Occoh5LaTRa6XWLxEKNG/MsTjlirZc+EF6q2Lnx30/XBM+cyj/nqkSvRP0p VxBR2bU1/yA6SBOpezor1hm5j0RwfBldJbhMsd/xcqPTggE7T66Hr19CiOE8tAgbVyqw K0jC6aGOGbQRYEXqn1xYqe5OEZ5oxoQVsuE+DcF3W4ZtQjLIvNbHFk1KLfw+dnjAF0zO /WtA== 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=BkNbbxb6k/17zzJxBEIrJhvukJWdWW3RjEBbcBFX430=; b=ynYSXhGLt07qEqCaDMqw/xImrLyP1gWDkeplf4k90l4hfWqXaSK8IdAyBe49BqvUoB 65WPXe0EE7JArD9sFpiIFVP7D30UenF7MuBk0+etk9cvTuorXEpVHCDfofsCdtLloMSr /m3nD2OYLEXDl4NdBcOzuUqeB4wtrEpugYvmlvegQENrj2fdeErzGk7oKAl6ZbSDpTQl H0IJ9O/VG72J8JCVq0SO0Zx3+wyx3FZ4ixlk2kgJrCxAK/ywIoht4yewKmCShDS4Inzh GWkVxilxOglckY9eJWDTBZ8brUEm/WIK31ATYholQQBfvQ9L4pvkjGx8shVVGqiW4CdG ysmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aLSfsFsw; 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 kx25si4474079ejc.434.2021.02.11.12.02.34; Thu, 11 Feb 2021 12:02:34 -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=aLSfsFsw; 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 S231395AbhBKUCS (ORCPT + 2 others); Thu, 11 Feb 2021 15:02:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231273AbhBKUCK (ORCPT ); Thu, 11 Feb 2021 15:02:10 -0500 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22227C061756 for ; Thu, 11 Feb 2021 12:01:30 -0800 (PST) Received: by mail-qt1-x82c.google.com with SMTP id o21so5109717qtr.3 for ; Thu, 11 Feb 2021 12:01:30 -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=BkNbbxb6k/17zzJxBEIrJhvukJWdWW3RjEBbcBFX430=; b=aLSfsFswKuq9oi6QHQPnxX1RgBgaK69pFL1L25ki5cIqOfjEXzg3hvSdsjnS+kj2nU SZUlACzn16zviRTySn580vyva3PmeMoLeehw98PdlRD0Iufjhzo89I1MomR+ZyGWutwU 55PH3cGa2gTrKT4ShFyFJ1xbwW+RuRAAXmT0nJu4F5iucnr/NhiPblSuT+LM4D/10aSM iaRJdyC8H3gAJ2UmO+bY9iVlz/invqKTzrCk4bU/DexCpblvFSiQrLPTbQiQeGfuc0qF AaPCG77p3y0SNk3p70KVfaoxx2Vq/zmjUnzGgBhnWx/A52fWk+0LJz/fL9zaYMrJ62rC 4OEg== 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=BkNbbxb6k/17zzJxBEIrJhvukJWdWW3RjEBbcBFX430=; b=l4dsikQ950S4TOMS63ywshiH0FoogdXld1caDRHT5fMkQLU2/SHejvisvxmMZWAImu 80jIZ0q4MeBJC+d/2B63kWYQ2OrPKgjgRNNsl599JBrD+XyjGRuQYimDuh3Gpv+zhLmY GemOvLkhulqvqF0q7dlXTFR7Z4DClOMWwVwgAoPar5ICb8ZYbZAWAs1iC1Egj/r1zTTu ShdD3Xd737c/I7/EQz+U2H06Hq6gyUxmANIi1mvK78e2xsJiJgr8zYuxO0Jqg0APTXtu LyFnBR6Df+1xxO1A5s0e0/XznX0TiRFNIiSfxQnB3ZH1LixzpSAKaJ7z4GOpuohdt2YZ hTgQ== X-Gm-Message-State: AOAM531X/v7Gs6N8LnyR1sfJc4RIaZ0CN9gl1rali+cI1dFJnCkPFPIg u6InL387tDFCC53PIZHHDjZACA== X-Received: by 2002:ac8:51c7:: with SMTP id d7mr9020352qtn.302.1613073689253; Thu, 11 Feb 2021 12:01:29 -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 17sm4496243qtu.23.2021.02.11.12.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 12:01:28 -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 v7 00/11] Regression fixes/clean ups in the Qualcomm crypto engine driver Date: Thu, 11 Feb 2021 15:01:17 -0500 Message-Id: <20210211200128.2886388-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. v6->v7: - Fixed sparse warning in patch 4 as pointed out by Herbert Xu. This means the checking if any two keys are same for triple des algorithms has been reverted back to using conditional OR instead of using bitwise OR. - Rebased to 5.11-rc7. 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) *** BLURB HERE *** 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