Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp666081pxb; Tue, 5 Apr 2022 17:57:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdyuOMQ1g9DJQFO8qT2fIjXWlm8Z28OeTmCVqRATqf03GnJfo5Hs0cm1AzkcommnLulaII X-Received: by 2002:a17:906:58d3:b0:6da:bdb2:2727 with SMTP id e19-20020a17090658d300b006dabdb22727mr5978952ejs.549.1649206667272; Tue, 05 Apr 2022 17:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206667; cv=none; d=google.com; s=arc-20160816; b=zL63PjMN/KMhdq/JVzyzC1oBbwCMA7DjOE+r8mrtIe74IsZ7rdsvZ0SBd6bHt+CS8t 6Wrux17djLWWO4s8hGEb5c/tAGZcWnW1Hmz9FeYICwOn/y3fmZ/bX/bajC18bjLmcTMJ Y3xvlX4mQ9BEFIPy/o6owFy7QVvbvzQPpJfJ5V5gOIXwHvQERvhW5sHVhuFdo3ZOYsU6 jmuEySVqkwRc+Pl4bHSvYtJ2W5u0Ww4mCwuGDu7QcgoFMpRYp90FQuuCZuGu+66kG0Jp SwLifRS9u7YOLITk9g8C64mWEJNVZiuWqJ8GBwC8ysqev3vVtdS6h5QvraHQruUrExTI iyRQ== 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=E9PS8Wijb2WV4gOegdSMiBV43mKQpIHucR6rYWAbGM0=; b=fIU+0kbd9xy1CqoG+sSPCbFkyOhwuG3/DRt0zh+OevYpcxC8CmXHqxGbUs2l0pmnsc vhn/yDZRp5uRRmL5QGtIgtqcqPYJ13X9xPqdjE70ZdcmftdRFEH0tx7s/bN6URHssAAT MILPGf+ZEfDB+oLYhIkKEYBJXVjgACwvk1XyMoTfracW1pS0ggVbQqXuP2f1fMREgSYd Pp24YCnZO7qR+0+2lOBp/OAXWcn29eNfSyq4NHcix/xUt0dtRVeY73lOQmlal6IoYcKt UTb+CKGv2V4CXImjC2kGKxxZMiwf9XCa3x4HuJD1fHubHSCCt3EIVJIs+ZyMQnNeLzBn WLcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=caR0yiW2; 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 g4-20020a50e044000000b00418c2b5be2bsi10257488edl.269.2022.04.05.17.57.16; Tue, 05 Apr 2022 17:57:47 -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=caR0yiW2; 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 S1378160AbiDELbr (ORCPT + 99 others); Tue, 5 Apr 2022 07:31:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244378AbiDEIwB (ORCPT ); Tue, 5 Apr 2022 04:52:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03567D5566; Tue, 5 Apr 2022 01:40:55 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 7D25360FFB; Tue, 5 Apr 2022 08:40:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85956C385A0; Tue, 5 Apr 2022 08:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148027; bh=o2hdrjC/PgYjbZe3JzicMJHQaxwlPlqG/ztutGUT8Go=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=caR0yiW2tAkJ2gxiBcA8lmYyZ2Auh8/Quu0V+8qSjWmISCaXNt49g5SHtBnX57whm hSVRE9VVASOtXPcoBdgEugyZ5/romho5LCC4qghp47yERZuhmkm4GDUTelIjjynOV+ ixY6Z/syiB9Wk56ORk6sRT9tWAEyGG3ozp0DZrlA= 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 5.16 0208/1017] crypto: mxs-dcp - Fix scatterlist processing Date: Tue, 5 Apr 2022 09:18:41 +0200 Message-Id: <20220405070400.425105561@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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.1 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 d19e5ffb5104..d6f9e2fe863d 100644 --- a/drivers/crypto/mxs-dcp.c +++ b/drivers/crypto/mxs-dcp.c @@ -331,7 +331,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