[PATCH RFC] powerpc/rtas: Make it possible to disable sys_rtas

Michal Suchanek msuchanek at suse.de
Wed Sep 6 22:08:46 AEST 2023


Additional patch suggestion to go with the rtas devices:

-----------------------------------------------------------------------

With most important rtas functions available through different
interfaces the sys_rtas interface can be disabled completely.

Do not remove it for now to make it possible to run older versions of
userspace tools that don't support other interfaces.

Signed-off-by: Michal Suchanek <msuchanek at suse.de>
---
 arch/powerpc/kernel/rtas.c     | 2 ++
 arch/powerpc/platforms/Kconfig | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index eddc031c4b95..5854a8bb5731 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -1684,6 +1684,7 @@ noinstr struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log
 	return NULL;
 }
 
+#ifdef PPC_RTAS_SYSCALL
 /*
  * The sys_rtas syscall, as originally designed, allows root to pass
  * arbitrary physical addresses to RTAS calls. A number of RTAS calls
@@ -1893,6 +1894,7 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs)
 
 	return 0;
 }
+#endif
 
 static void __init rtas_function_table_init(void)
 {
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 1fd253f92a77..9563e38188d5 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -150,6 +150,15 @@ config RTAS_FLASH
 	tristate "Firmware flash interface"
 	depends on PPC64 && RTAS_PROC
 
+config RTAS_SYSCALL
+	bool "Legacy syscall interface to RTAS"
+	depends on PPC_RTAS
+	default y
+	help
+	  Enables support for the legacy sys_rtas interface. Calls that need to
+	  pass data buffers use /dev/mem directly which is not compatible with
+	  lockdown. For now some tools still need this interface to work.
+
 config MMIO_NVRAM
 	bool
 
-- 
2.41.0



More information about the Linuxppc-dev mailing list