xt_copy_counters(9)
π xt_copy_counters(9) π
Kernel API Manual β bestie, we're copying counters and metadata from a sockptr_t, and yes, it's giving kernel-core π
β¨ NAME β¨
xt_copy_counters β copy counters and metadata from a sockptr_t π
π¦ SYNOPSIS π¦
void * xt_copy_counters (sockptr_t arg , unsigned int len , struct
xt_counters_info *info );
π ARGUMENTS π
argβ the srcsockptrπ«Άlenβ the alleged size of userspace memory π (yes, βallegedβ is doing a lot of work here)infoβ where to store thext_counters_infometadata π
π DESCRIPTION π
Okay so first things first: it copies counter meta data from user and stores it in info π₯.
Then it vmallocs memory to hold the counters π§ , copies the counter data from user into that new memory, and returns a pointer to it π₯.
If called from a compat syscall, info gets converted automatically to the 64bit representation β¨.
The metadata associated with the counters is stored in info π.
π RETURN π
It returns a pointer that the caller has to test via IS_ERR π. If IS_ERR is false, the caller has to vfree the pointer β periodt ππ«Ά
π§ SEE ALSO π§
Kernel file: ./net/netfilter/x_tables.c π
xt_check_proc_name(9)xt_check_entry_offsets(9)xt_alloc_entry_offsets(9)xt_find_jump_offset(9)xt_unregister_table_pre_exit(9)xt_unregister_table_exit(9)xt_hook_ops_alloc(9)xt_percpu_counter_alloc(9)
That's the whole vibe check, bestie π«Ά β source/version: ./net/netfilter, dated October 2026 πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms