From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35F9FC433DF for ; Mon, 8 Jun 2020 23:47:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0368F20659 for ; Mon, 8 Jun 2020 23:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591660067; bh=qRpGoHHYzAVtaKwfm0+sO3dDW/r3U/cexmDYzuFn13o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zKBHeQyAqu56RJ0zsAWiMavuEeeUg+p/RRBHzEucT2435INj/pxoOpGDCCszqep/L t2kyNyKiWpoh6OoiiFmKSsGsfWHFTndi7j0yUlxqT35dn0dmyYXrROCKWBtZdhkDhn wzYCsaQasffUC4i6XL0J2b/FaEYj5Ib4ug295s6g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731519AbgFHXrq (ORCPT ); Mon, 8 Jun 2020 19:47:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:52854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731900AbgFHX0A (ORCPT ); Mon, 8 Jun 2020 19:26:00 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8CFC22076A; Mon, 8 Jun 2020 23:25:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591658760; bh=qRpGoHHYzAVtaKwfm0+sO3dDW/r3U/cexmDYzuFn13o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bX4UaeJECC52i9Cix0G1xSoqVzKhDgAzIJl49j2FmbxTdr+O1lp+y1ux4Mc/II4vH HEhFOZTjHk+xA8S+gMUQcPRIlrES2/ShE2BL7m5RvusCsbTLVVl6tPZNV1kRzDPzcZ wazEKqXI37SprFscyTvSSH1fXW/0/tXI8Cq+xTpY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Devulapally Shiva Krishna , Ayush Sawal , "David S . Miller" , Sasha Levin , linux-crypto@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 44/72] Crypto/chcr: fix for ccm(aes) failed test Date: Mon, 8 Jun 2020 19:24:32 -0400 Message-Id: <20200608232500.3369581-44-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608232500.3369581-1-sashal@kernel.org> References: <20200608232500.3369581-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Devulapally Shiva Krishna [ Upstream commit 10b0c75d7bc19606fa9a62c8ab9180e95c0e0385 ] The ccm(aes) test fails when req->assoclen > ~240bytes. The problem is the value assigned to auth_offset is wrong. As auth_offset is unsigned char, it can take max value as 255. So fix it by making it unsigned int. Signed-off-by: Ayush Sawal Signed-off-by: Devulapally Shiva Krishna Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/crypto/chelsio/chcr_algo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index 8d39f3a07bf8..99c3827855c7 100644 --- a/drivers/crypto/chelsio/chcr_algo.c +++ b/drivers/crypto/chelsio/chcr_algo.c @@ -2201,7 +2201,7 @@ static void fill_sec_cpl_for_aead(struct cpl_tx_sec_pdu *sec_cpl, unsigned int mac_mode = CHCR_SCMD_AUTH_MODE_CBCMAC; unsigned int c_id = chcrctx->dev->rx_channel_id; unsigned int ccm_xtra; - unsigned char tag_offset = 0, auth_offset = 0; + unsigned int tag_offset = 0, auth_offset = 0; unsigned int assoclen; if (get_aead_subtype(tfm) == CRYPTO_ALG_SUB_TYPE_AEAD_RFC4309) -- 2.25.1