Lines Matching refs:file
303 init_debug("file blob size = %d\n", blob_sizes.lbs_file);
521 * lsm_file_alloc - allocate a composite file blob
522 * @file: the file that needs a blob
524 * Allocate the file blob for all the modules
528 static int lsm_file_alloc(struct file *file)
531 file->f_security = NULL;
535 file->f_security = kmem_cache_zalloc(lsm_file_cache, GFP_KERNEL);
536 if (file->f_security == NULL)
691 struct task_struct *to, struct file *file)
693 return call_int_hook(binder_transfer_file, 0, from, to, file);
1372 int security_file_permission(struct file *file, int mask)
1376 ret = call_int_hook(file_permission, 0, file, mask);
1380 return fsnotify_perm(file, mask);
1383 int security_file_alloc(struct file *file)
1385 int rc = lsm_file_alloc(file);
1389 rc = call_int_hook(file_alloc_security, 0, file);
1391 security_file_free(file);
1395 void security_file_free(struct file *file)
1399 call_void_hook(file_free_security, file);
1401 blob = file->f_security;
1403 file->f_security = NULL;
1408 int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1410 return call_int_hook(file_ioctl, 0, file, cmd, arg);
1413 static inline unsigned long mmap_prot(struct file *file, unsigned long prot)
1426 if (!file)
1432 if (!path_noexec(&file->f_path)) {
1434 if (file->f_op->mmap_capabilities) {
1435 unsigned caps = file->f_op->mmap_capabilities(file);
1446 int security_mmap_file(struct file *file, unsigned long prot,
1450 ret = call_int_hook(mmap_file, 0, file, prot,
1451 mmap_prot(file, prot), flags);
1454 return ima_file_mmap(file, prot);
1468 int security_file_lock(struct file *file, unsigned int cmd)
1470 return call_int_hook(file_lock, 0, file, cmd);
1473 int security_file_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
1475 return call_int_hook(file_fcntl, 0, file, cmd, arg);
1478 void security_file_set_fowner(struct file *file)
1480 call_void_hook(file_set_fowner, file);
1489 int security_file_receive(struct file *file)
1491 return call_int_hook(file_receive, 0, file);
1494 int security_file_open(struct file *file)
1498 ret = call_int_hook(file_open, 0, file);
1502 return fsnotify_perm(file, MAY_OPEN);
1598 int security_kernel_read_file(struct file *file, enum kernel_read_file_id id)
1602 ret = call_int_hook(kernel_read_file, 0, file, id);
1605 return ima_read_file(file, id);
1609 int security_kernel_post_read_file(struct file *file, char *buf, loff_t size,
1614 ret = call_int_hook(kernel_post_read_file, 0, file, buf, size, id);
1617 return ima_post_read_file(file, buf, size, id);