Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp282076iob; Tue, 3 May 2022 17:26:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxd4xXgGGJGn0y9V42NKYCEyFiHWojJ+y3//J36g1CIu370a5AAkf8pff5oLu+FoPI+WT9B X-Received: by 2002:a17:902:b906:b0:14f:76a0:ad48 with SMTP id bf6-20020a170902b90600b0014f76a0ad48mr19352422plb.79.1651623978941; Tue, 03 May 2022 17:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651623978; cv=none; d=google.com; s=arc-20160816; b=M71wcIKy1QqQVdmce5gmlMkbDnc4+sviaab+1vgEsCzEbX72n5fOICntMR/3PbCho0 jfpHVnLOnNFPpm9yPnLGm/0+8AEjtZB7dBJW/7NKLGjXhQhT6a6+IjVm3s41eioOunFR dpmAMxAHSAwR5HdC2DoboBhSzRER/LCjudKlTICO3lfKj4hnwfhBdMTNCoZ6Twbfi+Ll gpXcWaxEBGRtZozsBgFJdjvoHG+JFW8uGBDh9ARinHKiOooQgbkRhNJ5fx3+O6trvWZF /42neJY8fQfjkBRSe9eyJEq/htfNeZ/Pu4JaECC3X9770opxu76Qp1rYt6ve+3uLR0I2 YF8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wp9YHmXDYvM0vTO+lxeqnR+ljJmF4tJFHnGldB3QeSU=; b=qG1rwHP+1Zd/ePHP/jwCRGePGVD1HjsWqGXwxhDGPQPCjfGCKA3V4wFEuw/+6qmWqU 0IYSWl4lWtVAXTfmeWbUctZE31t59DYTIdG+fatk1nH1bJ9IjuP49guI2D8p2AzH6kYn PwvbbviOedExe2HKphHVDakrmhiMU++qy1KlCaNBp+6fa32QBCZtRqUKoJtZ8f8HOrJA HXojg76MXM9D8lavquCMcNz/ZOXDk8glWSIrh2lBG55FAS9LlB///w96CgOxUxZWM0QF cOIdKms7D2lVX2X2QfHmL/gl6ut4pAWPhA/SJHSDGQTCQw7izA4z4n2/RiBmlve0g0eN M89A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KV+iCsZr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 21-20020a630015000000b003c15242c486si18668906pga.787.2022.05.03.17.25.22; Tue, 03 May 2022 17:26:18 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KV+iCsZr; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239181AbiECQOw (ORCPT + 99 others); Tue, 3 May 2022 12:14:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239067AbiECQOv (ORCPT ); Tue, 3 May 2022 12:14:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E99A91EAD4 for ; Tue, 3 May 2022 09:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651594278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wp9YHmXDYvM0vTO+lxeqnR+ljJmF4tJFHnGldB3QeSU=; b=KV+iCsZrOzhbduvirDB7peZOcv31XrhO1V+6Do33dz88wlWwBi6aUr85NKYDNQ3SumWk2X 0kYGN7b5RCD5nVeNYsL6YFroe1c8CJQZan8jFafcF2txyMlij4icweqwQdoA5quW62itd7 9zko9at3W/cf0Ym+HlfcrKOCtOeOFNk= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-272-qvKtlpFoNOeptQT-4sDiRA-1; Tue, 03 May 2022 12:11:14 -0400 X-MC-Unique: qvKtlpFoNOeptQT-4sDiRA-1 Received: by mail-qt1-f197.google.com with SMTP id s26-20020a05622a1a9a00b002f3a45205d2so5182994qtc.0 for ; Tue, 03 May 2022 09:11:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wp9YHmXDYvM0vTO+lxeqnR+ljJmF4tJFHnGldB3QeSU=; b=YLwglMnfaVw2o70Eidm8qG9TfYb1zQE//XJowxyDLf3Re5fluYLUwGwihDICV3BMeZ CRXKaWf1kBKtNALmZ6ViJrOINy1bg/DJjul6iESdqxX0xVEybd55IwojqIcUzpmfAcZk kitE16jLfAJnLkqbB1zjgFEx5fS0thvSv/DN0IQrzrRNjGBM6qLqzZ2ouTXmi0E3+Pfe 1VEnh0gJ5+mtOl5OCPop6nBggM0FlooTFONxRVL6eq4V4snN6hWFfew/qeAcDzTqYnQp GkADQUtSc4KJXupP2M5cTeVgCEoX/ki2xPKtnr1OZpqfmncw4oWTht+1Wd/hIbuFDbQk 2mTA== X-Gm-Message-State: AOAM531DIdMsapOlTWrW9oQfm8zoBU2lZFxMOrIFpEsesxuyFxL0Gwlf FTJOc/5j0/7Asw9XSsKRxyZgLySbrMwBDj4Qte+dA4Jb38zYM9gGuIIMwIyF37L9+IfgG2Cs5fq TwQEh/6elViF0x08jN5cG3Qp/ X-Received: by 2002:a05:6214:1c8a:b0:443:bc78:25ef with SMTP id ib10-20020a0562141c8a00b00443bc7825efmr14197043qvb.2.1651594273452; Tue, 03 May 2022 09:11:13 -0700 (PDT) X-Received: by 2002:a05:6214:1c8a:b0:443:bc78:25ef with SMTP id ib10-20020a0562141c8a00b00443bc7825efmr14197011qvb.2.1651594273166; Tue, 03 May 2022 09:11:13 -0700 (PDT) Received: from x1 (c-98-239-145-235.hsd1.wv.comcast.net. [98.239.145.235]) by smtp.gmail.com with ESMTPSA id f22-20020ac84716000000b002f39b99f679sm5846102qtp.19.2022.05.03.09.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 09:11:12 -0700 (PDT) Date: Tue, 3 May 2022 12:11:11 -0400 From: Brian Masney To: Ondrej Mosnacek Cc: Andy Gross , Bjorn Andersson , Herbert Xu , "David S. Miller" , linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] crypto: qcom-rng - fix infinite loop on requests not multiple of WORD_SZ Message-ID: References: <20220503115010.1750296-1-omosnace@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220503115010.1750296-1-omosnace@redhat.com> User-Agent: Mutt/2.0.7 (2021-05-04) X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,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 On Tue, May 03, 2022 at 01:50:10PM +0200, Ondrej Mosnacek wrote: > The commit referenced in the Fixes tag removed the 'break' from the else > branch in qcom_rng_read(), causing an infinite loop whenever 'max' is > not a multiple of WORD_SZ. This can be reproduced e.g. by running: > > kcapi-rng -b 67 >/dev/null > > There are many ways to fix this without adding back the 'break', but > they all seem more awkward than simply adding it back, so do just that. > > Tested on a machine with Qualcomm Amberwing processor. > > Fixes: a680b1832ced ("crypto: qcom-rng - ensure buffer for generate is completely filled") > Cc: stable@vger.kernel.org > Signed-off-by: Ondrej Mosnacek Reviewed-by: Brian Masney We should add '# 5.17+' to the end of the stable line.