kernel: switch to syscall_work if CONFIG_GENERIC_ENTRY is enabled (#12)
From Kernel 5.11 it migrate to syscall_work instead of tif_*, so check for CONFIG_GENERIC_ENTRY and use syscall_work instead of TIF_SECCOMP https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2382193.html
This commit is contained in:
@@ -57,7 +57,11 @@ void escape_to_root() {
|
||||
memset(&cred->cap_ambient, 0xff, sizeof(cred->cap_ambient));
|
||||
|
||||
// disable seccomp
|
||||
#ifdef CONFIG_GENERIC_ENTRY
|
||||
current_thread_info()->syscall_work &= ~SYSCALL_WORK_SECCOMP;
|
||||
#else
|
||||
current_thread_info()->flags &= ~TIF_SECCOMP;
|
||||
#endif
|
||||
current->seccomp.mode = 0;
|
||||
current->seccomp.filter = NULL;
|
||||
|
||||
@@ -270,4 +274,4 @@ module_exit(kernelsu_exit);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("weishu");
|
||||
MODULE_DESCRIPTION("Android GKI KernelSU");
|
||||
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver); // 5+才需要导出命名空间
|
||||
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver); // 5+才需要导出命名空间
|
||||
|
||||
Reference in New Issue
Block a user