[PATCH] seccomp: Fix resetting filter count at seccomp_sync_threads()

From: Hsuan-Chi Kuo
Date: Thu Mar 04 2021 - 18:35:19 EST


The desired behavior is to set the caller's filter count to thread's.

Signed-off-by: Hsuan-Chi Kuo <hsuanchikuo@xxxxxxxxx>
---
kernel/seccomp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 1d60fc2c99..3dde1aa173 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -597,7 +597,7 @@ static inline void seccomp_sync_threads(unsigned long flags)
smp_store_release(&thread->seccomp.filter,
caller->seccomp.filter);
atomic_set(&thread->seccomp.filter_count,
- atomic_read(&thread->seccomp.filter_count));
+ atomic_read(&caller->seccomp.filter_count));

/*
* Don't let an unprivileged task work around
--
2.30.1