Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1637737iol; Fri, 10 Jun 2022 11:28:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkRB8tr73jOFWX7Qjl31OQj+oX+vmPnkd5Nxi8eJ8oBn8+melLZDpvuXfN7+H1HvPJlt4A X-Received: by 2002:a17:906:149:b0:712:c8:fa53 with SMTP id 9-20020a170906014900b0071200c8fa53mr10194936ejh.563.1654885733454; Fri, 10 Jun 2022 11:28:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654885733; cv=none; d=google.com; s=arc-20160816; b=mc+9mpKByJiZBON/Eps7spMVccMRgOID4FCDMaj/BHK+2+Rnyi8/BFRAmnCJmp4Eos fpTJbI6cY3hiuZypdK/hGDjXs5eSuawRQPZR4fDoauNWRbzZEbr7qYh2AzzMYYP07out HPykxXyeBnloGR5pW/QU8jq7KTnKi7MtcTH1CXnSrRQT54DSBdP7uHYenvklu3ejsBxA 0AklBVINu2aZrfdVUM5DfHgwuvzTiN1D9NWxYuZMrnCXFpUIC0uJLx75Wy2QzkNFH4yp t3U2YixquUNP1XXRkoyt4i35Q28oSq9X2nJAi79YRIiqlvGxJOiwSZ1osVoEEBoLeJ16 vTfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=u14lgcrKB9SJKRTKuttlAalVKX2GJ/pjbgRIHg3ADS8=; b=ASS/4SIfZJa86W0yHRBEKZv7CAMrxH9sOhBhGC2cTMizxV3Cx/1HoLOgIYZSPBAl0X v5ADHbJMxznqm1vATBHRpl7mUlhIBRbhq1eZqakEzOIOl5mlIyguCSz5l3zc72gD1s5Q 8170LbEG6JOeeezwBcp1VIANM2DGno1yQBOKlhgTMq1hHBjEXgBmhuV2sRlyxtmuVZg5 JfgCQFTNXSUwZXTSdCTk/RlHVDZV2g2/Y2pJeGtMRMapxntqw9X9ftcvYKlREi4wI85i jPbuV1p1DyGWDtfmx5yJLe6E9WGnVCQgpxKjvyuW49/qoJ6dSLB1GEv6wlc3Dot/7zp9 nFFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ep15-20020a1709069b4f00b006df76385ec8si12237010ejc.872.2022.06.10.11.28.16; Fri, 10 Jun 2022 11:28:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350302AbiFJS1i (ORCPT + 99 others); Fri, 10 Jun 2022 14:27:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349791AbiFJS1d (ORCPT ); Fri, 10 Jun 2022 14:27:33 -0400 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 923AA38DB2; Fri, 10 Jun 2022 11:27:26 -0700 (PDT) Received: from hednb3.intra.ispras.ru (unknown [10.10.2.52]) by mail.ispras.ru (Postfix) with ESMTPSA id 35B6E40737C5; Fri, 10 Jun 2022 18:27:24 +0000 (UTC) From: Alexey Khoroshilov To: Corentin Labbe Cc: Alexey Khoroshilov , Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] crypto: sun8i-ss - fix infinite loop in sun8i_ss_setup_ivs() Date: Fri, 10 Jun 2022 21:27:15 +0300 Message-Id: <1654885635-32290-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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-crypto@vger.kernel.org There is no i decrement in while (i >= 0) loop. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Alexey Khoroshilov Fixes: 359e893e8af4 ("crypto: sun8i-ss - rework handling of IV") --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c index 5bb950182026..910d6751644c 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c @@ -170,6 +170,7 @@ static int sun8i_ss_setup_ivs(struct skcipher_request *areq) while (i >= 0) { dma_unmap_single(ss->dev, rctx->p_iv[i], ivsize, DMA_TO_DEVICE); memzero_explicit(sf->iv[i], ivsize); + i--; } return err; } -- 2.7.4