Skip to content

Commit 98c738c

Browse files
nathanlynchmpe
authored andcommitted
powerpc/rtas: mandate RTAS syscall filtering
CONFIG_PPC_RTAS_FILTER has been optional but default-enabled since its introduction. It's been enabled in enterprise distro kernels for a while without causing ABI breakage that wasn't easily fixed, and it prevents harmful abuses of the rtas syscall. Let's make it unconditional. Signed-off-by: Nathan Lynch <[email protected]> Reviewed-by: Andrew Donnellan <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f975b65 commit 98c738c

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

arch/powerpc/Kconfig

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,19 +1044,6 @@ config PPC_SECVAR_SYSFS
10441044
read/write operations on these variables. Say Y if you have
10451045
secure boot enabled and want to expose variables to userspace.
10461046

1047-
config PPC_RTAS_FILTER
1048-
bool "Enable filtering of RTAS syscalls"
1049-
default y
1050-
depends on PPC_RTAS
1051-
help
1052-
The RTAS syscall API has security issues that could be used to
1053-
compromise system integrity. This option enforces restrictions on the
1054-
RTAS calls and arguments passed by userspace programs to mitigate
1055-
these issues.
1056-
1057-
Say Y unless you know what you are doing and the filter is causing
1058-
problems for you.
1059-
10601047
endmenu
10611048

10621049
config ISA_DMA_API

arch/powerpc/kernel/rtas.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,6 @@ noinstr struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log
10501050
return NULL;
10511051
}
10521052

1053-
#ifdef CONFIG_PPC_RTAS_FILTER
1054-
10551053
/*
10561054
* The sys_rtas syscall, as originally designed, allows root to pass
10571055
* arbitrary physical addresses to RTAS calls. A number of RTAS calls
@@ -1200,20 +1198,6 @@ static void __init rtas_syscall_filter_init(void)
12001198
rtas_filters[i].token = rtas_token(rtas_filters[i].name);
12011199
}
12021200

1203-
#else
1204-
1205-
static bool block_rtas_call(int token, int nargs,
1206-
struct rtas_args *args)
1207-
{
1208-
return false;
1209-
}
1210-
1211-
static void __init rtas_syscall_filter_init(void)
1212-
{
1213-
}
1214-
1215-
#endif /* CONFIG_PPC_RTAS_FILTER */
1216-
12171201
/* We assume to be passed big endian arguments */
12181202
SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs)
12191203
{

0 commit comments

Comments
 (0)