From patchwork Thu Oct 10 08:35:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175716 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1980428ill; Thu, 10 Oct 2019 01:45:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrQ0yDzt3tbU0REYHQEd929mW0KbSzF5quE9iU6MCWjbhwmQ7UEZ3ppmASCp7yqJg9JM/P X-Received: by 2002:a17:906:a88e:: with SMTP id ha14mr6809273ejb.92.1570697125318; Thu, 10 Oct 2019 01:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570697125; cv=none; d=google.com; s=arc-20160816; b=svEfCo1AaDKo32XXose3hBebWAG2daNUEinWviu2VtxPxFVg9gdvlwTHgJczjPFw6D wpb8jq2QoWna/KLuKBy0LMJVKNnhwA8qLsSBbNds0+DOZtbLJsK1uUdeHESBAXEwFjF5 K//TE3ToU+58aka9wRKIwPQnAb24SU+RQhb2Mn6COMihxrgVPrjuQz6laTpmcftDJALS epVV1U1h5pqD1mCNxNrUDHK8Po19NgC+JfIiC7V06MVLOw9kiQk+NPqAUfPR+FUctCFM CFXIXCAGh1ISR+NX16+2nooPeKV8mhJ9ScE+cynCcu3LKC8ApW3MIbj9jXn2YtsYkMhu SCJg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xzunCaB/1lXWA8njgxihmYT5N88JnlcqcIrxV8y9XJk=; b=j9nX4VdsrYFyX3QOP5xJtoRyv6nGyzCLMGGg03rP/Hod5ardrdx5DMB9OLvkAjJrCd 6GWF37nU7ECSOlrOdBLQf9FtNI/Nc9WMNLROu1uU6z4E9xt25GOZSUdMj9B9U+m+tqYP aS1ykkTqcCzUxE27BgUraNFbBJXn5A444Xx+IR4wyCIy6W4/aAa1Sb7wlUbDAjq/L+82 AQpaQlDmWWjZ5wgLpfUEaKMPIMsg7BvzTGWgfpq8SD3ClJI7bqJljNOJx9WGLF4rLNvG WCyydWipZl8N6MY2AszKu9oRHLh3rAf1LKugb3bC3I2DIX8b4qWE3noX2+DE4hg7aXHj xplA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GA7uD6YA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 a15si2682155eda.222.2019.10.10.01.45.25; Thu, 10 Oct 2019 01:45:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GA7uD6YA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387711AbfJJIpY (ORCPT + 26 others); Thu, 10 Oct 2019 04:45:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:50928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389123AbfJJIpW (ORCPT ); Thu, 10 Oct 2019 04:45:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 827E921A4A; Thu, 10 Oct 2019 08:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570697122; bh=+ziAXTDsobAVyPGnV9cjpxWdeSyfaxpVevwpVRrRxBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GA7uD6YA8BupOk4XpI2BQxBRgD6rkD1B5k0bj3BEAs0r+DDgb40x9ACiG+kmbBwug mB5Dpggfbqez0GGV+g5x/4E6ePhn9jwWNSFEEclGYsDdGkLysxmrOHKWmg18lkYNoJ zdOfC4K+oW2D4EXd6H7xqcjztLCjI1n7zFOfrrNU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gilad Ben-Yossef , Herbert Xu Subject: [PATCH 4.19 026/114] crypto: ccree - use the full crypt length value Date: Thu, 10 Oct 2019 10:35:33 +0200 Message-Id: <20191010083556.445175875@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083544.711104709@linuxfoundation.org> References: <20191010083544.711104709@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gilad Ben-Yossef commit 7a4be6c113c1f721818d1e3722a9015fe393295c upstream. 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+ Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/ccree/cc_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/crypto/ccree/cc_aead.c +++ b/drivers/crypto/ccree/cc_aead.c @@ -227,7 +227,7 @@ static void cc_aead_complete(struct devi /* 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; } } else { /*ENCRYPT*/