---------- Forwarded message ---------
From: Al Viro <[email protected]>
Date: Sun, Sep 21, 2025 at 12:37 AM
Subject: what's going on with aa_destroy_aafs() call in apparmor_init()?
To: John Johansen <[email protected]>
Cc: <[email protected]>, <[email protected]>


        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()...

Reply via email to