]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
um: Add compile time assert that stub fits on a page
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 19 Sep 2024 12:45:06 +0000 (14:45 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 10 Oct 2024 11:37:21 +0000 (13:37 +0200)
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 <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20240919124511.282088-6-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/kernel/dyn.lds.S

index 3385d653ebd0d04f5a342adb4b47affabcb0cfab..dc9d9a68af559b37e212c57eb92645b801a51205 100644 (file)
@@ -178,3 +178,6 @@ SECTIONS
 
   DISCARDS
 }
+
+ASSERT(__syscall_stub_end - __syscall_stub_start <= PAGE_SIZE,
+       "STUB code must not be larger than one page");