what's going on with aa_destroy_aafs() call in apparmor_init()?
Al Viro
viro at zeniv.linux.org.uk
Sun Sep 21 07:36:55 UTC 2025
Correct me if I'm wrong, but as far as I can tell apparmor_init()
ends up being called from security_init(), which is called before the call
of vfs_caches_init(), not to mention fs_initcall stuff.
If that's the case, what is this doing there?
error:
aa_destroy_aafs();
AA_ERROR("Error creating AppArmor securityfs\n");
return error;
aa_create_aafs() is called via fs_initcall; moreover, it will bail out
if called before apparmor_initialized has become true, so...
While we are at it, what will happen if apparmor_init() succeeds, but
aa_create_fs() fails afterwards?
If nothing else, aa_null_path will be left {NULL, NULL}, which will
immediately oops dentry_open() in aa_inherit_files()...
More information about the Linux-security-module-archive
mailing list