162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci#define __NO_FORTIFY 362306a36Sopenharmony_ci#include <linux/types.h> 462306a36Sopenharmony_ci#include <linux/module.h> 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci/* 762306a36Sopenharmony_ci * This file exports some critical string functions and compiler 862306a36Sopenharmony_ci * built-in functions (where calls are emitted by the compiler 962306a36Sopenharmony_ci * itself that we cannot avoid even in kernel code) to modules. 1062306a36Sopenharmony_ci * 1162306a36Sopenharmony_ci * "_user.c" code that previously used exports here such as hostfs 1262306a36Sopenharmony_ci * really should be considered part of the 'hypervisor' and define 1362306a36Sopenharmony_ci * its own API boundary like hostfs does now; don't add exports to 1462306a36Sopenharmony_ci * this file for such cases. 1562306a36Sopenharmony_ci */ 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci/* If it's not defined, the export is included in lib/string.c.*/ 1862306a36Sopenharmony_ci#ifdef __HAVE_ARCH_STRSTR 1962306a36Sopenharmony_ci#undef strstr 2062306a36Sopenharmony_ciEXPORT_SYMBOL(strstr); 2162306a36Sopenharmony_ci#endif 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci#ifndef __x86_64__ 2462306a36Sopenharmony_ci#undef memcpy 2562306a36Sopenharmony_ciextern void *memcpy(void *, const void *, size_t); 2662306a36Sopenharmony_ciEXPORT_SYMBOL(memcpy); 2762306a36Sopenharmony_ciextern void *memmove(void *, const void *, size_t); 2862306a36Sopenharmony_ciEXPORT_SYMBOL(memmove); 2962306a36Sopenharmony_ci#undef memset 3062306a36Sopenharmony_ciextern void *memset(void *, int, size_t); 3162306a36Sopenharmony_ciEXPORT_SYMBOL(memset); 3262306a36Sopenharmony_ci#endif 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci#ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA 3562306a36Sopenharmony_ci/* needed for __access_ok() */ 3662306a36Sopenharmony_ciEXPORT_SYMBOL(vsyscall_ehdr); 3762306a36Sopenharmony_ciEXPORT_SYMBOL(vsyscall_end); 3862306a36Sopenharmony_ci#endif 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci#ifdef _FORTIFY_SOURCE 4162306a36Sopenharmony_ciextern int __sprintf_chk(char *str, int flag, size_t len, const char *format); 4262306a36Sopenharmony_ciEXPORT_SYMBOL(__sprintf_chk); 4362306a36Sopenharmony_ci#endif 44