tee_shm_alloc_kernel_buf(9)
πΈ tee_shm_alloc_kernel_buf (9) β Kernel API Manual πΈ
okay bestie, sit down, we're doing kernel shared memory today and honestly? it's giving iconic. this little function lives in the Kernel API Manual and it's your girl for grabbing shared memory that a specific TEE client driver can actually use. no cap. π
β¨ NAME β¨
tee_shm_alloc_kernel_buf β allocate kernel shared memory for a particular TEE client driver
like, the whole job is in the name, she's very main character about it π
π¦ SYNOPSIS π¦
struct tee_shm * tee_shm_alloc_kernel_buf (struct tee_context *ctx ,
size_t size );
look at her. two args. zero drama. copy it exactly, don't be cute with it π
π ARGUMENTS π
ctxβ the TEE context that's gonna be doing the sharing. it's the whole vibe check for where this shared memory comes from, bestie π«Άsizeβ how big the shared memory allocation is. and (this is the part the docs literally tack onto thesizeline, so we're keeping it, fr fr) it returns a pointer to'struct tee_shm'on success or anERR_PTRon failure. so yes, one of those two things, every single time. if you get anERR_PTRback, don't just go dereferencing it like it's a real pointer β it is not, and it's gonna be a bad time π
heads up queen: the return info is bundled with the size argument up there in the original docs. that's just how it's written. we don't fix it, we just report it. π
π₯ SEE ALSO π₯
a whole friend group, honestly. go say hi π
- Kernel file
./include/linux/tee_drv.h struct tee_context(9)struct tee_shm(9)tee_shm_register_kernel_buf(9)tee_shm_register_fd(9)tee_shm_free(9)tee_shm_get_va(9)tee_shm_get_pa(9)tee_shm_get_size(9)tee_shm_get_pages(9)tee_shm_get_page_offset(9)tee_client_open_context(9)tee_client_close_context(9)tee_client_get_version(9)tee_client_open_session(9)tee_client_close_session(9)tee_client_system_session(9)tee_client_invoke_func(9)tee_client_cancel_req(9)struct tee_client_device(9)struct tee_client_driver(9)
and that's the whole page, gorgeous. you ate. πβ
signed off from ./include/linux with a date of October 2026 β the tee_shm_alloc_kernel_buf(9) girlies stay winning πβ¨
π¦ 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