Home
last modified time | relevance | path

Searched refs:file (Results 1 – 25 of 36) sorted by relevance

12

/security/integrity/ima/
Dima_main.c57 static void ima_rdwr_violation_check(struct file *file) in ima_rdwr_violation_check() argument
59 struct dentry *dentry = file->f_path.dentry; in ima_rdwr_violation_check()
61 fmode_t mode = file->f_mode; in ima_rdwr_violation_check()
90 pathname = ima_d_path(&file->f_path, &pathbuf); in ima_rdwr_violation_check()
104 struct inode *inode, struct file *file) in ima_check_last_writer() argument
106 fmode_t mode = file->f_mode; in ima_check_last_writer()
116 ima_update_xattr(iint, file); in ima_check_last_writer()
127 void ima_file_free(struct file *file) in ima_file_free() argument
129 struct inode *inode = file_inode(file); in ima_file_free()
139 ima_check_last_writer(iint, inode, file); in ima_file_free()
[all …]
Dima.h87 int ima_calc_file_hash(struct file *file, char *digest);
115 struct file *file);
116 void ima_store_measurement(struct integrity_iint_cache *iint, struct file *file,
148 struct file *file, const unsigned char *filename);
150 void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file);
157 struct file *file, in ima_appraise_measurement() argument
170 struct file *file) in ima_update_xattr() argument
Dima_api.c141 struct file *file) in ima_collect_measurement() argument
143 struct inode *inode = file_inode(file); in ima_collect_measurement()
144 const char *filename = file->f_dentry->d_name.name; in ima_collect_measurement()
148 u64 i_version = file_inode(file)->i_version; in ima_collect_measurement()
151 result = ima_calc_file_hash(file, iint->ima_xattr.digest); in ima_collect_measurement()
180 struct file *file, const unsigned char *filename) in ima_store_measurement() argument
185 struct inode *inode = file_inode(file); in ima_store_measurement()
202 file->f_dentry->d_name.name : filename); in ima_store_measurement()
Dima_fs.c40 static ssize_t ima_show_htable_violations(struct file *filp, in ima_show_htable_violations()
52 static ssize_t ima_show_measurements_count(struct file *filp, in ima_show_measurements_count()
159 static int ima_measurements_open(struct inode *inode, struct file *file) in ima_measurements_open() argument
161 return seq_open(file, &ima_measurments_seqops); in ima_measurements_open()
234 static int ima_ascii_measurements_open(struct inode *inode, struct file *file) in ima_ascii_measurements_open() argument
236 return seq_open(file, &ima_ascii_measurements_seqops); in ima_ascii_measurements_open()
246 static ssize_t ima_write_policy(struct file *file, const char __user *buf, in ima_write_policy() argument
290 static int ima_open_policy(struct inode * inode, struct file * filp) in ima_open_policy()
307 static int ima_release_policy(struct inode *inode, struct file *file) in ima_release_policy() argument
Dima_crypto.c43 int ima_calc_file_hash(struct file *file, char *digest) in ima_calc_file_hash() argument
65 if (!(file->f_mode & FMODE_READ)) { in ima_calc_file_hash()
66 file->f_mode |= FMODE_READ; in ima_calc_file_hash()
69 i_size = i_size_read(file_inode(file)); in ima_calc_file_hash()
73 rbuf_len = kernel_read(file, offset, rbuf, PAGE_SIZE); in ima_calc_file_hash()
90 file->f_mode &= ~FMODE_READ; in ima_calc_file_hash()
Dima_appraise.c119 struct file *file, const unsigned char *filename) in ima_appraise_measurement() argument
121 struct dentry *dentry = file->f_dentry; in ima_appraise_measurement()
213 void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file) in ima_update_xattr() argument
215 struct dentry *dentry = file->f_dentry; in ima_update_xattr()
222 rc = ima_collect_measurement(iint, file); in ima_update_xattr()
/security/tomoyo/
Dsecurityfs_if.c39 static ssize_t tomoyo_write_self(struct file *file, const char __user *buf, in tomoyo_write_self() argument
105 static ssize_t tomoyo_read_self(struct file *file, char __user *buf, in tomoyo_read_self() argument
136 static int tomoyo_open(struct inode *inode, struct file *file) in tomoyo_open() argument
138 const int key = ((u8 *) file_inode(file)->i_private) in tomoyo_open()
140 return tomoyo_open_control(key, file); in tomoyo_open()
149 static int tomoyo_release(struct inode *inode, struct file *file) in tomoyo_release() argument
151 tomoyo_close_control(file->private_data); in tomoyo_release()
164 static unsigned int tomoyo_poll(struct file *file, poll_table *wait) in tomoyo_poll() argument
166 return tomoyo_poll_control(file, wait); in tomoyo_poll()
179 static ssize_t tomoyo_read(struct file *file, char __user *buf, size_t count, in tomoyo_read() argument
[all …]
Dtomoyo.c135 return tomoyo_check_open_permission(domain, &bprm->file->f_path, in tomoyo_bprm_check_security()
312 static int tomoyo_file_fcntl(struct file *file, unsigned int cmd, in tomoyo_file_fcntl() argument
315 if (!(cmd == F_SETFL && ((arg ^ file->f_flags) & O_APPEND))) in tomoyo_file_fcntl()
317 return tomoyo_check_open_permission(tomoyo_domain(), &file->f_path, in tomoyo_file_fcntl()
329 static int tomoyo_file_open(struct file *f, const struct cred *cred) in tomoyo_file_open()
347 static int tomoyo_file_ioctl(struct file *file, unsigned int cmd, in tomoyo_file_ioctl() argument
350 return tomoyo_path_number_perm(TOMOYO_TYPE_IOCTL, &file->f_path, cmd); in tomoyo_file_ioctl()
Daudit.c259 struct file *file = r->ee->bprm->file; in tomoyo_init_log() local
260 realpath = tomoyo_realpath_from_path(&file->f_path); in tomoyo_init_log()
462 unsigned int tomoyo_poll_log(struct file *file, poll_table *wait) in tomoyo_poll_log() argument
466 poll_wait(file, &tomoyo_log_wait, wait); in tomoyo_poll_log()
Dcondition.c225 static bool tomoyo_scan_exec_realpath(struct file *file, in tomoyo_scan_exec_realpath() argument
231 if (!file) in tomoyo_scan_exec_realpath()
233 exe.name = tomoyo_realpath_from_path(&file->f_path); in tomoyo_scan_exec_realpath()
792 struct file *file; in tomoyo_condition() local
802 file = ee ? ee->bprm->file : NULL; in tomoyo_condition()
803 if (!tomoyo_scan_exec_realpath(file, ptr, in tomoyo_condition()
/security/smack/
Dsmackfs.c443 static ssize_t smk_write_rules_list(struct file *file, const char __user *buf, in smk_write_rules_list() argument
645 static int smk_open_load(struct inode *inode, struct file *file) in smk_open_load() argument
647 return seq_open(file, &load_seq_ops); in smk_open_load()
658 static ssize_t smk_write_load(struct file *file, const char __user *buf, in smk_write_load() argument
669 return smk_write_rules_list(file, buf, count, ppos, NULL, NULL, in smk_write_load()
816 static int smk_open_cipso(struct inode *inode, struct file *file) in smk_open_cipso() argument
818 return seq_open(file, &cipso_seq_ops); in smk_open_cipso()
832 static ssize_t smk_set_cipso(struct file *file, const char __user *buf, in smk_set_cipso() argument
935 static ssize_t smk_write_cipso(struct file *file, const char __user *buf, in smk_write_cipso() argument
938 return smk_set_cipso(file, buf, count, ppos, SMK_FIXED24_FMT); in smk_write_cipso()
[all …]
Dsmack_lsm.c459 struct inode *inode = file_inode(bprm->file); in smack_bprm_set_creds()
1057 static int smack_file_permission(struct file *file, int mask) in smack_file_permission() argument
1071 static int smack_file_alloc_security(struct file *file) in smack_file_alloc_security() argument
1073 file->f_security = smk_of_current(); in smack_file_alloc_security()
1084 static void smack_file_free_security(struct file *file) in smack_file_free_security() argument
1086 file->f_security = NULL; in smack_file_free_security()
1099 static int smack_file_ioctl(struct file *file, unsigned int cmd, in smack_file_ioctl() argument
1106 smk_ad_setfield_u_fs_path(&ad, file->f_path); in smack_file_ioctl()
1109 rc = smk_curacc(file->f_security, MAY_WRITE, &ad); in smack_file_ioctl()
1112 rc = smk_curacc(file->f_security, MAY_READ, &ad); in smack_file_ioctl()
[all …]
/security/apparmor/
Dlsm.c376 static int apparmor_file_open(struct file *file, const struct cred *cred) in apparmor_file_open() argument
378 struct aa_file_cxt *fcxt = file->f_security; in apparmor_file_open()
382 if (!mediated_filesystem(file_inode(file))) in apparmor_file_open()
397 struct inode *inode = file_inode(file); in apparmor_file_open()
400 error = aa_path_perm(OP_OPEN, profile, &file->f_path, 0, in apparmor_file_open()
401 aa_map_file_to_perms(file), &cond); in apparmor_file_open()
403 fcxt->allow = aa_map_file_to_perms(file); in apparmor_file_open()
409 static int apparmor_file_alloc_security(struct file *file) in apparmor_file_alloc_security() argument
412 file->f_security = aa_alloc_file_context(GFP_KERNEL); in apparmor_file_alloc_security()
413 if (!file->f_security) in apparmor_file_alloc_security()
[all …]
Dfile.c298 aa_str_perms(profile->file.dfa, profile->file.start, name, cond, in aa_path_perm()
380 state = aa_str_perms(profile->file.dfa, profile->file.start, lname, in aa_path_link()
387 state = aa_dfa_null_transition(profile->file.dfa, state); in aa_path_link()
388 aa_str_perms(profile->file.dfa, state, tname, &cond, &perms); in aa_path_link()
409 aa_str_perms(profile->file.dfa, profile->file.start, tname, &cond, in aa_path_link()
448 int aa_file_perm(int op, struct aa_profile *profile, struct file *file, in aa_file_perm() argument
452 .uid = file_inode(file)->i_uid, in aa_file_perm()
453 .mode = file_inode(file)->i_mode in aa_file_perm()
456 return aa_path_perm(op, profile, &file->f_path, PATH_DELEGATE_DELETED, in aa_file_perm()
Dpolicy_unpack.c379 profile->file.trans.table = kzalloc(sizeof(char *) * size, in unpack_trans_table()
381 if (!profile->file.trans.table) in unpack_trans_table()
384 profile->file.trans.size = size; in unpack_trans_table()
393 profile->file.trans.table[i] = str; in unpack_trans_table()
425 aa_free_domain_entries(&profile->file.trans); in unpack_trans_table()
590 profile->file.dfa = unpack_dfa(e); in unpack_profile()
591 if (IS_ERR(profile->file.dfa)) { in unpack_profile()
592 error = PTR_ERR(profile->file.dfa); in unpack_profile()
593 profile->file.dfa = NULL; in unpack_profile()
597 if (!unpack_u32(e, &profile->file.start, "dfa_start")) in unpack_profile()
[all …]
Ddomain.c114 } else if (!profile->file.dfa) { in change_profile_perms()
118 aa_str_perms(profile->file.dfa, start, name, &cond, &perms); in change_profile_perms()
124 state = aa_dfa_match(profile->file.dfa, start, ns->base.name); in change_profile_perms()
125 state = aa_dfa_match_len(profile->file.dfa, state, ":", 1); in change_profile_perms()
126 aa_str_perms(profile->file.dfa, state, name, &cond, &perms); in change_profile_perms()
254 for (name = profile->file.trans.table[index]; !new_profile && name; in x_table_lookup()
352 file_inode(bprm->file)->i_uid, in apparmor_bprm_set_creds()
353 file_inode(bprm->file)->i_mode in apparmor_bprm_set_creds()
372 state = profile->file.start; in apparmor_bprm_set_creds()
375 error = aa_path_name(&bprm->file->f_path, profile->path_flags, &buffer, in apparmor_bprm_set_creds()
[all …]
Dapparmorfs.c75 static ssize_t profile_load(struct file *f, const char __user *buf, size_t size, in profile_load()
98 static ssize_t profile_replace(struct file *f, const char __user *buf, in profile_replace()
120 static ssize_t profile_remove(struct file *f, const char __user *buf, in profile_remove()
172 static int aa_fs_seq_open(struct inode *inode, struct file *file) in aa_fs_seq_open() argument
174 return single_open(file, aa_fs_seq_show, inode->i_private); in aa_fs_seq_open()
/security/selinux/
Dselinuxfs.c129 static ssize_t sel_read_enforce(struct file *filp, char __user *buf, in sel_read_enforce()
140 static ssize_t sel_write_enforce(struct file *file, const char __user *buf, in sel_write_enforce() argument
200 static ssize_t sel_read_handle_unknown(struct file *filp, char __user *buf, in sel_read_handle_unknown()
218 static int sel_open_handle_status(struct inode *inode, struct file *filp) in sel_open_handle_status()
230 static ssize_t sel_read_handle_status(struct file *filp, char __user *buf, in sel_read_handle_status()
242 static int sel_mmap_handle_status(struct file *filp, in sel_mmap_handle_status()
272 static ssize_t sel_write_disable(struct file *file, const char __user *buf, in sel_write_disable() argument
326 static ssize_t sel_read_policyvers(struct file *filp, char __user *buf, in sel_read_policyvers()
350 static ssize_t sel_read_mls(struct file *filp, char __user *buf, in sel_read_mls()
371 static int sel_open_policy(struct inode *inode, struct file *filp) in sel_open_policy()
[all …]
Dhooks.c262 static int file_alloc_security(struct file *file) in file_alloc_security() argument
273 file->f_security = fsec; in file_alloc_security()
278 static void file_free_security(struct file *file) in file_free_security() argument
280 struct file_security_struct *fsec = file->f_security; in file_free_security()
281 file->f_security = NULL; in file_free_security()
1608 struct file *file, in file_has_perm() argument
1611 struct file_security_struct *fsec = file->f_security; in file_has_perm()
1612 struct inode *inode = file_inode(file); in file_has_perm()
1618 ad.u.path = file->f_path; in file_has_perm()
1835 static inline u32 file_to_av(struct file *file) in file_to_av() argument
[all …]
/security/
Dsecurity.c152 … security_binder_transfer_file(struct task_struct *from, struct task_struct *to, struct file *file) in security_binder_transfer_file() argument
154 return security_ops->binder_transfer_file(from, to, file); in security_binder_transfer_file()
676 int security_file_permission(struct file *file, int mask) in security_file_permission() argument
680 ret = security_ops->file_permission(file, mask); in security_file_permission()
684 return fsnotify_perm(file, mask); in security_file_permission()
687 int security_file_alloc(struct file *file) in security_file_alloc() argument
689 return security_ops->file_alloc_security(file); in security_file_alloc()
692 void security_file_free(struct file *file) in security_file_free() argument
694 security_ops->file_free_security(file); in security_file_free()
697 int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) in security_file_ioctl() argument
[all …]
Dcapability.c30 …c int cap_binder_transfer_file(struct task_struct *from, struct task_struct *to, struct file *file) in cap_binder_transfer_file() argument
319 static int cap_file_permission(struct file *file, int mask) in cap_file_permission() argument
324 static int cap_file_alloc_security(struct file *file) in cap_file_alloc_security() argument
329 static void cap_file_free_security(struct file *file) in cap_file_free_security() argument
333 static int cap_file_ioctl(struct file *file, unsigned int command, in cap_file_ioctl() argument
345 static int cap_file_lock(struct file *file, unsigned int cmd) in cap_file_lock() argument
350 static int cap_file_fcntl(struct file *file, unsigned int cmd, in cap_file_fcntl() argument
356 static int cap_file_set_fowner(struct file *file) in cap_file_set_fowner() argument
367 static int cap_file_receive(struct file *file) in cap_file_receive() argument
372 static int cap_file_open(struct file *file, const struct cred *cred) in cap_file_open() argument
[all …]
/security/keys/
Dproc.c22 static int proc_keys_open(struct inode *inode, struct file *file);
43 static int proc_key_users_open(struct inode *inode, struct file *file);
105 static int proc_keys_open(struct inode *inode, struct file *file) in proc_keys_open() argument
107 return seq_open(file, &proc_keys_ops); in proc_keys_open()
299 static int proc_key_users_open(struct inode *inode, struct file *file) in proc_key_users_open() argument
301 return seq_open(file, &proc_key_users_ops); in proc_key_users_open()
/security/apparmor/include/
Dfile.h180 int aa_file_perm(int op, struct aa_profile *profile, struct file *file,
200 static inline u32 aa_map_file_to_perms(struct file *file) in aa_map_file_to_perms() argument
202 int flags = MAP_OPEN_FLAGS(file->f_flags); in aa_map_file_to_perms()
203 u32 perms = ACC_FMODE(file->f_mode); in aa_map_file_to_perms()
/security/integrity/evm/
Devm_secfs.c32 static ssize_t evm_read_key(struct file *filp, char __user *buf, in evm_read_key()
59 static ssize_t evm_write_key(struct file *file, const char __user *buf, in evm_write_key() argument
DKconfig10 EVM protects a file's security extended attributes against
26 labeled file systems to be relabeled.

12