Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3421390ybh; Mon, 16 Mar 2020 23:17:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vswkn0usfm2nrUG0RiBRUj5rQwJib88p6zenm+OxFwwgbGXGgtb3oTv1RAORbw0c6yNzLEN X-Received: by 2002:a05:6830:1d7:: with SMTP id r23mr2584805ota.153.1584425860025; Mon, 16 Mar 2020 23:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584425860; cv=none; d=google.com; s=arc-20160816; b=tbs8eKBllMRSUVuoptjmfWBDqUkkAt3ncCf1sqRuhfTSMCPXsQLqI3OV7HbF4JSjGO 843Yad+TNCQPwRDShXmeHX+eiKfepcLQxJZyiT59wxEYLRws5A2o80XdtFO7+FXdEp1d RVt+mtXeOJ/BCIk22KWH1Udqo7mhd+ynt4ss2ejQfF64BHmhYdhWKMvBL1/JMQxYwf5Y B2/F5LCLTXWVSaPMdnvuaLbSGv3pgbdg8DOIV3HJqHZzEyJl4bKyUaIva0dseK8m9RsX js0Poihga1FL4NrxB5mCgZIyEw9z+G834igo2bErDlOQMKQ3WU/LAESttu0K7Q1vLSHN lq1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=4uKrmSwHk8ZXHwztJyPdkY9OYtglcBK8wm4ihe7B9yo=; b=GyikAi5KXDmkq3n4RHO7znrToyIu5T0cEajlHNjj7eIYz1oQMHDiG7r9BXl4aiRPsB YK/N3bL4qCUyLHiOfgEaHaf7JNj8DCMO5TunUGq/hpjMF0t6x4RaB3yo9BlsVDyFJN0i 54Hp6l88Q30cgRF0YQYpYxCHZoCAknDxkK9GY8NArQLutYB84a3K5PxkHAMghRLR+WYM 8VVm9HpG3u4bv4LzuWDJryCkEXDEpNsaZ/geDzjOfrgzFG8PU4CsHQ9s/e28Jgc1MvoQ 0WPvRVoanTVXzkJrbBMwx0LRfYe3/Tm10LW7tVX2JRL52h4qTZAPC1pK9WnazfLWTbc6 YRtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=edZ+cFRG; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si1195033oin.182.2020.03.16.23.17.28; Mon, 16 Mar 2020 23:17:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=edZ+cFRG; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbgCQGQQ (ORCPT + 99 others); Tue, 17 Mar 2020 02:16:16 -0400 Received: from mail-wm1-f53.google.com ([209.85.128.53]:39462 "EHLO mail-wm1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgCQGQQ (ORCPT ); Tue, 17 Mar 2020 02:16:16 -0400 Received: by mail-wm1-f53.google.com with SMTP id f7so20536500wml.4 for ; Mon, 16 Mar 2020 23:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4uKrmSwHk8ZXHwztJyPdkY9OYtglcBK8wm4ihe7B9yo=; b=edZ+cFRGN2iBYT1vsyYbuS9LXVvpxNczEkabaQnHKLyqLRAiWjGPtue+ijG7hF4eoC dTZaQglxFWMlXwwLSg9GbreZxdbBcVKU2XNO53icNbvnmoYk488WTwJMGdz9DvSrstBc K40wQwu21togqlxyxPOPRFrkqhzMe6M189l7Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4uKrmSwHk8ZXHwztJyPdkY9OYtglcBK8wm4ihe7B9yo=; b=ZKVSGQuQiIxKZfQ3FGfCl5+wzRfi1/ZFY/tgKuteO00cNoASRscagbE3FYAATQMdht cWqB4SktN99tndDduOfqnxOHfKtaDXDWfrW7T2jrR+xRQlntNokpvqvO51C2nDpYRbM2 dA+H4rhEVImxLCKM0LyK8H+1tfLa4Zn2ZrG7ClAZn+Rjq6iEftNp8aqC9ZsbxXI8ztOB RyVkzAWgeHgiERWoXOcGSThlIPo/Z69MnIy/Cwx3NKewVfcBOb9u/r+GQm0M2//gpu1u Ofp21C2kC7kBxfVIiE0DWyzKhdxTylRz1/rrtF+2KSB/oZ0yEw1WMrABr5E2fdqViaKw +d1w== X-Gm-Message-State: ANhLgQ078so2Yg7XRmK4xZnQ6R1c7EA6buDN6KVgrldvjqmPC4ydpCvc ADXFnLjTZhgwYYXiPBTGOEbzLw== X-Received: by 2002:a1c:f214:: with SMTP id s20mr3169425wmc.57.1584425774187; Mon, 16 Mar 2020 23:16:14 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id o5sm2658096wmb.8.2020.03.16.23.16.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 23:16:13 -0700 (PDT) From: Rayagonda Kokatanur To: Dan Williams , Herbert Xu , "David S . Miller" , Allison Randal , Kate Stewart , Thomas Gleixner , Greg Kroah-Hartman , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rayagonda Kokatanur Subject: [PATCH v1 2/2] async_tx: fix possible negative array indexing Date: Tue, 17 Mar 2020 11:45:22 +0530 Message-Id: <20200317061522.12685-3-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200317061522.12685-1-rayagonda.kokatanur@broadcom.com> References: <20200317061522.12685-1-rayagonda.kokatanur@broadcom.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fix possible negative array index read in __2data_recov_5() function. Signed-off-by: Rayagonda Kokatanur --- crypto/async_tx/async_raid6_recov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/async_tx/async_raid6_recov.c b/crypto/async_tx/async_raid6_recov.c index 33f2a8f8c9f4..9cd016cb2d09 100644 --- a/crypto/async_tx/async_raid6_recov.c +++ b/crypto/async_tx/async_raid6_recov.c @@ -206,7 +206,7 @@ __2data_recov_5(int disks, size_t bytes, int faila, int failb, good_srcs++; } - if (good_srcs > 1) + if ((good_srcs > 1) || (good < 0)) return NULL; p = blocks[disks-2]; -- 2.17.1