Skip to content

Commit 561d131

Browse files
hckuogregkh
authored andcommitted
seccomp: Fix setting loaded filter count during TSYNC
commit b4d8a58 upstream. 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 <hsuanchikuo@gmail.com> Link: https://lore.kernel.org/r/20210304233708.420597-1-hsuanchikuo@gmail.com Co-developed-by: Wiktor Garbacz <wiktorg@google.com> Signed-off-by: Wiktor Garbacz <wiktorg@google.com> Link: https://lore.kernel.org/lkml/20210810125158.329849-1-wiktorg@google.com Signed-off-by: Kees Cook <keescook@chromium.org> Cc: stable@vger.kernel.org Fixes: c818c03 ("seccomp: Report number of loaded filters in /proc/$pid/status") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5491698 commit 561d131

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/seccomp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static inline void seccomp_sync_threads(unsigned long flags)
511511
smp_store_release(&thread->seccomp.filter,
512512
caller->seccomp.filter);
513513
atomic_set(&thread->seccomp.filter_count,
514-
atomic_read(&thread->seccomp.filter_count));
514+
atomic_read(&caller->seccomp.filter_count));
515515

516516
/*
517517
* Don't let an unprivileged task work around

0 commit comments

Comments
 (0)