Lines Matching refs:file
392 static int apparmor_file_open(struct file *file) in apparmor_file_open() argument
394 struct aa_file_ctx *fctx = file_ctx(file); in apparmor_file_open()
398 if (!path_mediated_fs(file->f_path.dentry)) in apparmor_file_open()
411 label = aa_get_newest_cred_label(file->f_cred); in apparmor_file_open()
413 struct inode *inode = file_inode(file); in apparmor_file_open()
416 error = aa_path_perm(OP_OPEN, label, &file->f_path, 0, in apparmor_file_open()
417 aa_map_file_to_perms(file), &cond); in apparmor_file_open()
419 fctx->allow = aa_map_file_to_perms(file); in apparmor_file_open()
426 static int apparmor_file_alloc_security(struct file *file) in apparmor_file_alloc_security() argument
428 struct aa_file_ctx *ctx = file_ctx(file); in apparmor_file_alloc_security()
437 static void apparmor_file_free_security(struct file *file) in apparmor_file_free_security() argument
439 struct aa_file_ctx *ctx = file_ctx(file); in apparmor_file_free_security()
445 static int common_file_perm(const char *op, struct file *file, u32 mask) in common_file_perm() argument
451 if (file->f_path.dentry == aa_null.dentry) in common_file_perm()
455 error = aa_file_perm(op, label, file, mask); in common_file_perm()
461 static int apparmor_file_receive(struct file *file) in apparmor_file_receive() argument
463 return common_file_perm(OP_FRECEIVE, file, aa_map_file_to_perms(file)); in apparmor_file_receive()
466 static int apparmor_file_permission(struct file *file, int mask) in apparmor_file_permission() argument
468 return common_file_perm(OP_FPERM, file, mask); in apparmor_file_permission()
471 static int apparmor_file_lock(struct file *file, unsigned int cmd) in apparmor_file_lock() argument
478 return common_file_perm(OP_FLOCK, file, mask); in apparmor_file_lock()
481 static int common_mmap(const char *op, struct file *file, unsigned long prot, in common_mmap() argument
486 if (!file || !file_ctx(file)) in common_mmap()
500 return common_file_perm(op, file, mask); in common_mmap()
503 static int apparmor_mmap_file(struct file *file, unsigned long reqprot, in apparmor_mmap_file() argument
506 return common_mmap(OP_FMMAP, file, prot, flags); in apparmor_mmap_file()