instrument_copy_to_user(9)
π instrument_copy_to_user(9) π
okay so this is a page from the Kernel API Manual, and bestie, we're about to get into it β it's giving "low-level kernel instrumentation" and honestly? iconic.
β¨ NAME β¨
instrument_copy_to_user β literally the thing that instruments the reads that happen because of copy_to_user π«Ά
πΈ SYNOPSIS πΈ
void instrument_copy_to_user (void __user *to , const void *from ,
unsigned long n );
π ARGUMENTS π
toβ the destination address, like where the stuff is headed πfromβ the source address, aka where it's coming from π¦nβ the number of bytes to copy, yes we're counting π
π DESCRIPTION π
So what this does is it instruments reads from kernel memory β and those reads are happening because of copy_to_user (and its variants, you know the fam π).
β οΈ important vibe check: the instrumentation has to be inserted before the accesses. Not after. Before. no cap, this is not a drill π
π₯ SEE ALSO π₯
Kernel file ./include/linux/instrumented.h β and like, the whole friend group:
instrument_read(9)instrument_write(9)instrument_read_write(9)instrument_atomic_read(9)instrument_atomic_write(9)instrument_atomic_read_write(9)instrument_copy_from_user_before(9)instrument_copy_from_user_after(9)instrument_memcpy_before(9)instrument_memcpy_after(9)instrument_get_user(9)instrument_put_user(9)
mwah π that's the whole page β brought to you from ./include/linux, dated October 2026, in the Kernel API Manual. slay, go instrument responsibly β¨π
π¦ 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