]> Git Repo - linux.git/commitdiff
seccomp: Fix setting loaded filter count during TSYNC
authorHsuan-Chi Kuo <[email protected]>
Thu, 4 Mar 2021 23:37:08 +0000 (17:37 -0600)
committerKees Cook <[email protected]>
Wed, 11 Aug 2021 18:48:28 +0000 (11:48 -0700)
The desired behavior is to set the caller's filter count to thread's.
This value is reported via /proc, so this fixes the inaccurate count
exposed to userspace; it is not used for reference counting, etc.

Signed-off-by: Hsuan-Chi Kuo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Wiktor Garbacz <[email protected]>
Signed-off-by: Wiktor Garbacz <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]
Signed-off-by: Kees Cook <[email protected]>
Cc: [email protected]
Fixes: c818c03b661c ("seccomp: Report number of loaded filters in /proc/$pid/status")
kernel/seccomp.c

index 057e17f3215d5633fc18df103fae36702a63bba4..6469eca8078ca01eb3e0407d741964a25e88d2d1 100644 (file)
@@ -602,7 +602,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
This page took 0.051905 seconds and 4 git commands to generate.