apparmor_so...ersec_stream(9)
β¨ apparmor_socket_getpeersec_stream(9) β¨
okay so bestie, welcome to the Kernel API Manual π this one's a whole little function page from the AppArmor fam and it's lowkey adorable. Sit down, grab a strawberry π, let's get into it.
πΈ NAME πΈ
apparmor_socket_getpeersec_stream β literally just "get security context of peer" π«Ά that's the whole vibe. you wanna know who's on the other end of your socket? this is the girl for the job.
π SYNOPSIS π
int apparmor_socket_getpeersec_stream (struct socket *sock , sockptr_t
optval , sockptr_t optlen , unsigned int len );
no cap, that's the signature, character for character, do not touch it π₯
π¦ ARGUMENTS π¦
sockβ the socket we're trying to get the peer context of π like, "who is that girl on the other side"optvalβ output π«Ά this is the buffer you copy the peer name intooptlenβ output π«Ά how big the copied name inoptvalended up beinglenβ the size of theoptvalbuffer, i.e. how much room you actually gave her to work with
β RETURN β
0 on success β¨ and -errno if it fails π (yes, negative errno, that's the kernel's whole thing, we stan).
π NOTE π
for tcp, it's only valid if you're using ipsec or cipso on lan π§ like, that's the vibe check it has to pass. no ipsec, no cipso, no stream peer context, periodt.
π SEE ALSO π
the whole friend group, in order, exactly as listed π:
- Kernel file
./security/apparmor/lsm.c common_perm(9)common_perm_cond(9)common_perm_dir_dentry(9)common_perm_rm(9)common_perm_create(9)apparmor_uring_override_creds(9)apparmor_uring_sqpoll(9)apparmor_bprm_committing_creds(9)apparmor_bprm_committed_creds(9)apparmor_sk_clone_security(9)apparmor_unix_stream_connect(9)apparmor_unix_may_send(9)apparmor_socket_post_create(9)apparmor_socket_bind(9)apparmor_socket_getpeersec_dgram(9)apparmor_sock_graft(9)apparmor_socket_sock_rcv_skb(9)set_init_ctx(9)
and that's the page, bestie π it lives in ./security/apparmor and it's stamped October 2026, and the manual page name is apparmor_so...ersec_stream(9) β yes the truncation is canon, we don't question the icon πΈ mwah, go read some more kernel docs, ily π«Άβ¨
π¦ 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