--- zzzz-none-000/linux-4.4.60/include/linux/thread_info.h 2017-04-08 07:53:53.000000000 +0000 +++ scorpion-7490-727/linux-4.4.60/include/linux/thread_info.h 2021-02-04 17:41:59.000000000 +0000 @@ -13,6 +13,16 @@ struct timespec; struct compat_timespec; +#ifdef CONFIG_THREAD_INFO_IN_TASK +/* + * For CONFIG_THREAD_INFO_IN_TASK kernels we need for the + * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels, + * including can cause a circular dependency on some platforms. + */ +#include +#define current_thread_info() ((struct thread_info *)current) +#endif + /* * System call restart block. */ @@ -145,6 +155,21 @@ #error "no set_restore_sigmask() provided and default one won't work" #endif +#ifdef CONFIG_HARDENED_USERCOPY +extern void __check_object_size(const void *ptr, unsigned long n, + bool to_user); + +static inline void check_object_size(const void *ptr, unsigned long n, + bool to_user) +{ + __check_object_size(ptr, n, to_user); +} +#else +static inline void check_object_size(const void *ptr, unsigned long n, + bool to_user) +{ } +#endif /* CONFIG_HARDENED_USERCOPY */ + #endif /* __KERNEL__ */ #endif /* _LINUX_THREAD_INFO_H */