match_mnt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… match_mnt(9) β€” like, the mount path matcher, bestie

okay so this is a page from the Kernel API Manual, and honestly? it's a whole vibe. it's giving "low-level AppArmor mount checking" and if you're here you probably already know what you're doing, but let's walk it together anyway 🫢


✨ NAME ✨

match_mnt β€” handle path matching for mount πŸ’«

like, literally the function that deals with path matching when something's getting mounted. that's the whole job. iconic.


🌸 SYNOPSIS 🌸

int match_mnt (struct aa_profile *profile , const struct path *path ,
char *buffer , const struct path *devpath , char *devbuffer , const char
*type , unsigned long flags , void *data , bool binary , struct
apparmor_audit_data *ad );

ten (10) arguments bestie. TEN. she's high-maintenance and we respect it πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

okay so here's who's who in the group chat:

  • profile β€” the confining profile. she's the one in charge, the main character of the whole operation ✨
  • path β€” the path for the mntpnt. and listen: NOT NULL. don't even think about it πŸ™…β€β™€οΈ
  • buffer β€” buffer to be used to lookup mntpath. that's her job, that's her moment πŸ’…
  • devpath β€” path devname/src_name. MAYBE NULL, so she's flexible, she might show up, she might not 😌
  • devbuffer β€” buffer to be used to lookup devname/src_name. baby buffer for the dev name lookup 🍼
  • type β€” string for the dev type. MAYBE NULL β€” again, optional queen 🌈
  • flags β€” mount flags to match. gotta match 'em, no cap 🚩
  • data β€” fs mount data. MAYBE NULL β€” third optional icon in this cast πŸ’œ
  • binary β€” whether data is binary. yes/no moment, simple as that ⭐
  • ad β€” apparmor audit data structure. the receipts, the paper trail, the audit tea β˜•
fr fr, notice which ones say NOT NULL vs MAYBE NULL β€” that distinction is literally the whole point. path is mandatory, devpath, type and data are the chill optional ones πŸ™ˆ

πŸ”₯ RETURN πŸ”₯

0 on success, else error. that's it. that's the whole deal. zero means slay, anything else means something went sideways πŸ’€


πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, iykyk:


okay that's the page!! this one lives under ./security/apparmor, dated October 2026, and she ate, no crumbs πŸ“ mwah πŸ’–

πŸ“¦ where this page comes from