xref: /linux/arch/um/os-Linux/user_syms.c (revision 5d90cf6dcc6a4cb85a51ffe007a8e34375799164)
1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
2ba38961aSKees Cook #define __NO_FORTIFY
337185b33SAl Viro #include <linux/types.h>
437185b33SAl Viro #include <linux/module.h>
51da177e4SLinus Torvalds 
6*5d90cf6dSJohannes Berg /*
7*5d90cf6dSJohannes Berg  * This file exports some critical string functions and compiler
8*5d90cf6dSJohannes Berg  * built-in functions (where calls are emitted by the compiler
9*5d90cf6dSJohannes Berg  * itself that we cannot avoid even in kernel code) to modules.
10*5d90cf6dSJohannes Berg  *
11*5d90cf6dSJohannes Berg  * "_user.c" code that previously used exports here such as hostfs
12*5d90cf6dSJohannes Berg  * really should be considered part of the 'hypervisor' and define
13*5d90cf6dSJohannes Berg  * its own API boundary like hostfs does now; don't add exports to
14*5d90cf6dSJohannes Berg  * this file for such cases.
15e8234483SJeff Dike  */
161da177e4SLinus Torvalds 
171a65f493SJeff Dike /* If it's not defined, the export is included in lib/string.c.*/
187c45ad16SPaolo 'Blaisorblade' Giarrusso #ifdef __HAVE_ARCH_STRSTR
19*5d90cf6dSJohannes Berg #undef strstr
207c45ad16SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(strstr);
217c45ad16SPaolo 'Blaisorblade' Giarrusso #endif
227c45ad16SPaolo 'Blaisorblade' Giarrusso 
2300699e84Sakpm@linux-foundation.org #ifndef __x86_64__
24*5d90cf6dSJohannes Berg #undef memcpy
2500699e84Sakpm@linux-foundation.org extern void *memcpy(void *, const void *, size_t);
261da177e4SLinus Torvalds EXPORT_SYMBOL(memcpy);
27*5d90cf6dSJohannes Berg extern void *memmove(void *, const void *, size_t);
281da177e4SLinus Torvalds EXPORT_SYMBOL(memmove);
29*5d90cf6dSJohannes Berg #undef memset
30*5d90cf6dSJohannes Berg extern void *memset(void *, int, size_t);
311da177e4SLinus Torvalds EXPORT_SYMBOL(memset);
325b301409SPatricia Alfonso #endif
335b301409SPatricia Alfonso 
34c6b17bbdSAl Viro #ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA
35*5d90cf6dSJohannes Berg /* needed for __access_ok() */
361da177e4SLinus Torvalds EXPORT_SYMBOL(vsyscall_ehdr);
371da177e4SLinus Torvalds EXPORT_SYMBOL(vsyscall_end);
381da177e4SLinus Torvalds #endif
391da177e4SLinus Torvalds 
40cead61a6SPaolo 'Blaisorblade' Giarrusso /* Export symbols used by GCC for the stack protector. */
41cead61a6SPaolo 'Blaisorblade' Giarrusso extern void __stack_smash_handler(void *) __attribute__((weak));
42cead61a6SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(__stack_smash_handler);
43cead61a6SPaolo 'Blaisorblade' Giarrusso 
44cead61a6SPaolo 'Blaisorblade' Giarrusso extern long __guard __attribute__((weak));
45cead61a6SPaolo 'Blaisorblade' Giarrusso EXPORT_SYMBOL(__guard);
46f956b3e4SRichard Weinberger 
47f956b3e4SRichard Weinberger #ifdef _FORTIFY_SOURCE
48*5d90cf6dSJohannes Berg extern int __sprintf_chk(char *str, int flag, size_t len, const char *format);
49f956b3e4SRichard Weinberger EXPORT_SYMBOL(__sprintf_chk);
50f956b3e4SRichard Weinberger #endif
51