mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
EDAC/mc: Report "unknown memory" on too many DIMM labels found
[ Upstream commit 65bb4d1af9 ]
There is a limitation to report only EDAC_MAX_LABELS in e->label of
the error descriptor. This is to prevent a potential string overflow.
The current implementation falls back to "any memory" in this case and
also stops all further processing to find a unique row and channel of
the possible error location.
Reporting "any memory" is wrong as the memory controller reported an
error location for one of the layers. Instead, report "unknown memory"
and also do not break early in the loop to further check row and channel
for uniqueness.
[ bp: Massage commit message. ]
Signed-off-by: Robert Richter <rrichter@marvell.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Aristeu Rozanski <aris@redhat.com>
Link: https://lkml.kernel.org/r/20200123090210.26933-7-rrichter@marvell.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bb4e801134
commit
14b5ed1c72
@@ -1180,20 +1180,21 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type,
|
||||
* channel/memory controller/... may be affected.
|
||||
* Also, don't show errors for empty DIMM slots.
|
||||
*/
|
||||
if (!e->enable_per_layer_report || !dimm->nr_pages)
|
||||
if (!dimm->nr_pages)
|
||||
continue;
|
||||
|
||||
if (n_labels >= EDAC_MAX_LABELS) {
|
||||
e->enable_per_layer_report = false;
|
||||
break;
|
||||
}
|
||||
n_labels++;
|
||||
if (p != e->label) {
|
||||
strcpy(p, OTHER_LABEL);
|
||||
p += strlen(OTHER_LABEL);
|
||||
if (n_labels > EDAC_MAX_LABELS) {
|
||||
p = e->label;
|
||||
*p = '\0';
|
||||
} else {
|
||||
if (p != e->label) {
|
||||
strcpy(p, OTHER_LABEL);
|
||||
p += strlen(OTHER_LABEL);
|
||||
}
|
||||
strcpy(p, dimm->label);
|
||||
p += strlen(p);
|
||||
}
|
||||
strcpy(p, dimm->label);
|
||||
p += strlen(p);
|
||||
|
||||
/*
|
||||
* get csrow/channel of the DIMM, in order to allow
|
||||
|
||||
Reference in New Issue
Block a user