Please check before submitting an issue
Describe the bug
KernelSU will turn off seccomp filters when escalating privilege,
static void disable_seccomp()
{
assert_spin_locked(¤t->sighand->siglock);
// disable seccomp
#if defined(CONFIG_GENERIC_ENTRY) && \
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
current_thread_info()->syscall_work &= ~SYSCALL_WORK_SECCOMP;
#else
current_thread_info()->flags &= ~(TIF_SECCOMP | _TIF_SECCOMP);
#endif
#ifdef CONFIG_SECCOMP
current->seccomp.mode = 0;
current->seccomp.filter = NULL;
#else
#endif
}
However, it seems that it doesn't release seccomp filters correctly, and might lead to memory leak.
To Reproduce
- run
cat /proc/self/status and refer to seccomp section (NoNewPrivs:0, Seccomp:2, Seccomp_filters:1)
- run
sudo cat /proc/self/status and refer to seccomp section (NoNewPrivs:0, Seccomp:0, Seccomp_filters:1)
Expected behavior
Clear seccomp filter bpf reference when disabling it, that is, display NoNewPrivs: 0, Seccomp: 0, Seccomp_filters: 0 in /proc/$PROC/status
Screenshots
No response
Logs
No response
Device info
- Device: Mi 13
- OS Version: MIUI 14.0.31
- KernelSU Version: v1.0.5
- Kernel Version: 5.15.167
Additional context
No response
Please check before submitting an issue
Describe the bug
KernelSU will turn off seccomp filters when escalating privilege,
However, it seems that it doesn't release seccomp filters correctly, and might lead to memory leak.
To Reproduce
cat /proc/self/statusand refer to seccomp section (NoNewPrivs:0, Seccomp:2, Seccomp_filters:1)sudo cat /proc/self/statusand refer to seccomp section (NoNewPrivs:0, Seccomp:0, Seccomp_filters:1)Expected behavior
Clear seccomp filter bpf reference when disabling it, that is, display NoNewPrivs: 0, Seccomp: 0, Seccomp_filters: 0 in
/proc/$PROC/statusScreenshots
No response
Logs
No response
Device info
Additional context
No response