match_exception(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– match_exception(9) πŸ’–

okay so welcome to the match_exception(9) page, bestie β€” this is a Kernel API Manual situation, and we're about to get into it. no cap, this one's a little function with a big job: it goes shopping through the exception list looking for a complete match. slay.


✨ NAME ✨

match_exception β€” iterates the exception list trying to find a complete match

like, it literally walks the list. that's the whole vibe. πŸšΆβ€β™€οΈπŸ’…


🌸 SYNOPSIS 🌸

bool match_exception (struct list_head *exceptions , short type , u32
major , u32 minor , short access );

πŸŽ€ ARGUMENTS πŸŽ€

  • exceptions β€” the list of exceptions. the lineup. the guest list. πŸ’Œ
  • type β€” device type, and it's one of DEVCG_DEV_BLOCK or DEVCG_DEV_CHAR.
  • major β€” device file major number. and here's the cute part: ~0 matches all of them. yes, all. 🫢
  • minor β€” device file minor number, same deal, ~0 matches all.
  • access β€” the permission mask. pick your fighters: DEVCG_ACC_READ, DEVCG_ACC_WRITE, DEVCG_ACC_MKNOD. πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

so the rule is literally this: it counts as a complete match if an exception is found that will contain the entire range of the provided parameters. that's it. that's the whole criteria. if an exception only covers part of what you asked for? not a complete match, bestie, sorry. 😭

think of it as an exception that has to be big enough to hold everything you brought. no partial credit energy here β€” the word "complete" is doing heavy lifting and she's earned it. ✨


πŸ”₯ RETURN πŸ”₯

true in case it matches an exception completely. iconic. otherwise bestie you already know.


🌈 SEE ALSO 🌈

the kernel file lives at ./security/device_cgroup.c, and here's the whole friend group, fr fr:

πŸ’€ note the difference between this one and match_exception_partial(9) β€” one of them wants the whole range, and it is not the partial one. iykyk.

and that's the page! πŸŽ€ mwah πŸ’‹ β€” sourced from ./security, dated October 2026, and this has been match_exception(9), signing off like the main character she is. πŸ‘‘πŸ“

πŸ“¦ where this page comes from