Compare commits
No commits in common. "c8" and "c9s-private-than" have entirely different histories.
c8
...
c9s-privat
19
.gitignore
vendored
19
.gitignore
vendored
@ -1 +1,18 @@
|
||||
SOURCES/ppc64-diag-2.7.9.tar.gz
|
||||
/ppc64-diag-2.4.2.tar.gz
|
||||
/ppc64-diag-2.4.3.tar.gz
|
||||
/ppc64-diag-2.6.1.tar.gz
|
||||
/ppc64-diag-2.6.2.tar.gz
|
||||
/ppc64-diag-2.6.3.tar.gz
|
||||
/ppc64-diag-2.6.4.tar.gz
|
||||
/ppc64-diag-2.6.5.tar.gz
|
||||
/ppc64-diag-2.6.6.tar.gz
|
||||
/ppc64-diag-2.6.7.tar.gz
|
||||
/ppc64-diag-2.6.10.tar.gz
|
||||
/ppc64-diag-2.7.0.tar.gz
|
||||
/ppc64-diag-2.7.1.tar.gz
|
||||
/ppc64-diag-2.7.4.tar.gz
|
||||
/ppc64-diag-2.7.5.tar.gz
|
||||
/ppc64-diag-2.7.6.tar.gz
|
||||
/ppc64-diag-2.7.7.tar.gz
|
||||
/ppc64-diag-2.7.8.tar.gz
|
||||
/ppc64-diag-2.7.9.tar.gz
|
||||
|
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
43
ppc64-diag-2.7.9-compiler-warnings.patch
Normal file
43
ppc64-diag-2.7.9-compiler-warnings.patch
Normal file
@ -0,0 +1,43 @@
|
||||
diff --git a/lpd/usysident.c b/lpd/usysident.c
|
||||
index 8fee736..11a512b 100644
|
||||
--- a/lpd/usysident.c
|
||||
+++ b/lpd/usysident.c
|
||||
@@ -429,7 +429,7 @@ retry:
|
||||
* next elements in the list (which may match the device name);
|
||||
* for this we need to retry, re-starting on the next element.
|
||||
*/
|
||||
- if (dvalue && current->devname &&
|
||||
+ if (dvalue && current->devname[0] != '\0' &&
|
||||
strncmp(dvalue, current->devname, DEV_LENGTH)) {
|
||||
list_start = current->next;
|
||||
goto retry;
|
||||
diff --git a/opal_errd/extract_opal_dump.c b/opal_errd/extract_opal_dump.c
|
||||
index b7f365f..656899d 100644
|
||||
--- a/opal_errd/extract_opal_dump.c
|
||||
+++ b/opal_errd/extract_opal_dump.c
|
||||
@@ -77,8 +77,10 @@ static void dump_get_file_name(char *buf, int bsize, char *dfile,
|
||||
if (bsize >= DUMP_HDR_PREFIX_OFFSET + sizeof(uint16_t))
|
||||
*prefix_size = be16toh(*(uint16_t *)(buf + DUMP_HDR_PREFIX_OFFSET));
|
||||
|
||||
- if (bsize >= DUMP_HDR_FNAME_OFFSET + DUMP_MAX_FNAME_LEN)
|
||||
- strncpy(dfile, buf + DUMP_HDR_FNAME_OFFSET, dfile_size);
|
||||
+ if (bsize >= DUMP_HDR_FNAME_OFFSET + DUMP_MAX_FNAME_LEN) {
|
||||
+ strncpy(dfile, buf + DUMP_HDR_FNAME_OFFSET, dfile_size - 1);
|
||||
+ dfile[dfile_size - 1] = '\0';
|
||||
+ }
|
||||
else
|
||||
strncpy(dfile, "platform.dumpid.PARTIAL", dfile_size);
|
||||
|
||||
diff --git a/rtas_errd/extract_platdump.c b/rtas_errd/extract_platdump.c
|
||||
index 831e57e..50bac99 100644
|
||||
--- a/rtas_errd/extract_platdump.c
|
||||
+++ b/rtas_errd/extract_platdump.c
|
||||
@@ -220,7 +220,7 @@ extract_platform_dump(uint64_t dump_tag)
|
||||
char filename[DUMP_MAX_FNAME_LEN + 1];
|
||||
char pathname[PATH_MAX];
|
||||
char dump_err[RTAS_ERROR_LOG_MAX];
|
||||
- char dumpid[5];
|
||||
+ char dumpid[5] = "";
|
||||
int out=-1, rc, librtas_rc, dump_complete=0, ret=0;
|
||||
|
||||
msg("Dump tag: 0x%016LX", dump_tag);
|
72
ppc64-diag-2.7.9-diag_encl-man-and-help-page.patch
Normal file
72
ppc64-diag-2.7.9-diag_encl-man-and-help-page.patch
Normal file
@ -0,0 +1,72 @@
|
||||
commit 565035cf98e97c7adda523221e109c676daf3430
|
||||
Author: Barnali Guha Thakurata <barnali@linux.ibm.com>
|
||||
Date: Mon Jan 8 20:16:19 2024 +0530
|
||||
|
||||
diag_encl help output update
|
||||
|
||||
This patch changes "scsi_enclosure" in the help output of diag_encl to
|
||||
"sgn ..." so that it matches with the naming convention in the
|
||||
manual page
|
||||
|
||||
Before patch:
|
||||
|
||||
diags/diag_encl --help
|
||||
Usage: diags/diag_encl [-h] [-V] [...] [<scsi_enclosure>]
|
||||
|
||||
[...]
|
||||
<scsi_enclosure>: the sg device on which to operate, such
|
||||
as sg7; if not specified, all such
|
||||
devices will be diagnosed
|
||||
man diags/man/diag_encl.8
|
||||
...
|
||||
SYNOPSIS
|
||||
diag_encl [-s [-c][-l]] [-v] [-f <path.pg2>] [sgn ...]
|
||||
diag_encl -d
|
||||
diag_encl --version
|
||||
diag_encl --help
|
||||
...
|
||||
|
||||
After patch:
|
||||
|
||||
diags/diag_encl --help
|
||||
Usage: diags/diag_encl [-h] [-V] [...] [-f <path.pg2>] [<sgn ...>]
|
||||
|
||||
[...]
|
||||
<sgn ...>: the scsi device on which to operate, such
|
||||
as sg7; if not specified, all such
|
||||
devices will be diagnosed
|
||||
|
||||
man diags/man/diag_encl.8
|
||||
...
|
||||
SYNOPSIS
|
||||
diag_encl [-s [-c][-l]] [-v] [-f <path.pg2>] [sgn ...]
|
||||
diag_encl -d
|
||||
diag_encl --version
|
||||
diag_encl --help
|
||||
...
|
||||
|
||||
Signed-off-by: Barnali Guha Thakurata <barnali@linux.ibm.com>
|
||||
|
||||
diff --git a/diags/diag_encl.c b/diags/diag_encl.c
|
||||
index 449b097..e0d86ce 100644
|
||||
--- a/diags/diag_encl.c
|
||||
+++ b/diags/diag_encl.c
|
||||
@@ -75,8 +75,7 @@ static struct {
|
||||
*/
|
||||
static void
|
||||
print_usage(const char *name) {
|
||||
- printf("Usage: %s [-h] [-V] [-s [-c][-l]] [-v] [-f <path.pg2>]"
|
||||
- " [<scsi_enclosure>]\n"
|
||||
+ printf("Usage: %s [-h] [-V] [-s [-c][-l]] [-v] [-f <path.pg2>] [<sgn ...>]\n"
|
||||
"\n\t-h: print this help message\n"
|
||||
"\t-s: generate serviceable events for any failures and\n"
|
||||
"\t write events to the servicelog\n"
|
||||
@@ -87,7 +86,7 @@ print_usage(const char *name) {
|
||||
"\t-V: print the version of the command and exit\n"
|
||||
"\t-f: for testing, read SES data from path.pg2 and VPD\n"
|
||||
"\t from path.vpd\n"
|
||||
- "\t<scsi_enclosure>: the sg device on which to operate, such\n"
|
||||
+ "\t<sgn ...>: the scsi device on which to operate, such\n"
|
||||
"\t as sg7; if not specified, all such\n"
|
||||
"\t devices will be diagnosed\n", name);
|
||||
}
|
62
ppc64-diag-2.7.9-diag_nvme-man-and-help-page.patch
Normal file
62
ppc64-diag-2.7.9-diag_nvme-man-and-help-page.patch
Normal file
@ -0,0 +1,62 @@
|
||||
commit 420d5145230041e0256f0f950a36c4ecaed4d584
|
||||
Author: Barnali Guha Thakurata <barnali@linux.ibm.com>
|
||||
Date: Mon Jan 8 16:59:33 2024 +0530
|
||||
|
||||
diag_nvme help output update
|
||||
|
||||
This patch changes "nvme_devices" in the help output of diag_nvme to
|
||||
"nvmen ..." so that it matches with the naming convention in the
|
||||
manual page
|
||||
|
||||
Before patch:
|
||||
|
||||
diags/diag_nvme --help
|
||||
Usage: diags/diag_nvme [-h] [<nvme_devices>]
|
||||
-h or --help: print this help message
|
||||
<nvme_devices>: the NVMe devices on which to operate, for
|
||||
example nvme0; if not specified, all detected
|
||||
nvme devices will be diagnosed
|
||||
|
||||
man diags/man/diag_nvme.8
|
||||
...
|
||||
SYNOPSIS
|
||||
diag_nvme [<nvmen ...>]
|
||||
diag_nvme <nvmen>
|
||||
diag_nvme --help
|
||||
...
|
||||
|
||||
After patch:
|
||||
|
||||
diags/diag_nvme --help
|
||||
Usage: diags/diag_nvme [-h] [<nvmen ...>]
|
||||
-h or --help: print this help message
|
||||
<nvmen ...>: the NVMe devices on which to operate, for
|
||||
example nvme0; if not specified, all detected
|
||||
nvme devices will be diagnosed
|
||||
|
||||
man diags/man/diag_nvme.8
|
||||
...
|
||||
SYNOPSIS
|
||||
diag_nvme [<nvmen ...>]
|
||||
diag_nvme <nvmen>
|
||||
diag_nvme --help
|
||||
...
|
||||
|
||||
Signed-off-by: Barnali Guha Thakurata <barnali@linux.ibm.com>
|
||||
|
||||
diff --git a/diags/diag_nvme.c b/diags/diag_nvme.c
|
||||
index c1c0a20..2a74007 100644
|
||||
--- a/diags/diag_nvme.c
|
||||
+++ b/diags/diag_nvme.c
|
||||
@@ -989,9 +989,9 @@ extern int open_nvme(char *dev_path) {
|
||||
}
|
||||
|
||||
static void print_usage(char *command) {
|
||||
- printf("Usage: %s [-h] [<nvme_devices>]\n"
|
||||
+ printf("Usage: %s [-h] [<nvmen ...>]\n"
|
||||
"\t-h or --help: print this help message\n"
|
||||
- "\t<nvme_devices>: the NVMe devices on which to operate, for\n"
|
||||
+ "\t<nvmen ...>: the NVMe devices on which to operate, for\n"
|
||||
"\t example nvme0; if not specified, all detected\n"
|
||||
"\t nvme devices will be diagnosed\n", command);
|
||||
}
|
55
ppc64-diag-2.7.9-diag_vnme-add-power11-support.patch
Normal file
55
ppc64-diag-2.7.9-diag_vnme-add-power11-support.patch
Normal file
@ -0,0 +1,55 @@
|
||||
commit 6bfa2ec7a7f424b018fd2e21a70e9d2f04041832
|
||||
Author: Barnali Guha Thakurata <barnali@linux.ibm.com>
|
||||
Date: Tue Oct 22 12:05:39 2024 +0530
|
||||
|
||||
Added Power11 support for diag_nvme
|
||||
|
||||
Without Patch:
|
||||
# diag_nvme nvme0
|
||||
diag_nvme is only supported in PowerVM LPARs and at least Power10 processors
|
||||
|
||||
With Patch:
|
||||
# diag_nvme nvme0
|
||||
Running diagnostics for nvme0
|
||||
|
||||
NVMe diag command completed successfully
|
||||
|
||||
Signed-off-by: Barnali Guha Thakurata <barnali@linux.ibm.com>
|
||||
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
|
||||
Reviewed-by: Sathvika Vasireddy <sv@linux.ibm.com>
|
||||
Tested-by: Sathvika Vasireddy <sv@linux.ibm.com>
|
||||
|
||||
diff --git a/common/platform.c b/common/platform.c
|
||||
index 1359adb..801b924 100644
|
||||
--- a/common/platform.c
|
||||
+++ b/common/platform.c
|
||||
@@ -96,6 +96,9 @@ get_processor(void)
|
||||
case PVR_POWER10:
|
||||
rc = POWER10;
|
||||
break;
|
||||
+ case PVR_POWER11:
|
||||
+ rc = POWER11;
|
||||
+ break;
|
||||
default:
|
||||
rc = PROCESSOR_UNKNOWN;
|
||||
break;
|
||||
diff --git a/common/platform.h b/common/platform.h
|
||||
index b265d1e..ae3ea21 100644
|
||||
--- a/common/platform.h
|
||||
+++ b/common/platform.h
|
||||
@@ -36,6 +36,7 @@
|
||||
#define PVR_POWER8 0x004D
|
||||
#define PVR_POWER9 0x004E
|
||||
#define PVR_POWER10 0x0080
|
||||
+#define PVR_POWER11 0x0082
|
||||
|
||||
enum {
|
||||
PLATFORM_UNKNOWN = 0,
|
||||
@@ -56,6 +57,7 @@ enum {
|
||||
POWER8,
|
||||
POWER9,
|
||||
POWER10,
|
||||
+ POWER11,
|
||||
};
|
||||
|
||||
extern const char *__platform_name[];
|
37
ppc64-diag-2.7.9-improvements_status_and_err_messages.patch
Normal file
37
ppc64-diag-2.7.9-improvements_status_and_err_messages.patch
Normal file
@ -0,0 +1,37 @@
|
||||
commit 3ad587d20868f154bb7ab972ee7812add1380d7a
|
||||
Author: Greg Joyce <gjoyce@linux.vnet.ibm.com>
|
||||
Date: Wed Oct 11 12:10:40 2023 -0500
|
||||
|
||||
diag_nvme: improvements to status and err messages
|
||||
|
||||
Signed-off-by: Greg Joyce <gjoyce@linux.vnet.ibm.com>
|
||||
|
||||
diff --git a/diags/diag_nvme.c b/diags/diag_nvme.c
|
||||
index df191f2..00efec2 100644
|
||||
--- a/diags/diag_nvme.c
|
||||
+++ b/diags/diag_nvme.c
|
||||
@@ -166,9 +166,9 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
if (rc == 0)
|
||||
- fprintf(stdout, "Command completed successfully\n");
|
||||
+ fprintf(stdout, "NVMe diag command completed successfully\n");
|
||||
else
|
||||
- fprintf(stderr, "Command failed, exiting with rc %d\n", rc);
|
||||
+ fprintf(stderr, "NVMe diag command failed with rc %d\n", rc);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -724,8 +724,11 @@ extern int get_smart_file(char *file_path, struct nvme_smart_log_page *log) {
|
||||
int num_elements = 0;
|
||||
struct dictionary dict[MAX_DICT_ELEMENTS];
|
||||
|
||||
- if ((num_elements = read_file_dict(file_path, dict, MAX_DICT_ELEMENTS)) < 0)
|
||||
+ if ((num_elements = read_file_dict(file_path, dict, MAX_DICT_ELEMENTS)) < 0) {
|
||||
+ fprintf(stderr, "read_file_dict failed: %s, rc % d\n",
|
||||
+ file_path, num_elements);
|
||||
return num_elements;
|
||||
+ }
|
||||
return set_smart_log_field(log, dict, num_elements);
|
||||
}
|
||||
|
24
ppc64-diag-2.7.9-remove-d-and-f-from-usage.patch
Normal file
24
ppc64-diag-2.7.9-remove-d-and-f-from-usage.patch
Normal file
@ -0,0 +1,24 @@
|
||||
commit 316d2baf5dba0d00447a3ac49f2f95339dbdf5cd
|
||||
Author: Greg Joyce <gjoyce@linux.vnet.ibm.com>
|
||||
Date: Wed Nov 15 11:28:05 2023 -0600
|
||||
|
||||
nvme_call_home: remove -d and -f from usage message
|
||||
|
||||
The -d and -f weren't removed from the first line of the
|
||||
usage message.
|
||||
|
||||
Signed-off-by: Greg Joyce <gjoyce@linux.vnet.ibm.com>
|
||||
|
||||
diff --git a/diags/diag_nvme.c b/diags/diag_nvme.c
|
||||
index 00efec2..164afe1 100644
|
||||
--- a/diags/diag_nvme.c
|
||||
+++ b/diags/diag_nvme.c
|
||||
@@ -989,7 +989,7 @@ extern int open_nvme(char *dev_path) {
|
||||
}
|
||||
|
||||
static void print_usage(char *command) {
|
||||
- printf("Usage: %s [-h] [-d <file>] [-f <file>] [<nvme_devices>]\n"
|
||||
+ printf("Usage: %s [-h] [<nvme_devices>]\n"
|
||||
"\t-h or --help: print this help message\n"
|
||||
"\t<nvme_devices>: the NVMe devices on which to operate, for\n"
|
||||
"\t example nvme0; if not specified, all detected\n"
|
143
ppc64-diag-2.7.9-remove_d_and_f_option.patch
Normal file
143
ppc64-diag-2.7.9-remove_d_and_f_option.patch
Normal file
@ -0,0 +1,143 @@
|
||||
commit 11cb2a44a59b63bdc23c94e386c4e2f43ea7eb61
|
||||
Author: Greg Joyce <gjoyce@linux.vnet.ibm.com>
|
||||
Date: Fri Sep 22 15:19:34 2023 -0500
|
||||
|
||||
nvme_call_home: remove -d and -f as visible options
|
||||
|
||||
The dump(-d) and file(-f) options have been removed as option in usage
|
||||
and also in the man page. The options are for internal test only and
|
||||
should not have been exposed. Also added some helpful status messages.
|
||||
|
||||
Signed-off-by: Greg Joyce <gjoyce@linux.vnet.ibm.com>
|
||||
|
||||
diff --git a/diags/diag_nvme.c b/diags/diag_nvme.c
|
||||
index 2a78034..df191f2 100644
|
||||
--- a/diags/diag_nvme.c
|
||||
+++ b/diags/diag_nvme.c
|
||||
@@ -165,6 +165,11 @@ int main(int argc, char *argv[]) {
|
||||
optind++;
|
||||
}
|
||||
|
||||
+ if (rc == 0)
|
||||
+ fprintf(stdout, "Command completed successfully\n");
|
||||
+ else
|
||||
+ fprintf(stderr, "Command failed, exiting with rc %d\n", rc);
|
||||
+
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -310,6 +315,7 @@ extern int dump_smart_data(char *device_name, char *dump_path) {
|
||||
int fd, rc;
|
||||
FILE *fp;
|
||||
struct nvme_smart_log_page smart_log = { 0 };
|
||||
+ char ans;
|
||||
|
||||
/* Read SMART data from device */
|
||||
snprintf(dev_path,sizeof(dev_path), "/dev/%s", device_name);
|
||||
@@ -331,8 +337,16 @@ extern int dump_smart_data(char *device_name, char *dump_path) {
|
||||
}
|
||||
fp = fopen(dump_path, "wx");
|
||||
if (fp == NULL) {
|
||||
- fprintf(stderr, "%s open failed: %s\n", dump_path, strerror(errno));
|
||||
- return -1;
|
||||
+ if (errno == EEXIST) {
|
||||
+ fprintf(stdout, "File %s exists. Overwrite (y/n)? ", dump_path);
|
||||
+ rc = scanf("%c", &ans);
|
||||
+ if (ans == 'y' || ans == 'Y')
|
||||
+ fp = fopen(dump_path, "w");
|
||||
+ }
|
||||
+ if (fp == NULL) {
|
||||
+ fprintf(stderr, "%s open failed: %s\n", dump_path, strerror(errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
write_smart_file(fp, &smart_log);
|
||||
fclose(fp);
|
||||
@@ -974,11 +988,6 @@ extern int open_nvme(char *dev_path) {
|
||||
static void print_usage(char *command) {
|
||||
printf("Usage: %s [-h] [-d <file>] [-f <file>] [<nvme_devices>]\n"
|
||||
"\t-h or --help: print this help message\n"
|
||||
- "\t-d or --dump: dump SMART data to the specified path and file name <file>\n"
|
||||
- "\t one <nvme_device> is expected with this option\n"
|
||||
- "\t-f or --file: use SMART data from the specified path and file name <file>\n"
|
||||
- "\t instead of device, one <nvme_device> is expected with\n"
|
||||
- "\t this option\n"
|
||||
"\t<nvme_devices>: the NVMe devices on which to operate, for\n"
|
||||
"\t example nvme0; if not specified, all detected\n"
|
||||
"\t nvme devices will be diagnosed\n", command);
|
||||
diff --git a/diags/man/diag_nvme.8 b/diags/man/diag_nvme.8
|
||||
index 45567ac..c023ed6 100644
|
||||
--- a/diags/man/diag_nvme.8
|
||||
+++ b/diags/man/diag_nvme.8
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
-.\" Copyright (C) 2022 IBM Corporation
|
||||
+.\" Copyright (C) 2022, 2023 IBM Corporation
|
||||
.\"
|
||||
-.TH "DIAG_NVME" "8" "June 2022" "Linux" "PowerLinux Diagnostic Tools"
|
||||
+.TH "DIAG_NVME" "8" "September 2023" "Linux" "PowerLinux Diagnostic Tools"
|
||||
.hy
|
||||
.SH NAME
|
||||
.PP
|
||||
@@ -12,7 +12,7 @@ diag_nvme \- diagnose NVMe devices
|
||||
.PD 0
|
||||
.P
|
||||
.PD
|
||||
-\f[B]diag_nvme\f[] [\-d <\f[I]file\f[]>] [\-f <\f[I]file\f[]>]
|
||||
+\f[B]diag_nvme\f[]
|
||||
<\f[B]nvme\f[]\f[I]n\f[]>
|
||||
.PD 0
|
||||
.P
|
||||
@@ -29,52 +29,10 @@ go through the diagnostics procedure.
|
||||
The user can control which events will be reported through the
|
||||
configuration file \f[I]/etc/ppc64\-diag/diag_nvme.config\f[]
|
||||
.SH OPTIONS
|
||||
-.TP
|
||||
-.B \f[B]\-d\f[], \f[B]--dump\f[] \f[I]file\f[]
|
||||
-Dump SMART data to the specified path and file name \f[I]file\f[].
|
||||
-The SMART data is extracted from an NVMe device, so specifying one is
|
||||
-mandatory if this option is selected.
|
||||
-File created is in a simple key=value format.
|
||||
-.RS
|
||||
-.RE
|
||||
-.TP
|
||||
-.B \f[B]\-f\f[], \f[B]--file\f[] \f[I]file\f[]
|
||||
-This option usage is for testing only.
|
||||
-Use SMART data from the specified path and file name \f[I]file\f[]
|
||||
-instead of device, one NVMe is mandatory if this option is selected.
|
||||
-The expected format of the file is a simple key=value that is the same
|
||||
-one provided with the \-d / --dump option.
|
||||
-If \f[I]file\f[] is missing from the filesystem it will be treated as a
|
||||
-failure to retrieve SMART data and an event will be reported.
|
||||
-.RS
|
||||
-.RE
|
||||
-.TP
|
||||
-.B \f[B]\-h\f[], \f[B]--help\f[]
|
||||
-Print a help message and exit
|
||||
-.RS
|
||||
-.RE
|
||||
-.SH EXAMPLES
|
||||
-.TP
|
||||
-.B \f[B]diag_nvme\f[]
|
||||
-Run diagnostics in all NVMe devices detected in the system.
|
||||
-.RS
|
||||
-.RE
|
||||
-.TP
|
||||
.B \f[B]diag_nvme nvme0 nvme1\f[]
|
||||
Run diagnostics only in nvme0 and nvme1 devices.
|
||||
.RS
|
||||
.RE
|
||||
-.TP
|
||||
-.B \f[B]diag_nvme \-d smart.txt nvme0\f[]
|
||||
-Dump SMART data from nvme0 into file smart.txt.
|
||||
-.RS
|
||||
-.RE
|
||||
-.TP
|
||||
-.B \f[B]diag_nvme \-f smart.txt nvme0\f[]
|
||||
-Read SMART data from file smart.txt and use it as health information for
|
||||
-diagnostics of device nvme0.
|
||||
-.RS
|
||||
-.RE
|
||||
.SH REPORTING BUGS
|
||||
.PP
|
||||
Patches and issues may be submitted at
|
89
ppc64-diag-2.7.9-rtas_errd_crash.patch
Normal file
89
ppc64-diag-2.7.9-rtas_errd_crash.patch
Normal file
@ -0,0 +1,89 @@
|
||||
commit 357923dafda766429acbe68470c3bd6028d5ebf5
|
||||
Author: Sathvika Vasireddy <sv@linux.ibm.com>
|
||||
Date: Sun May 5 02:48:25 2024 -0400
|
||||
|
||||
rtas_errd: Fix core dump with large filename passed to -f option
|
||||
|
||||
When a filename passed to rtas_errd's -f option is excessively long,
|
||||
it causes a stack buffer overflow in the _log_msg() function, leading
|
||||
to stack smashing.
|
||||
|
||||
The _log_msg() function, utilized by log_msg(), operates with a buffer
|
||||
limited to 4096 characters. Additional space is consumed by _dbg() and
|
||||
re-formatting in _log_msg(), increasing the risk of buffer overflow.
|
||||
|
||||
To address this, in case of an error, if the filename exceeds the
|
||||
length of 2048 characters, truncate it and log a message indicating the
|
||||
truncation. Use 2048 characters as limit for filename length to allow
|
||||
space for further modifications.
|
||||
|
||||
Additionally, add a check when processing the -f option to ensure that
|
||||
the length of the specified filename does not exceed 4096 characters.
|
||||
|
||||
Reported-by: R Nageswara Sastry <rnsastry@linux.ibm.com>
|
||||
Closes: https://github.com/power-ras/ppc64-diag/issues/31
|
||||
Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
|
||||
Tested-by: R Nageswara Sastry<rnsastry@linux.ibm.com>
|
||||
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>
|
||||
|
||||
diff --git a/rtas_errd/files.c b/rtas_errd/files.c
|
||||
index 4be75c6..3750bdc 100644
|
||||
--- a/rtas_errd/files.c
|
||||
+++ b/rtas_errd/files.c
|
||||
@@ -284,10 +284,27 @@ init_files(void)
|
||||
proc_error_log_fd = open(proc_error_log2, O_RDONLY);
|
||||
|
||||
if (proc_error_log_fd < 0) {
|
||||
- log_msg(NULL, "Could not open error log file at either %s or "
|
||||
- "%s, %s\nThe rtas_errd daemon cannot continue and will "
|
||||
- "exit", proc_error_log1, proc_error_log2,
|
||||
- strerror(errno));
|
||||
+
|
||||
+ if (strlen(proc_error_log1) <= 2048) {
|
||||
+ log_msg(NULL, "Could not open error log file at either %s or "
|
||||
+ "%s, %s\nThe rtas_errd daemon cannot continue and will "
|
||||
+ "exit", proc_error_log1, proc_error_log2,
|
||||
+ strerror(errno));
|
||||
+ } else {
|
||||
+ /* If the filename is too long, truncate it */
|
||||
+ char truncated_filename[2048];
|
||||
+
|
||||
+ strncpy(truncated_filename, proc_error_log1,
|
||||
+ sizeof(truncated_filename) - 1);
|
||||
+ truncated_filename[sizeof(truncated_filename) - 1] = '\0';
|
||||
+
|
||||
+ log_msg(NULL, "Truncating the filename since it is too long "
|
||||
+ "(%d characters)", strlen(proc_error_log1));
|
||||
+ log_msg(NULL, "Could not open error log file at either %s or "
|
||||
+ "%s, %s\nThe rtas_errd daemon cannot continue and will "
|
||||
+ "exit", truncated_filename, proc_error_log2,
|
||||
+ strerror(errno));
|
||||
+ }
|
||||
return -1;
|
||||
}
|
||||
|
||||
diff --git a/rtas_errd/rtas_errd.c b/rtas_errd/rtas_errd.c
|
||||
index 10c422c..f6c6a4a 100644
|
||||
--- a/rtas_errd/rtas_errd.c
|
||||
+++ b/rtas_errd/rtas_errd.c
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
#include <librtas.h>
|
||||
+#include <limits.h>
|
||||
|
||||
#include "rtas_errd.h"
|
||||
#include "platform.h"
|
||||
@@ -474,6 +475,12 @@ main(int argc, char *argv[])
|
||||
|
||||
f_flag++;
|
||||
proc_error_log1 = optarg;
|
||||
+ if (strlen(proc_error_log1) > PATH_MAX) {
|
||||
+ fprintf(stderr, "The specified file path %s exceeds"
|
||||
+ " the maximum supported file length of 4096 characters.\n",
|
||||
+ proc_error_log1);
|
||||
+ goto error_out;
|
||||
+ }
|
||||
proc_error_log2 = NULL;
|
||||
break;
|
||||
|
@ -1,15 +1,10 @@
|
||||
# BZ#860040:
|
||||
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}\/usr\/libexec\/ppc64-diag\/servevent_parse.pl
|
||||
|
||||
Name: ppc64-diag
|
||||
Version: 2.7.9
|
||||
Release: 3%{?dist}
|
||||
Release: 6%{?dist}
|
||||
Summary: PowerLinux Platform Diagnostics
|
||||
URL: https://github.com/power-ras/ppc64-diag
|
||||
Group: System Environment/Base
|
||||
URL: https://github.com/power-ras/%{name}
|
||||
License: GPLv2
|
||||
ExclusiveArch: ppc %{power64}
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libservicelog-devel
|
||||
@ -40,14 +35,19 @@ Source5: rtas_errd.8
|
||||
Patch0: ppc64-diag-2.7.9-fedora.patch
|
||||
|
||||
# upstream fixes
|
||||
# rtas_errd: Handle multiple platform dumps
|
||||
Patch10: ppc64-diag-2.7.9-handle_multiple_platform_dumps.patch
|
||||
# ppc64-diag/lp_diag: Enable light path diagnostics for RTAS events
|
||||
Patch11: ppc64-diag-2.7.9-moving-trim_trail_space-function.patch
|
||||
Patch12: ppc64-diag-2.7.9-utilize-trim_trail_space-in-event_fru_callout.patch
|
||||
Patch13: ppc64-diag-2.7.9-enable-light-path-diagnostics-for-RTAS-events.patch
|
||||
# call_home command "diag_nvme" fails on nvmf drive(nvmf/lpfc/Power10)
|
||||
Patch14: ppc64-diag-2.7.9-call_home-fail-on-nvmf-device
|
||||
Patch10: ppc64-diag-2.7.9-handle_multiple_platform_dumps.patch
|
||||
Patch11: ppc64-diag-2.7.9-remove_d_and_f_option.patch
|
||||
Patch12: ppc64-diag-2.7.9-moving-trim_trail_space-function.patch
|
||||
Patch13: ppc64-diag-2.7.9-utilize-trim_trail_space-in-event_fru_callout.patch
|
||||
Patch14: ppc64-diag-2.7.9-enable-light-path-diagnostics-for-RTAS-events.patch
|
||||
Patch15: ppc64-diag-2.7.9-improvements_status_and_err_messages.patch
|
||||
Patch16: ppc64-diag-2.7.9-remove-d-and-f-from-usage.patch
|
||||
Patch17: ppc64-diag-2.7.9-diag_encl-man-and-help-page.patch
|
||||
Patch18: ppc64-diag-2.7.9-diag_nvme-man-and-help-page.patch
|
||||
Patch19: ppc64-diag-2.7.9-call_home-fail-on-nvmf-device.patch
|
||||
Patch20: ppc64-diag-2.7.9-compiler-warnings.patch
|
||||
Patch21: ppc64-diag-2.7.9-rtas_errd_crash.patch
|
||||
Patch22: ppc64-diag-2.7.9-diag_vnme-add-power11-support.patch
|
||||
|
||||
%description
|
||||
This package contains various diagnostic tools for PowerLinux.
|
||||
@ -59,9 +59,10 @@ predictive failures, if appropriate modifies the FRUs fault
|
||||
indicator(s) and provides event notification to system
|
||||
administrators or connected service frameworks.
|
||||
|
||||
%package rtas
|
||||
Summary: rtas_errd daemon
|
||||
Requires: powerpc-utils-core >= 1.3.6-6
|
||||
%package rtas
|
||||
Summary: rtas_errd daemon
|
||||
# PCI hotplug support on PowerKVM guest depends on below powerpc-utils version.
|
||||
Requires: powerpc-utils-core >= 1.3.7-5
|
||||
|
||||
%description rtas
|
||||
This package contains only rtas_errd daemon.
|
||||
@ -71,8 +72,8 @@ This package contains only rtas_errd daemon.
|
||||
|
||||
%build
|
||||
./autogen.sh
|
||||
%configure
|
||||
LDFLAGS="%{build_ldflags}" CFLAGS="%{build_cflags}" CXXFLAGS="%{build_cflags}" make %{?_smp_mflags} V=1
|
||||
CXXFLAGS="-std=gnu++14 %{build_cflags}" %configure
|
||||
LDFLAGS="%{build_ldflags}" CFLAGS="%{build_cflags}" CXXFLAGS="-std=gnu++14 %{build_cflags}" make %{?_smp_mflags} V=1
|
||||
|
||||
%install
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
@ -83,7 +84,6 @@ mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/ses_pages
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log/dump
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log/opal-elog
|
||||
|
||||
ln -sfv %{_sbindir}/usysattn $RPM_BUILD_ROOT/%{_sbindir}/usysfault
|
||||
install -m 644 %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} $RPM_BUILD_ROOT/%{_mandir}/man8/
|
||||
|
||||
@ -142,18 +142,18 @@ install -m 644 %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} $RPM_BUILD
|
||||
%{_libexecdir}/%{name}/lp_diag_setup --register >/dev/null 2>&1
|
||||
%{_libexecdir}/%{name}/ppc64_diag_setup --register >/dev/null 2>&1
|
||||
if [ "$1" = "1" ]; then # first install
|
||||
systemctl -q enable opal_errd.service >/dev/null 2>&1
|
||||
systemctl start opal_errd.service >/dev/null 2>&1
|
||||
systemctl -q enable opal_errd.service >/dev/null
|
||||
systemctl start opal_errd.service >/dev/null
|
||||
elif [ "$1" = "2" ]; then # upgrade
|
||||
systemctl restart opal_errd.service >/dev/null 2>&1
|
||||
systemctl restart opal_errd.service >/dev/null
|
||||
systemctl daemon-reload > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
%preun
|
||||
# Pre-uninstall script -------------------------------------------------
|
||||
if [ "$1" = "0" ]; then # last uninstall
|
||||
systemctl stop opal_errd.service >/dev/null 2>&1
|
||||
systemctl -q disable opal_errd.service >/dev/null 2>&1
|
||||
systemctl stop opal_errd.service >/dev/null
|
||||
systemctl -q disable opal_errd.service
|
||||
%{_libexecdir}/%{name}/ppc64_diag_setup --unregister >/dev/null
|
||||
%{_libexecdir}/%{name}/lp_diag_setup --unregister >/dev/null
|
||||
systemctl daemon-reload > /dev/null 2>&1
|
||||
@ -162,10 +162,11 @@ fi
|
||||
%triggerin -- librtas
|
||||
# trigger on librtas upgrades ------------------------------------------
|
||||
if [ "$2" = "2" ]; then
|
||||
systemctl restart opal_errd.service >/dev/null 2>&1
|
||||
systemctl restart rtas_errd.service >/dev/null 2>&1
|
||||
systemctl restart opal_errd.service >/dev/null
|
||||
systemctl restart rtas_errd.service >/dev/null
|
||||
fi
|
||||
|
||||
|
||||
%post rtas
|
||||
if [ "$1" = "1" ]; then # first install
|
||||
systemctl -q enable rtas_errd.service >/dev/null
|
||||
@ -183,48 +184,84 @@ if [ "$1" = "0" ]; then # last uninstall
|
||||
fi
|
||||
|
||||
%changelog
|
||||
* Wed Jan 31 2024 Than Ngo <than@redhat.com> - 2.7.9-3
|
||||
- call_home command "diag_nvme" fails on nvmf drive
|
||||
Resolves: RHEL-23437
|
||||
* Wed Jan 08 2025 Than Ngo <than@redhat.com> - 2.7.9-6
|
||||
- Resolves: RHEL-72515, Added Power11 support for diag_nvme
|
||||
|
||||
* Sun Dec 10 2023 Than Ngo <than@redhat.com> - 2.7.9-2
|
||||
* Mon Dec 02 2024 Than Ngo <than@redhat.com> - 2.7.9-5
|
||||
- man and help of diag_nvme are not in sync
|
||||
- compiler warnings
|
||||
- diag_nvme: call_home command fails on nvmf drive
|
||||
- rtas_errd: Fix core dump with large filename passed to -f option
|
||||
Resolves: RHEL-55398
|
||||
|
||||
* Sun Oct 27 2024 Than Ngo <than@redhat.com> - 2.7.9-4
|
||||
- Resolves: RHEL-55399, diag_encl man and help page are not in sync
|
||||
|
||||
* Sun Dec 10 2023 Than Ngo <than@redhat.com> - 2.7.9-3
|
||||
- Enable light path diagnostics for RTAS events
|
||||
- Handle multiple platform dumps
|
||||
Resolves: RHEL-11454
|
||||
Resolves: RHEL-11478
|
||||
|
||||
* Wed Oct 19 2022 Than Ngo <than@redhat.com> - 2.7.9-1
|
||||
- Resolves: #2114591, rebase to 2.7.9
|
||||
* Thu Jul 20 2023 Than Ngo <than@redhat.com> - 2.7.9-2
|
||||
- Resolves: #2177948, handle multiple platform dumps
|
||||
|
||||
* Fri May 13 2022 Than Ngo <than@redhat.com> - 2.7.8-1
|
||||
- Resolves: #2051313, rebase to 2.7.8
|
||||
* Tue Oct 18 2022 Than Ngo <than@redhat.com> - 2.7.9-1
|
||||
- Resolves: #2110128, add NVMe Call Home support
|
||||
|
||||
* Fri May 06 2022 Than Ngo <than@redhat.com> - 2.7.8-1
|
||||
- Resolves: #2051286, rebase to 2.7.8
|
||||
|
||||
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.7.7-2
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
||||
* Mon May 17 2021 Than Ngo <than@redhat.com> - 2.7.7-1
|
||||
- Resolves: #1779206, rebase to 2.7.7
|
||||
- Resolves: #1869567, rebase to 2.7.7
|
||||
|
||||
* Thu Mar 26 2020 Than Ngo <than@redhat.com> - 2.7.6-2
|
||||
- Resolves: #1814335, create rtas subpackage to avoid the perl dependency
|
||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.7.6-10
|
||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||
|
||||
* Thu Nov 07 2019 Than Ngo <than@redhat.com> - 2.7.6-1
|
||||
- Resolves: #1725200, rebase to 2.7.6
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.6-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Wed Jun 19 2019 Than Ngo <than@redhat.com> - 2.7.5-2
|
||||
- Resolves: #1721497, added /var/log/ppc64-diag and systemctl daemon-reload
|
||||
* Tue Oct 27 2020 Jeff Law <law@redhat.com> - 2.7.6-8
|
||||
- Force C++14 for configure step too
|
||||
|
||||
* Tue Apr 30 2019 Than Ngo <than@redhat.com> - 2.7.5-1
|
||||
- Resolves: #1664093, update to latest upstream 2.7.5
|
||||
* Tue Oct 27 2020 Jeff Law <law@redhat.com> - 2.7.6-7
|
||||
- Force C++14 mode as this code is not C++17 ready
|
||||
|
||||
* Mon Dec 10 2018 Than Ngo <than@redhat.com> - 2.7.4-4
|
||||
- install missing man pages
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.6-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Mon Dec 10 2018 Than Ngo <than@redhat.com> - 2.7.4-3
|
||||
- create diag_disk path part of installation
|
||||
- diags: Increase buffer length size to read complete system vpd information
|
||||
- diags: Remove timestamp from disk health log file
|
||||
- diags: Create diag_disk log directory manually if not present
|
||||
Resolves: #1657757
|
||||
* Mon Mar 30 2020 Than Ngo <than@redhat.com> - 2.7.6-5
|
||||
- add requirement on powerpc-utils in main package
|
||||
|
||||
* Sat Mar 28 2020 Than Ngo <than@redhat.com> - 2.7.6-4
|
||||
- create rtas subpackage to avoid the perl dependency
|
||||
|
||||
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.6-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Mon Dec 02 2019 Than Ngo <than@redhat.com> - 2.7.6-2
|
||||
- Update Url and Source
|
||||
|
||||
* Wed Nov 27 2019 Than Ngo <than@redhat.com> - 2.7.6-1
|
||||
- rebase to 2.7.6
|
||||
- update Url
|
||||
|
||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.5-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Thu Apr 25 2019 Vasant Hegde <hegdevasant@linux.vnet.ibm.com> - 2.7.5-1
|
||||
- Update to latest upstream 2.7.5
|
||||
|
||||
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.4-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.4-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Thu May 10 2018 Dan Horák <dan[at]danny.cz> - 2.7.4-2
|
||||
- fix conditition for rtas_errd service (#1575638)
|
||||
- fix condition for rtas_errd service (#1575638)
|
||||
|
||||
* Fri Mar 09 2018 Than Ngo <than@redhat.com> - 2.7.4-1
|
||||
- update to latest upstream 2.7.4
|
Loading…
Reference in New Issue
Block a user