bpf_ksock_acquire(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– bpf_ksock_acquire(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this page is about bpf_ksock_acquire, and yes it's giving "tiny function, big responsibilities" energy. let's get into it 🫢


✨ NAME ✨

bpf_ksock_acquire β€” grab yourself a reference to a BPF kernel socket. literally just a refcount glow-up πŸ’…


🌸 SYNOPSIS 🌸

__bpf_kfunc struct bpf_ksock * bpf_ksock_acquire (struct bpf_ksock *ks );

no cap, that's the whole signature. short and iconic πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • ks β€” the BPF kernel socket context you're acquiring. bestie listen: this must be a trusted pointer β€” think an RCU-protected kptr from a map. not just any random pointer you found lying around, okay? πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

so you called it, you got your reference... now what? the acquired context has exactly two acceptable fates, and you gotta pick one:

  • store it in a map as a kptr, or
  • free it with bpf_ksock_release

that's it. that's the whole vibe check. don't just let it float around unsupervised, because that's not the move 😭


⭐ SEE ALSO ⭐


alright that's the page!! this one came from ./net/core, dated October 2026, and the manpage itself is bpf_ksock_acquire(9) β€” go acquire some references responsibly, love u, bye πŸ§šπŸ’œ

πŸ“¦ where this page comes from