From patchwork Sun Jun 14 22:39:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 213770 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61350C433E0 for ; Sun, 14 Jun 2020 22:39:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36FB0206D7 for ; Sun, 14 Jun 2020 22:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727963AbgFNWja (ORCPT ); Sun, 14 Jun 2020 18:39:30 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42931 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727924AbgFNWja (ORCPT ); Sun, 14 Jun 2020 18:39:30 -0400 Received: by mail-pg1-f195.google.com with SMTP id e9so6768047pgo.9 for ; Sun, 14 Jun 2020 15:39:30 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=3rcGI+lv/GbDLHyVBFGFYQmwCj9Q/jOfgKgD1DKG3V0=; b=jDWAFj4DzdnVvhC/0E4rmj6Bmcw7lT7FlrKLNJpEuD3xxCQO6a6MpOyE/FAi4s4j5A zlRQoRwv0sZON7nrcEodJHJQ9I6eFpVU9KanNmnfTzvaD/Z6GmZ6L5sOZG2WGlTpVH7Y rxCvfYRyeaovDKqCHMiAPr6yOPydaLXWWZ1lQpDeGScpJKlcXNYThbDrUdG+s/ze6Fvp AXXebVnqRACuvQT3/lonMT9BJc0Yn7OPaqUvDRrMEWjljjTrMZo7WsFXXv7vA70pInLo 95v3UwsPO1QC4DryBk65EQni6XBSU0edG3S6nwAyXSaC/XiVrJMjIiQbWV15Q9WkN87J ZCfA== X-Gm-Message-State: AOAM533085NbpRZUCgtHOZqowuFU3XIPs7Y7fBbQo/y6jKUKz2dY0lJQ xCCqYjCFvI5re5CcruGqeOk= X-Google-Smtp-Source: ABdhPJwfoRpGNdwQJWUpkU+FYRH7/3RXlygYw9d61/ayQuqajQ5aDMy5SzulJbVMf/pB7CDjzvCKTg== X-Received: by 2002:a63:e314:: with SMTP id f20mr6123589pgh.116.1592174369589; Sun, 14 Jun 2020 15:39:29 -0700 (PDT) Received: from localhost.localdomain (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id u25sm11768711pfm.115.2020.06.14.15.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2020 15:39:28 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , Quinn Tran , Himanshu Madhani , Daniel Wagner , Martin Wilck , Roman Bolshakov Subject: [PATCH 1/9] qla2xxx: Check the size of struct fcp_hdr at compile time Date: Sun, 14 Jun 2020 15:39:13 -0700 Message-Id: <20200614223921.5851-2-bvanassche@acm.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200614223921.5851-1-bvanassche@acm.org> References: <20200614223921.5851-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Since struct fcp_hdr is used to exchange data with the firmware, check its size at compile time. Cc: Nilesh Javali Cc: Quinn Tran Cc: Himanshu Madhani Cc: Daniel Wagner Cc: Martin Wilck Cc: Roman Bolshakov Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 188aa5f02c01..f7e9b5bc0b26 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1971,6 +1971,7 @@ static int __init tcm_qla2xxx_init(void) BUILD_BUG_ON(sizeof(struct ctio_crc2_to_fw) != 64); BUILD_BUG_ON(sizeof(struct ctio_crc_from_fw) != 64); BUILD_BUG_ON(sizeof(struct ctio_to_2xxx) != 64); + BUILD_BUG_ON(sizeof(struct fcp_hdr) != 24); BUILD_BUG_ON(sizeof(struct fcp_hdr_le) != 24); BUILD_BUG_ON(sizeof(struct nack_to_isp) != 64); From patchwork Sun Jun 14 22:39:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 213769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 038B9C433E3 for ; Sun, 14 Jun 2020 22:39:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D05972071A for ; Sun, 14 Jun 2020 22:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728001AbgFNWjh (ORCPT ); Sun, 14 Jun 2020 18:39:37 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:50438 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727994AbgFNWjg (ORCPT ); Sun, 14 Jun 2020 18:39:36 -0400 Received: by mail-pj1-f65.google.com with SMTP id jz3so5947165pjb.0 for ; Sun, 14 Jun 2020 15:39:36 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=b0PAcuPeM0qeY4e1f/YGcBkSny5Gxr0QswWF1YiOE+0=; b=PmkW3/UWbvrk0uRchG8V3gV/0xQdx4+rh5fPxdrDHJsS8FPjgSCPY3GlFUrVIhC8zh iinRDF3zWqUwbFe9bziSjVzJNvODps1KPMX9nOfL3P5+8UwsmSNjZ7YSnAOWNlO9svm4 13tB9BZLzUNjO6kHxtY0h8UhlYbAMvLWUF3YTUs30xpifJUoN0XtJ0xYA1w3XrtQYW7A T5lY5fEdfnPG8uQafJ4zt5QRvE3JsoCr0W/StfyvgTVXunSR5c0oTRV4srfvAaxUDWph 8s4R61sUY4tk6cwooIVT63iYH5fyK7in9OxWSpYkAzromIdu+CDyA3DWRzn3Lwnm+XuL 6xtg== X-Gm-Message-State: AOAM532cGXT2wblCic/jzNE8MmT3Bb1rJVsUx1PQ0hqe/GZT7dfV7Uo5 NcCV3gxhh7UHTfcX77WPmWA= X-Google-Smtp-Source: ABdhPJxJ9/lV0koVU74Ky1jj/kxSXf2R11vxIhEmS4Wwr3AXYuYzzwh0OadXO5tdWwarHF3a/eqnVw== X-Received: by 2002:a17:90a:6483:: with SMTP id h3mr9006251pjj.229.1592174375456; Sun, 14 Jun 2020 15:39:35 -0700 (PDT) Received: from localhost.localdomain (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id u25sm11768711pfm.115.2020.06.14.15.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2020 15:39:34 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , Quinn Tran , Himanshu Madhani , Daniel Wagner , Martin Wilck , Roman Bolshakov Subject: [PATCH 5/9] qla2xxx: Remove a superfluous cast Date: Sun, 14 Jun 2020 15:39:17 -0700 Message-Id: <20200614223921.5851-6-bvanassche@acm.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200614223921.5851-1-bvanassche@acm.org> References: <20200614223921.5851-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Remove an unnecessary cast because it prevents the compiler to perform type checking. Cc: Nilesh Javali Cc: Quinn Tran Cc: Himanshu Madhani Cc: Daniel Wagner Cc: Martin Wilck Cc: Roman Bolshakov Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_bsg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 88c0338a2ec7..67efde1d4b8e 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c @@ -223,8 +223,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job) /* validate fcp priority data */ - if (!qla24xx_fcp_prio_cfg_valid(vha, - (struct qla_fcp_prio_cfg *) ha->fcp_prio_cfg, 1)) { + if (!qla24xx_fcp_prio_cfg_valid(vha, ha->fcp_prio_cfg, 1)) { bsg_reply->result = (DID_ERROR << 16); ret = -EINVAL; /* If buffer was invalidatic int From patchwork Sun Jun 14 22:39:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 213768 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BE60C433DF for ; Sun, 14 Jun 2020 22:39:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2057B2071A for ; Sun, 14 Jun 2020 22:39:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728004AbgFNWjk (ORCPT ); Sun, 14 Jun 2020 18:39:40 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:39311 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727998AbgFNWjh (ORCPT ); Sun, 14 Jun 2020 18:39:37 -0400 Received: by mail-pl1-f196.google.com with SMTP id v24so5999717plo.6 for ; Sun, 14 Jun 2020 15:39:37 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=tq326eO73Jg/ADfRmtMYw8srTNnadA8+cdvXjVwbeEU=; b=Jpi8OpdndclZH6FCnmxFyHJ/638rm0J8s3kP8UcQIYg/4oFP8wZG6jvUzuX717KlVv Es8Mr1F8uck1mlx9g+i+M191QF/eAEZe51SxfYj/UOar3Tb1qPCWAFD+mKXDhTGBs0Zq Dl56I+OeoH8bsuwUt8Ua1bmCoJC5lldGHE1O98DkNjB6EIeHG9ikWPtx/8Y6jPmMLYeQ qPPWp6bK8JhHszriI/UIdNR7kcZZjVNzboESisAJ5kapGkA5Vd8XpSrH6lk7H0G18O7K CsLWkgGHYGl4fJp+0jwD09WLlTuib4akCMGyhe7CCWx+7Kd+kFnz3ew96y7iLJQGhtqz p50g== X-Gm-Message-State: AOAM530ljMP25Hy5cJM1ypoOHubn+DFeAmEo8sB0TtM+BhdpUG5oJyez Q6fdhoY3BMsbem6V8y2rZyY= X-Google-Smtp-Source: ABdhPJxIeozXpCs+Z5JehB0w2kE6mFL/Bw3L2x7Ci4TUPGXKxxmJbKGMB1ZwoCAqAoFPx03weeOHog== X-Received: by 2002:a17:90b:3004:: with SMTP id hg4mr9945917pjb.208.1592174376910; Sun, 14 Jun 2020 15:39:36 -0700 (PDT) Received: from localhost.localdomain (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id u25sm11768711pfm.115.2020.06.14.15.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2020 15:39:36 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , Quinn Tran , Himanshu Madhani , Daniel Wagner , Martin Wilck , Roman Bolshakov Subject: [PATCH 6/9] qla2xxx: Make __qla2x00_alloc_iocbs() initialize 32 bits of request_t.handle Date: Sun, 14 Jun 2020 15:39:18 -0700 Message-Id: <20200614223921.5851-7-bvanassche@acm.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200614223921.5851-1-bvanassche@acm.org> References: <20200614223921.5851-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The request_t 'handle' member is 32-bits wide, hence use wrt_reg_dword(). Change the cast in the wrt_reg_byte() call to make it clear that a regular pointer is casted to an __iomem pointer. Note: 'pkt' points to I/O memory for the qlafx00 adapter family and to coherent memory for all other adapter families. This patch fixes the following Coverity complaint: CID 358864 (#1 of 1): Reliance on integer endianness (INCOMPATIBLE_CAST) incompatible_cast: Pointer &pkt->handle points to an object whose effective type is unsigned int (32 bits, unsigned) but is dereferenced as a narrower unsigned short (16 bits, unsigned). This may lead to unexpected results depending on machine endianness. Cc: Nilesh Javali Cc: Quinn Tran Cc: Himanshu Madhani Cc: Daniel Wagner Cc: Martin Wilck Cc: Roman Bolshakov Fixes: 8ae6d9c7eb10 ("[SCSI] qla2xxx: Enhancements to support ISPFx00.") Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_iocb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 8865c35d3421..7c2ad8c18398 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2305,8 +2305,8 @@ __qla2x00_alloc_iocbs(struct qla_qpair *qpair, srb_t *sp) pkt = req->ring_ptr; memset(pkt, 0, REQUEST_ENTRY_SIZE); if (IS_QLAFX00(ha)) { - wrt_reg_byte((void __iomem *)&pkt->entry_count, req_cnt); - wrt_reg_word((void __iomem *)&pkt->handle, handle); + wrt_reg_byte((u8 __force __iomem *)&pkt->entry_count, req_cnt); + wrt_reg_dword((__le32 __force __iomem *)&pkt->handle, handle); } else { pkt->entry_count = req_cnt; pkt->handle = handle; From patchwork Sun Jun 14 22:39:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 213767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1B15C433E0 for ; Sun, 14 Jun 2020 22:39:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8CF3E206D7 for ; Sun, 14 Jun 2020 22:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728006AbgFNWjl (ORCPT ); Sun, 14 Jun 2020 18:39:41 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42941 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727994AbgFNWjj (ORCPT ); Sun, 14 Jun 2020 18:39:39 -0400 Received: by mail-pg1-f195.google.com with SMTP id e9so6768163pgo.9 for ; Sun, 14 Jun 2020 15:39:38 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=lFjh0ainvvAyvsbkM9NQ0MeC1XuOATfgG9XyDriCGbs=; b=P+d+0q96GWoHfknv/T8PbTRJOA6BN/YReZIA2DZAHSEuFXyDHuELo4bisu5UKqKeTm obZgE0JWXTJRJwfu9SBGzYgHFOuoDhtBq5ufa7/o0M4LJ7RbsSXadEpwKvOdMWwxAu/b X5P9Xqtn95pI7Qc03YJRg1yrXtJ2IInGUG+3b2JM99acFVxN7++Crzt25LiRSE5C4N4j 0F7EnlsYheCLpUTtveS64tAh0wtUrbTMsrGkzycX31McB+XZyPcwJSjuHn8obTJ8cT9k 7elzsJJbJ/Wtnyhs+xo1o0B00i765efTHvUZ7L93OncHuPDds1Du/3yq6iigGes5GLVm 6D/g== X-Gm-Message-State: AOAM532OapfX6yK3Ej7RJWRTvsiY+fH/Oh1DQ1iQAYtvXG5W3uRCwkwq NZhCxlyhXtnrV+LMVXRyRU4= X-Google-Smtp-Source: ABdhPJzxQqew76Fu2aV1GSEKuq/LVWtAAZt5B6e7qJj8nrZLw7pIkDe4mO5tNL4HTS5KDYR+8+SQjA== X-Received: by 2002:a63:c64c:: with SMTP id x12mr15497100pgg.362.1592174378325; Sun, 14 Jun 2020 15:39:38 -0700 (PDT) Received: from localhost.localdomain (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id u25sm11768711pfm.115.2020.06.14.15.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2020 15:39:37 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , Quinn Tran , Himanshu Madhani , Daniel Wagner , Martin Wilck , Roman Bolshakov Subject: [PATCH 7/9] qla2xxx: Fix a Coverity complaint in qla2100_fw_dump() Date: Sun, 14 Jun 2020 15:39:19 -0700 Message-Id: <20200614223921.5851-8-bvanassche@acm.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200614223921.5851-1-bvanassche@acm.org> References: <20200614223921.5851-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 'cnt' can exceed the size of the risc_ram[] array. Prevent that Coverity complains by rewriting an address calculation expression. This patch fixes the following Coverity complaint: CID 337803 (#1 of 1): Out-of-bounds read (OVERRUN) 109. overrun-local: Overrunning array of 122880 bytes at byte offset 122880 by dereferencing pointer &fw->risc_ram[cnt]. Cc: Nilesh Javali Cc: Quinn Tran Cc: Himanshu Madhani Cc: Daniel Wagner Cc: Martin Wilck Cc: Roman Bolshakov Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_dbg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 2ed0b849fbfe..5e873b70e843 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -1063,7 +1063,8 @@ qla2100_fw_dump(scsi_qla_host_t *vha) } if (rval == QLA_SUCCESS) - qla2xxx_copy_queues(ha, &fw->risc_ram[cnt]); + qla2xxx_copy_queues(ha, (char *)fw + + offsetof(typeof(*fw), risc_ram) + cnt); qla2xxx_dump_post_process(base_vha, rval); }