summaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/user_syms.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:27:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:27:49 +0000
commitace9429bb58fd418f0c81d4c2835699bddf6bde6 (patch)
treeb2d64bc10158fdd5497876388cd68142ca374ed3 /arch/um/os-Linux/user_syms.c
parentInitial commit. (diff)
downloadlinux-ace9429bb58fd418f0c81d4c2835699bddf6bde6.tar.xz
linux-ace9429bb58fd418f0c81d4c2835699bddf6bde6.zip
Adding upstream version 6.6.15.upstream/6.6.15
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'arch/um/os-Linux/user_syms.c')
-rw-r--r--arch/um/os-Linux/user_syms.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
new file mode 100644
index 0000000000..a310ae27b4
--- /dev/null
+++ b/arch/um/os-Linux/user_syms.c
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0
+#define __NO_FORTIFY
+#include <linux/types.h>
+#include <linux/module.h>
+
+/*
+ * This file exports some critical string functions and compiler
+ * built-in functions (where calls are emitted by the compiler
+ * itself that we cannot avoid even in kernel code) to modules.
+ *
+ * "_user.c" code that previously used exports here such as hostfs
+ * really should be considered part of the 'hypervisor' and define
+ * its own API boundary like hostfs does now; don't add exports to
+ * this file for such cases.
+ */
+
+/* If it's not defined, the export is included in lib/string.c.*/
+#ifdef __HAVE_ARCH_STRSTR
+#undef strstr
+EXPORT_SYMBOL(strstr);
+#endif
+
+#ifndef __x86_64__
+#undef memcpy
+extern void *memcpy(void *, const void *, size_t);
+EXPORT_SYMBOL(memcpy);
+extern void *memmove(void *, const void *, size_t);
+EXPORT_SYMBOL(memmove);
+#undef memset
+extern void *memset(void *, int, size_t);
+EXPORT_SYMBOL(memset);
+#endif
+
+#ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA
+/* needed for __access_ok() */
+EXPORT_SYMBOL(vsyscall_ehdr);
+EXPORT_SYMBOL(vsyscall_end);
+#endif
+
+#ifdef _FORTIFY_SOURCE
+extern int __sprintf_chk(char *str, int flag, size_t len, const char *format);
+EXPORT_SYMBOL(__sprintf_chk);
+#endif