Bug 1497152
| Summary: | systool causes panic on 2.6.32-696.6.3.el6.x86_64 using be2iscsi | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | nikhil kshirsagar <nkshirsa> | |
| Component: | kernel | Assignee: | Maurizio Lombardi <mlombard> | |
| kernel sub component: | Storage Drivers | QA Contact: | Martin Hoyer <mhoyer> | |
| Status: | CLOSED ERRATA | Docs Contact: | ||
| Severity: | high | |||
| Priority: | high | CC: | dhoward, djeffery, jmagrini, mhoyer, mlombard, mthacker, toneata | |
| Version: | 6.7 | Keywords: | ZStream | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | kernel-2.6.32-722.el6 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1507512 (view as bug list) | Environment: | ||
| Last Closed: | 2018-06-19 04:59:19 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1507512 | |||
|
Description
nikhil kshirsagar
2017-09-29 10:29:41 UTC
The crash is from the be2iscsi driver using a bad extern declaration in be_mgmt.c for the beiscsi_obsolete_adapter_msg string. The string exists in be_main.c as "char const beiscsi_obsolete_adapter_msg[]" but be_mgmt.c redefined it as "extern char const *beiscsi_obsolete_adapter_msg".
While you can use arrays as pointers, altering the variable declaration like this to switch between an array and a pointer breaks how gcc handles the variable. When the code in be_mgmt.c tries to use beiscsi_obsolete_adapter_msg as a pointer, it instead passes the beginning of the string itself. The kernel then crashes when strnlen tries to use the copied part of a string as a pointer.
The extern declaration in be_mgmt.c should be the same as how the variable is declared in be_main.c. A simple patch like this should fix the issue:
--- linux-2.6.32-696.15.1.el6.x86_64/drivers/scsi/be2iscsi/be_mgmt.c 2017-09-26 06:52:08.000000000 -0400
+++ linux-2.6.32-696.15.1.el6.x86_64/drivers/scsi/be2iscsi/be_mgmt.c 2017-09-29 11:15:43.256589278 -0400
@@ -24,7 +24,7 @@
#include "be_iscsi.h"
#include "be_main.h"
-extern char const *beiscsi_obsolete_adapter_msg;
+extern char const beiscsi_obsolete_adapter_msg[];
/* UE Status Low CSR */
static const char * const desc_ue_status_low[] = {
This bug was introduced in kernel-2.6.32-642.el6 (GA 6.7)
The exact commit was f628daf643edeadf2957921f77992df0f5aa61c3
commit f628daf643edeadf2957921f77992df0f5aa61c3
Author: Maurizio Lombardi <mlombard>
Date: Wed Mar 16 10:01:49 2016 -0400
[scsi] be2iscsi: Add warning message for unsupported adapter
Message-id: <56E92F0D.5060802>
Patchwork-id: 138554
O-Subject: Re: [RHEL6.8 e-stor PATCH V2 09/10] be2iscsi : Add warning message for unsupported adapter
Bugzilla: 1253016
RH-Acked-by: Rob Evers <revers>
RH-Acked-by: Tomas Henzl <thenzl>
RHEL-only
Add a warning message to indicate obsolete
BE2 Adapter Family devices
Partially base on this patch:
http://www.spinics.net/lists/linux-scsi/msg87182.html
Signed-off-by: Maurizio Lombardi <mlombard>
Signed-off-by: Aristeu Rozanski <aris>
----------------------------------
commit f628daf643edeadf2957921f77992df0f5aa61c3
Author: Maurizio Lombardi <mlombard>
Date: Wed Mar 16 10:01:49 2016 -0400
[scsi] be2iscsi: Add warning message for unsupported adapter
Message-id: <56E92F0D.5060802>
Patchwork-id: 138554
O-Subject: Re: [RHEL6.8 e-stor PATCH V2 09/10] be2iscsi : Add warning message for unsupported adapter
Bugzilla: 1253016
RH-Acked-by: Rob Evers <revers>
RH-Acked-by: Tomas Henzl <thenzl>
RHEL-only
Add a warning message to indicate obsolete
BE2 Adapter Family devices
Partially base on this patch:
http://www.spinics.net/lists/linux-scsi/msg87182.html
Signed-off-by: Maurizio Lombardi <mlombard>
Signed-off-by: Aristeu Rozanski <aris>
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 9045129..d40b553 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -208,6 +208,14 @@ static char const *cqe_desc[] = {
"CXN_KILLED_IMM_DATA_RCVD"
};
+char const beiscsi_obsolete_adapter_msg[] = {
+ "This device is not recommended for new deployments. It continues to be\n"
+ "supported in this RHEL release, but it is likely to be removed in the\n"
+ "next major release. Driver updates and fixes for this device will be\n"
+ "limited to critical issues. Please contact your device's hardware\n"
+ "vendor for additional information.\n"
+};
+
static int beiscsi_slave_configure(struct scsi_device *sdev)
{
blk_queue_max_segment_size(sdev->request_queue, 65536);
@@ -5714,6 +5722,7 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
case OC_DEVICE_ID2:
phba->generation = BE_GEN2;
phba->iotask_fn = beiscsi_iotask;
+ dev_warn(&pcidev->dev, beiscsi_obsolete_adapter_msg);
break;
case BE_DEVICE_ID2:
case OC_DEVICE_ID3:
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 2d128f8..dbb679a 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -24,6 +24,8 @@
#include "be_iscsi.h"
#include "be_main.h"
+extern char const *beiscsi_obsolete_adapter_msg; <--------
+
/* UE Status Low CSR */
static const char * const desc_ue_status_low[] = {
"CEV",
@@ -1536,7 +1538,8 @@ beiscsi_adap_family_disp(struct device *dev, struct device_attribute *attr,
case BE_DEVICE_ID1:
case OC_DEVICE_ID1:
case OC_DEVICE_ID2:
- return snprintf(buf, PAGE_SIZE, "BE2 Adapter Family\n");
+ return snprintf(buf, PAGE_SIZE, "%s\n%s", "BE2 Adapter Family",
+ beiscsi_obsolete_adapter_msg);
break;
case BE_DEVICE_ID2:
case OC_DEVICE_ID3:
Can this be fixed in main, as well as a hotfix for the customer (who is using kernel-2.6.32-696.10.3.el6 )
We already provided a test kernel with the fix, and it works fine.
Patch(es) committed on kernel repository and kernel is undergoing testing Patch(es) available on kernel-2.6.32-722.el6 Tested on system with OCe10102-IM adapter using kernel-2.6.32-749.el6.x86_64 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:1854 |