Commit f956b3e40ad7b9f7c0d33b80fe78f57fedb74f49

Authored by Richard Weinberger
Committed by Linus Torvalds
1 parent 22e9b917ab

um: fix _FORTIFY_SOURCE=2 support for kernel modules

When UML is compiled with _FORTIFY_SOURCE we have to export all _chk()
functions which are used in modules.  For now it's only the case for
__sprintf_chk().

Tested-by: Florian Fainelli <florian@openwrt.org>
Reported-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Vitaliy Ivanov <vitalivanov@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

arch/um/os-Linux/user_syms.c
... ... @@ -113,4 +113,9 @@
113 113  
114 114 extern long __guard __attribute__((weak));
115 115 EXPORT_SYMBOL(__guard);
  116 +
  117 +#ifdef _FORTIFY_SOURCE
  118 +extern int __sprintf_chk(char *str, int flag, size_t strlen, const char *format);
  119 +EXPORT_SYMBOL(__sprintf_chk);
  120 +#endif