Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1077914ybl; Wed, 14 Aug 2019 10:20:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwP/GpyfQs03B3RZ3DBLrzrN7kup94DwQ6SYIxAF7bdGHPSv3hEQSL2z7tMnOOzLZxF7YI/ X-Received: by 2002:a63:7d05:: with SMTP id y5mr193734pgc.425.1565803201534; Wed, 14 Aug 2019 10:20:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565803201; cv=none; d=google.com; s=arc-20160816; b=MAzHF31G9Y5fTkTw+oRR3QD8bnZvGVrSW9fKJA18ioAAzEJhiQptkb2efNbzs4NFWQ qontL0jG5ki4xu8TgG1ZOln9RdFKP93I5oR5536gltA9wMi6/vYAFRGGpX97m21jgRUd M7M8FcZYaREFKSKU8S54w052d8tfW290lXQH9l+JbuBSvQvzZGHpIuT7pSF1NFBb1iqC 4u20JGGqacp72+t0/n7vxwWeVYqbQGdQSPh8qJAYjijrktfhqdU9MtOUzPS/b4pslD56 kD6NtFDfvTSzFjjemb2s/ils9BJ232wo1nMh6ayGo99uhcd/+uTicaCTAhk0mcok5c3H Sv/Q== 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=u0ZW98IPMJlubYd1Qww6sgaUvMbnmd8nr0aorICTBWg=; b=CsfB8RNmS1rOr5csq1xeIH+3Eti/7di2S0x7MOyCQN2pVD1Vn+s6G+BtEfCUTd1TQq ZewowYGHjxRrIHUBrY4trHTj2e30kV4iwfDziH/vCjjdhFHBJ84VrR1rRFBSVXiijIQz QICA2rTaaoHmNrp3zqJ0RLbS9tfyQSP5Loz9GIcvFy7RBuHFODKgG8zOXq7HIfUen8qa 9jOIwtKwLld6jOq+2Uej/9wfw2v4mdaLq/Q+xj4jkMTxoZk+qJd+HCkydYJOSAu8nXZL Jce/Iil+eriomcpBGSNOYx6yHteeSn1GEtamrmMdtDibaJlHOdosg6pkJmlg2IGEE2mz V8vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gbxcTkGT; 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 m10si187451pjs.85.2019.08.14.10.19.45; Wed, 14 Aug 2019 10:20:01 -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=gbxcTkGT; 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 S1730765AbfHNRMg (ORCPT + 99 others); Wed, 14 Aug 2019 13:12:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:36464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730332AbfHNRMe (ORCPT ); Wed, 14 Aug 2019 13:12:34 -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 858812084D; Wed, 14 Aug 2019 17:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802754; bh=s6FgJYfNgOiYJdk98S53txAk4fmhvuTEHWOb5pEm2x8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gbxcTkGT24C47ZAy/LOarh2ZNh6ukCccbfq6ECchURVxYtA82YwP2BMAwSXbW2lbC o6lCvyx7c2wS2fHe0+3+sO3rCvdPKi8ishRnEElLNheQrJCt62qwN1MnvXhCNnSWKW guNx8rZVYl8OKlH+sCJWwnRTDKpCWyNoFIEHiecw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gary R Hook , Herbert Xu Subject: [PATCH 4.14 03/69] crypto: ccp - Ignore tag length when decrypting GCM ciphertext Date: Wed, 14 Aug 2019 19:01:01 +0200 Message-Id: <20190814165745.372646143@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165744.822314328@linuxfoundation.org> References: <20190814165744.822314328@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gary R Hook commit e2664ecbb2f26225ac6646876f2899558ffb2604 upstream. AES GCM input buffers for decryption contain AAD+CTEXT+TAG. Only decrypt the ciphertext, and use the tag for comparison. Fixes: 36cf515b9bbe2 ("crypto: ccp - Enable support for AES GCM on v5 CCPs") Cc: Signed-off-by: Gary R Hook Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/ccp/ccp-ops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/crypto/ccp/ccp-ops.c +++ b/drivers/crypto/ccp/ccp-ops.c @@ -752,8 +752,7 @@ static int ccp_run_aes_gcm_cmd(struct cc while (src.sg_wa.bytes_left) { ccp_prepare_data(&src, &dst, &op, AES_BLOCK_SIZE, true); if (!src.sg_wa.bytes_left) { - unsigned int nbytes = aes->src_len - % AES_BLOCK_SIZE; + unsigned int nbytes = ilen % AES_BLOCK_SIZE; if (nbytes) { op.eom = 1;