kcsan_begin_scoped_access(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kcsan_begin_scoped_access(9) β€” the Kernel API Manual glow-up

okay so bestie, we're in the Kernel API Manual today and the main character is kcsan_begin_scoped_access. yes, that's a whole mouthful, we love her anyway 🫢


✨ NAME ✨

kcsan_begin_scoped_access β€” literally the "begin scoped access" girlie ✨


πŸŽ€ SYNOPSIS πŸŽ€

struct kcsan_scoped_access * kcsan_begin_scoped_access (const volatile
void *ptr , size_t size , int type , struct kcsan_scoped_access *sa );

like, copy it exactly, no cap πŸ’…


🌸 ARGUMENTS 🌸

  • ptr β€” the address of the access. that's the spot you're looking at πŸ‘€
  • size β€” the size of the access. how many bytes we're talking about πŸ“
  • type β€” the access type modifier. the vibe check on what kind of access this is
  • sa β€” the struct kcsan_scoped_access you're gonna use for the scope of the access. she's the one holding it down for the whole duration 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so what this does is: begin a scoped access, and initialize sa. and because of that, KCSAN will continuously check the memory range in the current thread until kcsan_end_scoped_access is called for sa. like it just keeps watching, every single time, until you tell it to stop 😭

and how does that actually work? scoped accesses are implemented by appending sa to an internal list for the current execution context β€” that's the little home she lives in β€” and then she gets checked on every call into the KCSAN runtime. every. single. one. iconic behavior, honestly πŸ‘‘


🌈 SEE ALSO 🌈

everything's hanging out in the kernel file ./include/linux/kcsan-checks.h β€” go say hi to the whole friend group:


kcsan to you too, bestie πŸ’–

and that's the whole page!! mwah πŸŽ€ sign-off time: this one lives in ./include/linux, dated October 2026, and it's the kcsan_begin_scoped_access(9) girlie herself. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from