Skip to content

Commit 7bc0805

Browse files
ajdlinuxmpe
authored andcommitted
powerpc/rtas: Allow ibm,platform-dump RTAS call with null buffer address
Add a special case to block_rtas_call() to allow the ibm,platform-dump RTAS call through the RTAS filter if the buffer address is 0. According to PAPR, ibm,platform-dump is called with a null buffer address to notify the platform firmware that processing of a particular dump is finished. Without this, on a pseries machine with CONFIG_PPC_RTAS_FILTER enabled, an application such as rtas_errd that is attempting to retrieve a dump will encounter an error at the end of the retrieval process. Fixes: bd59380 ("powerpc/rtas: Restrict RTAS requests from userspace") Cc: [email protected] Reported-by: Sathvika Vasireddy <[email protected]> Signed-off-by: Andrew Donnellan <[email protected]> Reviewed-by: Tyrel Datwyler <[email protected]> Reviewed-by: Nathan Lynch <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ec6d0dd commit 7bc0805

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

arch/powerpc/kernel/rtas.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ static struct rtas_filter rtas_filters[] __ro_after_init = {
10711071
{ "get-time-of-day", -1, -1, -1, -1, -1 },
10721072
{ "ibm,get-vpd", -1, 0, -1, 1, 2 },
10731073
{ "ibm,lpar-perftools", -1, 2, 3, -1, -1 },
1074-
{ "ibm,platform-dump", -1, 4, 5, -1, -1 },
1074+
{ "ibm,platform-dump", -1, 4, 5, -1, -1 }, /* Special cased */
10751075
{ "ibm,read-slot-reset-state", -1, -1, -1, -1, -1 },
10761076
{ "ibm,scan-log-dump", -1, 0, 1, -1, -1 },
10771077
{ "ibm,set-dynamic-indicator", -1, 2, -1, -1, -1 },
@@ -1120,6 +1120,15 @@ static bool block_rtas_call(int token, int nargs,
11201120
size = 1;
11211121

11221122
end = base + size - 1;
1123+
1124+
/*
1125+
* Special case for ibm,platform-dump - NULL buffer
1126+
* address is used to indicate end of dump processing
1127+
*/
1128+
if (!strcmp(f->name, "ibm,platform-dump") &&
1129+
base == 0)
1130+
return false;
1131+
11231132
if (!in_rmo_buf(base, end))
11241133
goto err;
11251134
}

0 commit comments

Comments
 (0)