From patchwork Mon Jul 29 10:40:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 169972 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp1099139ile; Mon, 29 Jul 2019 03:40:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNv+r/BqWvz2FHqDwr4gHvNghnKLulNY5qwirl4DmYOER0ymIi88tZS4WRXLVpIu217P/A X-Received: by 2002:a63:460c:: with SMTP id t12mr102877965pga.69.1564396838970; Mon, 29 Jul 2019 03:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564396838; cv=none; d=google.com; s=arc-20160816; b=VTInQ4OaRCc+1iU+SbVxWlQVKYPXIfhgp+mDg11npmDrA7aCmzjnA6FjygCDwcVNn7 X4CCBIP4u1ghGRN5Pa9ttWw9gLuGpWkXPYsikherW0UPeMVfGcdfvb6cxChNzNaMwlV1 tTnML8jANM4XhvqyuspOLC9NzHS5COXs361b80Hc2V1aTwPmTkZ6devNf2ZNY3PEAQza VDnToeSVfE583HT2w7IJEUn4GuWv4KNQ0w/cVqGfDBEiANbirhQk5GLLgKIXlrZnDbRw vhAOx9rS7mDoln03QX/UIZBYWubRSYbndctMhi9idb4JzLk5V32BbNZqInnOOqczRLAM R5zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=r+UzC5jXNU598C76nOyAnAZifygAtan+m3MtpkNyahQ=; b=cq3bFD7ZZH09XfrPHFWSbQnJk4+V6opPcc5i/Rgelle6Q4OIdpPQ8FSyFgHfFh1Ept XX0hd365f+hkGhTy2Ku4jtONFJjb23zQovW5uHV3OZlZa++sO6Bx+2eKTr27Q4rgOki/ W6Hs7YuqOukRqIASGYCqPgucta3ef1jZqv1pTAAJRTDj6XhZEgk6KnXtkuBycGMIoBkg 0qga+wImabDvtRbnQmGTFvCTmod2DY0pGIcuc+Z/jrV7rOIlGBCQaCp8o0pqiHz7RW6o 0y0JyOVcBWNjtXn51umGIZTrif8kNaHG4GpVwSyamKEV0oXBs2wxiEMvpbF3NFQOto/M oi1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l70si24782477pgd.363.2019.07.29.03.40.37; Mon, 29 Jul 2019 03:40:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387424AbfG2Kkg (ORCPT + 14 others); Mon, 29 Jul 2019 06:40:36 -0400 Received: from foss.arm.com ([217.140.110.172]:41736 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387428AbfG2Kkg (ORCPT ); Mon, 29 Jul 2019 06:40:36 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 561F7344; Mon, 29 Jul 2019 03:40:35 -0700 (PDT) Received: from e110176-lin.kfn.arm.com (unknown [10.50.4.178]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EF1643F694; Mon, 29 Jul 2019 03:40:33 -0700 (PDT) From: Gilad Ben-Yossef To: Herbert Xu , "David S. Miller" Cc: Ofir Drang , stable@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] crypto: ccree: use the full crypt length value Date: Mon, 29 Jul 2019 13:40:18 +0300 Message-Id: <20190729104020.3681-2-gilad@benyossef.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190729104020.3681-1-gilad@benyossef.com> References: <20190729104020.3681-1-gilad@benyossef.com> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org In case of AEAD decryption verifcation error we were using the wrong value to zero out the plaintext buffer leaving the end of the buffer with the false plaintext. Signed-off-by: Gilad Ben-Yossef Fixes: ff27e85a85bb ("crypto: ccree - add AEAD support") CC: stable@vger.kernel.org # v4.17+ --- drivers/crypto/ccree/cc_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.21.0 diff --git a/drivers/crypto/ccree/cc_aead.c b/drivers/crypto/ccree/cc_aead.c index 19abb872329c..8a6c825d40e8 100644 --- a/drivers/crypto/ccree/cc_aead.c +++ b/drivers/crypto/ccree/cc_aead.c @@ -268,7 +268,7 @@ static void cc_aead_complete(struct device *dev, void *cc_req, int err) /* In case of payload authentication failure, MUST NOT * revealed the decrypted message --> zero its memory. */ - cc_zero_sgl(areq->dst, areq_ctx->cryptlen); + cc_zero_sgl(areq->dst, areq->cryptlen); err = -EBADMSG; } /*ENCRYPT*/