match_mnt(9)
π 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β whetherdatais 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.pathis mandatory,devpath,typeanddataare 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:
- Kernel file
./security/apparmor/mount.c audit_cb(9)match_mnt_flags(9)match_mnt_path_str(9)
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
- 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