Skip to content

Commit b4d8a58

Browse files
hckuokees
authored andcommitted
seccomp: Fix setting loaded filter count during TSYNC
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")
1 parent 19d6769 commit b4d8a58

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
@@ -602,7 +602,7 @@ static inline void seccomp_sync_threads(unsigned long flags)
602602
smp_store_release(&thread->seccomp.filter,
603603
caller->seccomp.filter);
604604
atomic_set(&thread->seccomp.filter_count,
605-
atomic_read(&thread->seccomp.filter_count));
605+
atomic_read(&caller->seccomp.filter_count));
606606

607607
/*
608608
* Don't let an unprivileged task work around

0 commit comments

Comments
 (0)