History

seccomp: Report number of loaded filters in /proc/$pid/status

A common question asked when debugging seccomp filters is "how many filters are attached to your process?" Provide a way to easily answer this question through /proc/$pid/status with a "Seccomp_filters" line.

Kees Cook committed 6 years ago

Commit c818c031 parent e4d05024 files · +10 −0Browse files

Showing the changes to include/linux (1 of 4 files). Show all

Unified · Split

include/linux/seccomp.h+2−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #ifdef CONFIG_SECCOMP
1414
1515 #include <linux/thread_info.h>
16+#include <linux/atomic.h>
1617 #include <asm/seccomp.h>
1718
1819 struct seccomp_filter;
@@ -29,6 +30,7 @@ struct seccomp_filter; · 10 unmodified lines
2930 */
3031 struct seccomp {
3132 int mode;
33+ atomic_t filter_count;
3234 struct seccomp_filter *filter;
3335 };
3436