seccomp: Fix setting number of loaded filters
PATCH 1/1 seccomp: Fix setting number of loaded filters
The value is only reported through procfs so this
is purely cosmetic.
--- kernel/seccomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/seccomp.c +1 -1
@@ -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
Signature · 1 line
2.32.0.605.g8dce9f2422-goog
Quoted 2 lines · Wiktor Garbacz
The value is only reported through procfs so this
is purely cosmetic.
Hi,
Thanks for the patch! I thought this had already been fixed, but I see I dropped the ball. :( Sorry!
I'll get the original fix landed[1], and add you as a reporter.
Out of curiosity, how did you (or Hsuan-Chi Kuo) find this? Broken behavior, code reading, static analysis?
Thanks!
-Kees
[1] https://lore.kernel.org/lkml/[email protected]/
Quoted 22 lines
Signed-off-by Wiktor Garbacz <[email protected]>--- kernel/seccomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/seccomp.c +1
-1@@ -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 Signature · 1 line
2.32.0.605.g8dce9f2422-goog
Signature · 1 line
Kees Cook
Thanks.
I was just trying to understand how seccomp works by code reading and spotted this bug.
Quoted 40 lines · Kees Cook
Quoted 2 lines · Wiktor Garbacz
The value is only reported through procfs so this
is purely cosmetic.Hi,
Thanks for the patch! I thought this had already been fixed, but I see I dropped the ball. :( Sorry!
I'll get the original fix landed[1], and add you as a reporter.
Out of curiosity, how did you (or Hsuan-Chi Kuo) find this? Broken behavior, code reading, static analysis?
Thanks!
-Kees
[1] https://lore.kernel.org/lkml/[email protected]/
Quoted 21 lines
Signed-off-by Wiktor Garbacz <[email protected]>--- kernel/seccomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/seccomp.c +1
-1@@ -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 Signature · 1 line
2.32.0.605.g8dce9f2422-goog