security_task_fix_setgroups(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… security_task_fix_setgroups β€” Kernel API Manual

okay so bestie, welcome to section 9 of the Kernel API Manual β€” the chapter where we talk about security hooks that the kernel calls into the LSMs (Linux Security Modules). This one is a baby hook with a big job, and she is so specific about which credential struct you're allowed to touch. Let's get into it πŸŽ€


✨ NAME ✨

security_task_fix_setgroups β€” Update LSM with new supplementary groups

yes that's literally the whole name. no notes. it's giving "my job is in the title" πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

int security_task_fix_setgroups (struct cred *new, const struct cred *old);

🌸 ARGUMENTS 🌸

  • new β€” updated credentials. this is the glow-up version of the creds, the ones that are about to be installed ✨
  • old β€” credentials being replaced. say bye to her 🫢

πŸ”₯ DESCRIPTION πŸ”₯

So here's the vibe: after the supplementary group identity attributes of the current process get set, the kernel calls this hook to update the module's state. That's the whole assignment. new is the set of credentials that will be installed. πŸ“¦

And now the part where you must listen to me, bestie:

Modifications should be made to new rather than to current->cred. 🚨

Like, do NOT go poking at current->cred, I am begging you 😭. new is the cred struct you're supposed to be editing. current->cred is not it. write that on your hand, put it as your lockscreen, get it tattooed, idc β€” just don't touch current->cred. lowkey the most important sentence on this whole page ngl.


πŸ‘‘ RETURN πŸ‘‘

Returns 0 on success. that's it, that's the return value. slay, no error paths listed here, we love a low-maintenance queen πŸ’–


🌈 SEE ALSO 🌈

This is a big one, bestie β€” sit down, hydrate, grab a snack πŸ“. First up, the kernel file:

./security/security.c

and then every single friend in the LSM extended family (no cap, this is the whole group chat):

like… that's the whole extended family reunion and you're invited πŸ§šπŸ’œ


and that's the page, bestie!! 🫢 you read the whole SEE ALSO list, I'm so proud, that's main character energy fr fr πŸ‘‘

source/version: ./security β€” dated October 2026 β€” and the page is security_task_fix_setgroups(9), as if you'd forget πŸ’– ✨

πŸ“¦ where this page comes from