#ifndef __KSU_H_KERNEL_COMPAT #define __KSU_H_KERNEL_COMPAT #include #include /* * ksu_copy_from_user_retry * try nofault copy first, if it fails, try with plain * paramters are the same as copy_from_user * 0 = success */ static long ksu_copy_from_user_retry(void *to, const void __user *from, unsigned long count) { long ret = copy_from_user_nofault(to, from, count); if (likely(!ret)) return ret; // we faulted! fallback to slow path return copy_from_user(to, from, count); } #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 2) // Android backport this feature in 5.10.2 extern void ksu_seccomp_clear_cache(struct seccomp_filter *filter, int nr); extern void ksu_seccomp_allow_cache(struct seccomp_filter *filter, int nr); #endif #endif