match_exception_partial(9)
πΈ match_exception_partial πΈ
okay so this is a page from the Kernel API Manual, bestie β like, the kernel's own little handbook of functions β and today's main character is match_exception_partial. she's a lil boolean-returning function and she has ONE job. let's get into it π
β¨ NAME β¨
match_exception_partial β she iterates the exception list trying to find a partial match. that's it, that's the whole gig π
β¨ SYNOPSIS β¨
bool match_exception_partial (struct list_head *exceptions , short type , u32 major , u32 minor , short access );
β¨ ARGUMENTS β¨
exceptionsβ the list of exceptions. literally just the list, she's gonna walk it πΆββοΈtypeβ device type. it's eitherDEVCG_DEV_BLOCKorDEVCG_DEV_CHAR, pick your fighter π₯majorβ device file major number. pass~0if you want it to match all of them, no cap πminorβ device file minor number. same deal,~0matches all of them β¨accessβ the permission mask, and it's one ofDEVCG_ACC_READ,DEVCG_ACC_WRITE, orDEVCG_ACC_MKNOD. choose wisely bb π
β¨ DESCRIPTION β¨
so the way this works is β it counts as a partial match if an exception's range is found to contain any of the devices specified by the parameters you passed in. note the emphasis on any bestie, the original really put asterisks around it, that's how you know it matters π
and why do we even care? because this is used to make sure no extra access is being granted that's forbidden by any of the exception list. like, she's the vibe check for permissions β no sneaky extra access getting through on her watch πβ¨
β¨ RETURN β¨
returns true in case the provided range mat matches an exception completely π«Ά
(and yes, the source page literally says "mat" β we're not fixing her, she's iconic and we respect her typos π)
β¨ SEE ALSO β¨
kernel file ./security/device_cgroup.c, plus the whole friend group:
dev_exception_clean(9)devcgroup_online(9)match_exception(9)verify_new_ex(9)parent_allows_removal(9)may_allow_all(9)revalidate_active_exceptions(9)propagate_exception(9)devcgroup_legacy_check_permission(9)
okay that's the whole lore π¦ and a lil sign-off for the record books: this one lives under ./security, and the page is dated October 2026 β so yeah, she's from the future, main character energy fr fr βπ
go read the other pages, ily, bye ππ
π¦ 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