Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1674828ybt; Thu, 25 Jun 2020 11:21:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0bH5cQ70oZIvmEbMTN4FmaEWY8DL06YvN+MAxR4VWdOjgu59oVeyM39pTrsf2VE18geaE X-Received: by 2002:a17:906:3e84:: with SMTP id a4mr29157283ejj.372.1593109293079; Thu, 25 Jun 2020 11:21:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593109293; cv=none; d=google.com; s=arc-20160816; b=sFbvwr2K0VFdcQRbF0CDDW/zOKmRtqxZcmAKMyjDgPt/XD1C6IXwzGtrdQ+KRxZGmF 5qpW/2HKwfyTQX9/Hcy2QVWLubKR8KgKViAXB0x1KrdyhBiMT0GD7xlXMMKujVaUjvy1 ibQfn3MBOS26D80LEPqM+opx4tv7DPQNy8Nq6ZhSY/qmzfBvk+TS3NZyCJD1aVEjdx6W +XLoWA/x45sjLnd2yQoOi1hMBX98bS1hW+GXxoOkNwL9eu94JRIAYS5k3aX2OkzSyJ5Q d8Rvm7mfl1zL1wgmyD2kNUxnj+lFKWFTOuo3pIXG7/hcGhMjOEe2pKkjqZFQjVGgHdWi THCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=BHGTrPD5/Gu2QrGvpjjdCGdJfaOmK0aeMS9ch0QhpBI=; b=Q3Iwp7xlrOAMGoKHP79fO65sySSOoW3rmz/SBbzk688c/KGHlvEElxerwQMWDHRCJ6 Lj8dQgmvh7oOMvA+qQ3t0Vck31A+2EP9CuUsJGCZiff/x2hZ+hoiZdYKLjf8BInJ2lUB xie1sT/oJT4mUPeH8GlpdiUBjAt7LgVpiWbDCVK0cwbRxpFwhi3Q1PmUUu1SAIvh6XX9 gC6mH+7lohxA/MT8mKGulOwiUHP/wR4ss7zlghU6SFpKXxX8UYtN6XW1Ro84rjRhn6S0 7A+Q+X0ACZ4XtAV+jigGjyHsc2ZsO6yQOK0R1Qz5iBL8r2Z2p1R2ASZH64Xp9jzzfWTE Mssg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si8898659edx.581.2020.06.25.11.21.09; Thu, 25 Jun 2020 11:21:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406464AbgFYQpL (ORCPT + 99 others); Thu, 25 Jun 2020 12:45:11 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:55632 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404697AbgFYQpK (ORCPT ); Thu, 25 Jun 2020 12:45:10 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1joUzp-00048R-IT; Thu, 25 Jun 2020 16:45:05 +0000 From: Colin King To: Ariel Elior , GR-everest-linux-l2@marvell.com, "David S . Miller" , Jakub Kicinski , Michal Kalderon , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Igor Russkikh Subject: [PATCH][V2] qed: add missing error test for DBG_STATUS_NO_MATCHING_FRAMING_MODE Date: Thu, 25 Jun 2020 17:45:05 +0100 Message-Id: <20200625164505.115425-1-colin.king@canonical.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The error DBG_STATUS_NO_MATCHING_FRAMING_MODE was added to the enum enum dbg_status however there is a missing corresponding entry for this in the array s_status_str. This causes an out-of-bounds read when indexing into the last entry of s_status_str. Fix this by adding in the missing entry. Addresses-Coverity: ("Out-of-bounds read"). Fixes: 2d22bc8354b1 ("qed: FW 8.42.2.0 debug features") Signed-off-by: Colin Ian King --- V2: use the error message as suggested by Igor Russkikh --- drivers/net/ethernet/qlogic/qed/qed_debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/qlogic/qed/qed_debug.c b/drivers/net/ethernet/qlogic/qed/qed_debug.c index 57a0dab88431..d9dfaf214f6b 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_debug.c +++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c @@ -5569,6 +5569,8 @@ static const char * const s_status_str[] = { /* DBG_STATUS_INVALID_FILTER_TRIGGER_DWORDS */ "The filter/trigger constraint dword offsets are not enabled for recording", + /* DBG_STATUS_NO_MATCHING_FRAMING_MODE */ + "No matching framing mode found for the enabled blocks/Storms - use less dwords for blocks data", /* DBG_STATUS_VFC_READ_ERROR */ "Error reading from VFC", -- 2.27.0