ipcctl_obtain_check(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ipcctl_obtain_check β€” the manual page, but make it make sense

okay so bestie, welcome to ipcctl_obtain_check(9) from the Kernel API Manual ✨ this one's a little kernel-side helper that goes and fetches an ipc object for you and does the vibe check (permissions, audit, the whole thing) before letting you near it πŸŽ€


✨ NAME ✨

ipcctl_obtain_check β€” retrieve an ipc object and check permissions 🫢 like, grab the thing, then make sure you're actually allowed to touch it, no cap.


🌸 SYNOPSIS 🌸

struct kern_ipc_perm * ipcctl_obtain_check (struct ipc_namespace *ns ,
struct ipc_ids *ids , int id , int cmd , struct ipc64_perm *perm , int
extra_perm );

literally that's the whole signature, copy it exactly, don't be weird about it πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ns β€” the ipc namespace 🌈 that's the world we're digging around in.
  • ids β€” the table of ids where to look for the ipc πŸ‘‘ this is the little index we're searching through.
  • id β€” the id of the ipc to retrieve πŸŽ€ the specific one you want, bestie.
  • cmd β€” the cmd to check ⭐ which command we're validating against, iykyk.
  • perm β€” the permission to set πŸ”₯ the perms being handed over.
  • extra_perm β€” one extra permission parameter used by msq πŸ’– yes it's just the one extra one, and yes it's msq's little thing.

πŸ’œ DESCRIPTION πŸ’œ

So this function does some common audit and permissions check for some IPC_XXX cmd, and it gets called from semctl_down, shmctl_down and msgctl_down 🌸 like, those three are the ones sliding into its DMs.

Here's the rundown, bestie:

  • it retrieves the ipc object with the given id in the given table πŸ‘€
  • then it performs some audit and permission check, depending on the given cmd 🧚 the vibe check is literally cmd-dependent, periodt.
  • and then it returns a pointer to the ipc object, or otherwise, the corresponding error 😭 so either you get your object or you get told no.
⚠️ important one: call holding both the rwsem and the rcu read lock πŸ’€ not one, not the other β€” both. Don't show up unlocked, bestie, that's not the move.

🌟 SEE ALSO 🌟

Kernel file ./ipc/util.c β€” and honestly the whole friend group shows up here 🫢:

ipc_init(9), ipc_init_ids(9), ipc_init_proc_interface(9), ipc_findkey(9), ipc_addid(9), ipcget_new(9), ipc_check_perms(9), ipcget_public(9), ipc_kht_remove(9), ipc_search_maxidx(9), ipc_rmid(9), ipc_set_key_private(9), ipcperms(9), kernel_to_ipc64_perm(9), ipc64_perm_to_ipc_perm(9), ipc_obtain_object_idr(9), ipc_obtain_object_check(9), ipcget(9), ipc_update_perm(9), ipc_parse_version(9), sysvipc_find_ipc(9)


and that's the page, bestie πŸŽ€ this one came out of ./ipc and it's dated October 2026, filed under ipcctl_obtain_check(9) β€” go forth and hold your locks πŸ’…βœ¨

πŸ“¦ where this page comes from