From 77eb31b6003a158cce534fa9ca9df21fc82672ea Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Thu, 19 Sep 2024 14:45:06 +0200 Subject: [PATCH] um: Add compile time assert that stub fits on a page The code assumes that the stub code can fit into a single page. This is unlikely to ever change, but add a link time assert instead so that there will be no hard to debug error. Signed-off-by: Benjamin Berg Link: https://patch.msgid.link/20240919124511.282088-6-benjamin@sipsolutions.net Signed-off-by: Johannes Berg --- arch/um/kernel/dyn.lds.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S index 3385d653ebd0..dc9d9a68af55 100644 --- a/arch/um/kernel/dyn.lds.S +++ b/arch/um/kernel/dyn.lds.S @@ -178,3 +178,6 @@ SECTIONS DISCARDS } + +ASSERT(__syscall_stub_end - __syscall_stub_start <= PAGE_SIZE, + "STUB code must not be larger than one page"); -- 2.51.0