Skip to contentSkip to conversation

seccomp: Fix resetting filter count at seccomp_sync_threads()

PATCH Applied Hsuan-Chi Kuo 2 participants 2 messages Mar 4, 2021 – Aug 11, 2021 Secure computing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 seccomp: Fix resetting filter count at seccomp_sync_threads()

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

---
 kernel/seccomp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/seccomp.c +1 -1
index 1d60fc2c99..3dde1aa173 100644
@@ -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
Signature · 1 line
2.30.1
Applied
#1 lore raw
Quoted 1 line · Hsuan-Chi Kuo

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

Applied to for-next/seccomp, thanks!

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

      https://git.kernel.org/kees/c/b4d8a58f8dcf
Signature · 1 line
Kees Cook