security: Introduce file_post_open hook
[linux-2.6-microblaze.git] / fs / namei.c
index 4e0de93..ef867f1 100644 (file)
@@ -3639,6 +3639,8 @@ static int do_open(struct nameidata *nd,
        error = may_open(idmap, &nd->path, acc_mode, open_flag);
        if (!error && !(file->f_mode & FMODE_OPENED))
                error = vfs_open(&nd->path, file);
+       if (!error)
+               error = security_file_post_open(file, op->acc_mode);
        if (!error)
                error = ima_file_check(file, op->acc_mode);
        if (!error && do_truncate)