Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1080222ybl; Wed, 14 Aug 2019 10:22:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdEn4kxJR4TtekKH86FO7DaqlLbLIuZVuR0UZJ6s8y9x/UAprxzvOusKxoOjWjrb7T9xBR X-Received: by 2002:a17:902:b285:: with SMTP id u5mr418411plr.329.1565803343759; Wed, 14 Aug 2019 10:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565803343; cv=none; d=google.com; s=arc-20160816; b=oJT8DTs875E8MYJJvh+X39tvxMlbHVs44o2/O2eJmJe8I0SNNxlh/ZF+bXYZ1MbDSZ PH9zs8blX2uea+XkBEXouvNllt7YBfkVKJEPDh1VuBo/aLXZWoNQ/cK48eWQLyr+xOCR Y898L7FvDFLwBAeuTSONmJJerNP8mt3CAifg7Y60nhcMOkPO5C9dW3XObI3G5F1IgXcl lJTFwvF37ahP0UMHAPzY3OQ9USmGd5H1AvLWxK4Ruqz0NEUgPD9b3+GejZdlRl5DPYA5 qucgbTtAxAwTturRdCPYAEIf91V7DBxYs+yueaFwDfPiqLFZprfsqJ79cd1T+5c1q8G1 08Uw== 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=OsT/lwZPQ2rsVZcBWMR9/rDic99x0laVhy+ARE51nOc=; b=mjlX9j5tv8HfQ4t9DolBFm3xJzNy6mzfPBUh7mWTXwwatuUwQlKufBV8Vod4sTNimH yV8W9UQt9JDhVwi/qd3cb0qpMlQF5dcfqA9BrdUwq10afzM9ZlBw1BQLCZyR0ZRZ7Clh jVokE4iSSpclQ+8tkfLo0yVfIGM52hf3VeOGq0F74tElAFNjphs4qWJMoJVBJxWasaqC KBEzgwZxnJhgTXmm6pNS+Wex1Q4lSb/rftWNUiaSj/qvUlXb/0X3z+fYzqu7xf0mYM+S /O56Tw5J/9wOpNSNYfEheMszaINUY7OXDczDBVQ0Id3pSTQTqoX150F4yMW/Yf0DZMDA hYAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WIHElwq8; 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 b8si211939pgn.56.2019.08.14.10.22.08; Wed, 14 Aug 2019 10:22:23 -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=WIHElwq8; 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 S1730377AbfHNRJn (ORCPT + 99 others); Wed, 14 Aug 2019 13:09:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:60174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729904AbfHNRJl (ORCPT ); Wed, 14 Aug 2019 13:09:41 -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 76395208C2; Wed, 14 Aug 2019 17:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802580; bh=hk+BW2g498HkjhgTTJ87szRPCj5bd3Unj3WwSKMmQNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WIHElwq85bjTD7crVgekgmHBveEUoPLDxxiThVVvk0d5J1FITy8KNJtQ7SrQL18xM cmVksLNc4M9mlgWRyelwSfPCfHmblF/UpL95WE7ciSnWUNXssrd1g2e1BKga1zTOlm WYJWfnq/vMV32GL5xgXpgQ8VGJrtvF84hTfYPpH8= 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.19 07/91] crypto: ccp - Ignore tag length when decrypting GCM ciphertext Date: Wed, 14 Aug 2019 19:00:30 +0200 Message-Id: <20190814165749.388040530@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165748.991235624@linuxfoundation.org> References: <20190814165748.991235624@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 @@ -785,8 +785,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;