Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3444711pxb; Tue, 19 Apr 2022 02:41:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+F3Yg8Xpo85+xxF28eR4EpMLdxBKU041qpVQ7Gvrzl+6qsCaLl4XXM06QpQOQ41sy9cQD X-Received: by 2002:a63:fc4c:0:b0:3aa:5b3:3d96 with SMTP id r12-20020a63fc4c000000b003aa05b33d96mr6693095pgk.525.1650361299867; Tue, 19 Apr 2022 02:41:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650361299; cv=none; d=google.com; s=arc-20160816; b=hu7dxjO0dDQvDPEbNFiEJPA01mXu1lVTCHHrfJe3FK7m4F/lOw9tDh+PnxEdBZsUAD C3T30Pl4D2MYMBzGPUGhvFyzG/9l14Bg5tAiwPU62Lo/axsAloS9qsJdKoPSEqJsfkYh uaZ+zOGzIvApVRPPZy+U1g2jWW/WIzzVrfhIEVT9s+6gpoWX6vAqtUPM4eH3ciXpUYJZ lth8eBcmkRGcSsr43Ni3W8PIY7Sh8L4aeLbuepTayRCb8YHBEnY626aujZPB1dyyNPuS 6GCfyevKW5U4Bk3sG1W+8xkjCbKS5kgP72pmLZH97+kSG8/XQ0PHYteHGO1nREeMZIv3 Jn4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XgzfLJfA9LU/lAm8xh5C9CKyVCDJ7sjkZHj9YeSNXgg=; b=WQoUoERDUBQfZBIad68fhZGSoEdI5AtrTUv6AnZR7wfS54ZeDbfZwUSmYBgvCsC0RT o4YWSJVhs/uhOfXIUysS/KAlXMlGHJgPPyEk+795WCOj/vGfB6uXpKHT3cbtGFXc5dsL zdz9sjTt5iAr42qaA//mB8H7eWj7khpun5Er/0szUMcG2pKkQeoZuvukBK92HvfSJPdH eR/2knhXZ4eRB3PXrsHRX6PRH3kKiLH9khcWRuuILfGNKYgnHbeKA8TXtztjZSd61WEE 12Lcaby6FH5yilzWn8aYzCqthrStF1ZBs2+RDZkQL/4D81cBsrLEwv29zmvS26RVRfga Musg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VhcTdB1G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k5-20020a170902ce0500b00156a2c84fc3si11157317plg.425.2022.04.19.02.41.24; Tue, 19 Apr 2022 02:41:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VhcTdB1G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242122AbiDRNgi (ORCPT + 99 others); Mon, 18 Apr 2022 09:36:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243756AbiDRNK0 (ORCPT ); Mon, 18 Apr 2022 09:10:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC5BE6172; Mon, 18 Apr 2022 05:49:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 77B23B80E4E; Mon, 18 Apr 2022 12:49:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B14E1C385A7; Mon, 18 Apr 2022 12:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286179; bh=F3GUFIFxn3xZhMHv+WyQhBku19qiHak4wQw1BJOJxO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VhcTdB1Gwta6Zrcrw5fdl1C+PSaNlLc41kcqo1xps/8j6zpZxhJCQpHjtkRWvDrXv Ls6Gr4So9td2e5cefrPm61tZA84BkJKPaBpFLJttpAYe4Jllmwg/5ouSaUACT2ufGR UsimkxXiPH2BEJtE7BO2hzP9yBt638fthqV6P0fc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomas Paukrt , Herbert Xu , Sasha Levin Subject: [PATCH 4.14 054/284] crypto: mxs-dcp - Fix scatterlist processing Date: Mon, 18 Apr 2022 14:10:35 +0200 Message-Id: <20220418121212.232001320@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomas Paukrt [ Upstream commit 28e9b6d8199a3f124682b143800c2dacdc3d70dd ] This patch fixes a bug in scatterlist processing that may cause incorrect AES block encryption/decryption. Fixes: 2e6d793e1bf0 ("crypto: mxs-dcp - Use sg_mapping_iter to copy data") Signed-off-by: Tomas Paukrt Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/mxs-dcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c index e986be405411..3e4068badffd 100644 --- a/drivers/crypto/mxs-dcp.c +++ b/drivers/crypto/mxs-dcp.c @@ -328,7 +328,7 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_request *arq) memset(key + AES_KEYSIZE_128, 0, AES_KEYSIZE_128); } - for_each_sg(req->src, src, sg_nents(src), i) { + for_each_sg(req->src, src, sg_nents(req->src), i) { src_buf = sg_virt(src); len = sg_dma_len(src); tlen += len; -- 2.34.1