Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3091108rwb; Mon, 15 Aug 2022 17:54:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR5xezC2J3Op5c3QnimhLIcTILvPkgxerHAa9zmQ/e/o9IbUk4Nf1OBsMlKZ9i9jwrBKBifL X-Received: by 2002:a17:906:8a6c:b0:730:a322:6f69 with SMTP id hy12-20020a1709068a6c00b00730a3226f69mr11753954ejc.585.1660611280774; Mon, 15 Aug 2022 17:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611280; cv=none; d=google.com; s=arc-20160816; b=0C+1jSCWgQWr6fSjR+RpV259k4DLoktW/sASJV3hr0v1ZdS2jDZcg3zteO9ELFHKYj YHeRCd8gJnsSS8DfUJdnXUFDr9kOwYJnl3NylllPVYu8leVg+SPaSP5CJwBun+vx/ERz C2TeYerwYqW9eb4CBPjYI12EtftDzuBPIMX4sT0tUpdJNOkC2evKm8gFZhprMEeBvik4 0LugrnjOKFNYBK9UIaDDzXFztWB+NdYkOIXsLkYc4zvYPWrB9eoNS0antTI2D9E0ga1E D3dnDWOs+KajKYP5hJEH42+VyjJjN+zB3hbQ3aaTbbB077mS5wJE397U8SLVyI0MA2r8 Zl8g== 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=SXWaAwROfwhTkjGU8R0C6NtoAJEyPMvGDTDsMqXR1O0=; b=Nt47BTBzvyamQjaFtZ+0B9+Ycb32DNAGbLETA54iVaa4rJlKAOlHdxQERcrCNRXbiw Db/MAybr6E6gsoIgqppE7Tvf/D00FCdBuI4JRL6sLy9PUWE9/ucIRXFP+yGdm2ijzas5 9k5J4x8Wn0tdqATndwfGeuFPlIa+g4gNZXuxl3+9tlRs0UJ8omJ9hKZ+mgWq9S3KY0ta 9wNnw26oexDQiU2+aeySkkUeA8s61BBC8VZvoR1sP0yS4PlJ9NnDliz6ve8x5l0tdFLr bCQq5Zq5s3K357WJN+RzQi3a6VqRASCUG8b0QjjaGb1Vq+chsxg6OplB65ImGTPtWzya ETkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QpfzIWao; 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 e20-20020a50d4d4000000b0044052e86694si9046022edj.377.2022.08.15.17.54.14; Mon, 15 Aug 2022 17:54:40 -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=QpfzIWao; 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 S244913AbiHOXeU (ORCPT + 99 others); Mon, 15 Aug 2022 19:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347572AbiHOX1b (ORCPT ); Mon, 15 Aug 2022 19:27:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BFBFD5EBE; Mon, 15 Aug 2022 13:07:18 -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 850C56068D; Mon, 15 Aug 2022 20:07:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EF45C433C1; Mon, 15 Aug 2022 20:07:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594036; bh=U9LEU0PNPrUcv/u8DbqdvwnTORGar03sf6rsAhm7UPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QpfzIWaoaQo04O7Ze/Vga0iC50FoV5TgUZQkyH6dBSXI2y0ruQK/3ZU/YkQz255bL ucW5mJRkbfrf9y2HkcPihSbKZn0+pPPqP2wBdYPYCyvmxoc75IvjgELSuiMzQtooCJ 4gQuWeleJWWz2htbO8HlmsomloK07+WR4/mRAvc4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Khoroshilov , Corentin Labbe , Herbert Xu , Sasha Levin Subject: [PATCH 5.19 0365/1157] crypto: sun8i-ss - fix infinite loop in sun8i_ss_setup_ivs() Date: Mon, 15 Aug 2022 19:55:21 +0200 Message-Id: <20220815180454.322392241@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 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: Alexey Khoroshilov [ Upstream commit d61a7b3decf7f0cf4121a7204303deefd2c7151b ] 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") Acked-by: Corentin Labbe Tested-by: Corentin Labbe Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- 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.35.1