/security/integrity/ima/ |
D | ima_main.c | 76 static int mmap_violation_check(enum ima_hooks func, struct file *file, in mmap_violation_check() argument 83 if ((func == MMAP_CHECK) && mapping_writably_mapped(file->f_mapping)) { in mmap_violation_check() 85 inode = file_inode(file); in mmap_violation_check() 88 *pathname = ima_d_path(&file->f_path, pathbuf, in mmap_violation_check() 106 static void ima_rdwr_violation_check(struct file *file, in ima_rdwr_violation_check() argument 113 struct inode *inode = file_inode(file); in ima_rdwr_violation_check() 114 fmode_t mode = file->f_mode; in ima_rdwr_violation_check() 136 *pathname = ima_d_path(&file->f_path, pathbuf, filename); in ima_rdwr_violation_check() 139 ima_add_violation(file, *pathname, iint, in ima_rdwr_violation_check() 142 ima_add_violation(file, *pathname, iint, in ima_rdwr_violation_check() [all …]
|
D | ima_kexec.c | 21 struct seq_file file; in ima_dump_measurement_list() local 26 file.buf = vmalloc(segment_size); in ima_dump_measurement_list() 27 if (!file.buf) { in ima_dump_measurement_list() 32 file.size = segment_size; in ima_dump_measurement_list() 33 file.read_pos = 0; in ima_dump_measurement_list() 34 file.count = sizeof(khdr); /* reserved space */ in ima_dump_measurement_list() 39 if (file.count < file.size) { in ima_dump_measurement_list() 41 ima_measurements_show(&file, qe); in ima_dump_measurement_list() 55 khdr.buffer_size = file.count; in ima_dump_measurement_list() 61 memcpy(file.buf, &khdr, sizeof(khdr)); in ima_dump_measurement_list() [all …]
|
D | ima.h | 59 struct file *file; member 137 int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash); 144 void ima_add_violation(struct file *file, const unsigned char *filename, 213 struct file *file, void *buf, loff_t size, 215 void ima_store_measurement(struct integrity_iint_cache *iint, struct file *file, 258 struct file *file, const unsigned char *filename, 262 void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file); 273 struct file *file, in ima_appraise_measurement() argument 289 struct file *file) in ima_update_xattr() argument
|
D | ima_api.c | 132 void ima_add_violation(struct file *file, const unsigned char *filename, in ima_add_violation() argument 137 struct inode *inode = file_inode(file); in ima_add_violation() 139 .file = file, in ima_add_violation() 207 struct file *file, void *buf, loff_t size, in ima_collect_measurement() argument 211 struct inode *inode = file_inode(file); in ima_collect_measurement() 212 const char *filename = file->f_path.dentry->d_name.name; in ima_collect_measurement() 247 result = ima_calc_file_hash(file, &hash.hdr); in ima_collect_measurement() 268 if (file->f_flags & O_DIRECT) in ima_collect_measurement() 294 struct file *file, const unsigned char *filename, in ima_store_measurement() argument 302 struct inode *inode = file_inode(file); in ima_store_measurement() [all …]
|
D | ima_crypto.c | 204 static int ima_calc_file_hash_atfm(struct file *file, in ima_calc_file_hash_atfm() argument 231 i_size = i_size_read(file_inode(file)); in ima_calc_file_hash_atfm() 269 rc = integrity_kernel_read(file, offset, rbuf[active], in ima_calc_file_hash_atfm() 315 static int ima_calc_file_ahash(struct file *file, struct ima_digest_data *hash) in ima_calc_file_ahash() argument 324 rc = ima_calc_file_hash_atfm(file, hash, tfm); in ima_calc_file_ahash() 331 static int ima_calc_file_hash_tfm(struct file *file, in ima_calc_file_hash_tfm() argument 348 i_size = i_size_read(file_inode(file)); in ima_calc_file_hash_tfm() 360 rbuf_len = integrity_kernel_read(file, offset, rbuf, PAGE_SIZE); in ima_calc_file_hash_tfm() 380 static int ima_calc_file_shash(struct file *file, struct ima_digest_data *hash) in ima_calc_file_shash() argument 389 rc = ima_calc_file_hash_tfm(file, hash, tfm); in ima_calc_file_shash() [all …]
|
D | ima_fs.c | 52 static ssize_t ima_show_htable_violations(struct file *filp, in ima_show_htable_violations() 64 static ssize_t ima_show_measurements_count(struct file *filp, in ima_show_measurements_count() 197 static int ima_measurements_open(struct inode *inode, struct file *file) in ima_measurements_open() argument 199 return seq_open(file, &ima_measurments_seqops); in ima_measurements_open() 263 static int ima_ascii_measurements_open(struct inode *inode, struct file *file) in ima_ascii_measurements_open() argument 265 return seq_open(file, &ima_ascii_measurements_seqops); in ima_ascii_measurements_open() 312 static ssize_t ima_write_policy(struct file *file, const char __user *buf, in ima_write_policy() argument 384 static int ima_open_policy(struct inode *inode, struct file *filp) in ima_open_policy() 409 static int ima_release_policy(struct inode *inode, struct file *file) in ima_release_policy() argument 413 if ((file->f_flags & O_ACCMODE) == O_RDONLY) in ima_release_policy() [all …]
|
D | ima_appraise.c | 316 struct file *file, const unsigned char *filename, in ima_appraise_measurement() argument 322 struct dentry *dentry = file_dentry(file); in ima_appraise_measurement() 340 if (file->f_mode & FMODE_CREATED) in ima_appraise_measurement() 425 void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file) in ima_update_xattr() argument 427 struct dentry *dentry = file_dentry(file); in ima_update_xattr() 438 rc = ima_collect_measurement(iint, file, NULL, 0, ima_hash_algo, NULL); in ima_update_xattr() 442 inode_lock(file_inode(file)); in ima_update_xattr() 444 inode_unlock(file_inode(file)); in ima_update_xattr()
|
/security/tomoyo/ |
D | securityfs_if.c | 41 static ssize_t tomoyo_write_self(struct file *file, const char __user *buf, in tomoyo_write_self() argument 100 static ssize_t tomoyo_read_self(struct file *file, char __user *buf, in tomoyo_read_self() argument 132 static int tomoyo_open(struct inode *inode, struct file *file) in tomoyo_open() argument 134 const int key = ((u8 *) file_inode(file)->i_private) in tomoyo_open() 136 return tomoyo_open_control(key, file); in tomoyo_open() 145 static int tomoyo_release(struct inode *inode, struct file *file) in tomoyo_release() argument 147 tomoyo_close_control(file->private_data); in tomoyo_release() 160 static __poll_t tomoyo_poll(struct file *file, poll_table *wait) in tomoyo_poll() argument 162 return tomoyo_poll_control(file, wait); in tomoyo_poll() 175 static ssize_t tomoyo_read(struct file *file, char __user *buf, size_t count, in tomoyo_read() argument [all …]
|
D | tomoyo.c | 116 &bprm->file->f_path, O_RDONLY); in tomoyo_bprm_check_security() 297 static int tomoyo_file_fcntl(struct file *file, unsigned int cmd, in tomoyo_file_fcntl() argument 300 if (!(cmd == F_SETFL && ((arg ^ file->f_flags) & O_APPEND))) in tomoyo_file_fcntl() 302 return tomoyo_check_open_permission(tomoyo_domain(), &file->f_path, in tomoyo_file_fcntl() 314 static int tomoyo_file_open(struct file *f) in tomoyo_file_open() 332 static int tomoyo_file_ioctl(struct file *file, unsigned int cmd, in tomoyo_file_ioctl() argument 335 return tomoyo_path_number_perm(TOMOYO_TYPE_IOCTL, &file->f_path, cmd); in tomoyo_file_ioctl()
|
/security/apparmor/ |
D | file.c | 285 aa_str_perms(profile->file.dfa, profile->file.start, name, cond, perms); in __aa_path_perm() 390 state = aa_str_perms(profile->file.dfa, profile->file.start, lname, in profile_path_link() 397 state = aa_dfa_null_transition(profile->file.dfa, state); in profile_path_link() 398 aa_str_perms(profile->file.dfa, state, tname, cond, &perms); in profile_path_link() 420 aa_str_perms(profile->file.dfa, profile->file.start, tname, cond, in profile_path_link() 509 struct aa_label *flabel, struct file *file, in __file_path_perm() argument 515 .uid = file_inode(file)->i_uid, in __file_path_perm() 516 .mode = file_inode(file)->i_mode in __file_path_perm() 531 profile_path_perm(op, profile, &file->f_path, buffer, in __file_path_perm() 544 profile_path_perm(op, profile, &file->f_path, in __file_path_perm() [all …]
|
D | apparmorfs.c | 441 static ssize_t profile_load(struct file *f, const char __user *buf, size_t size, in profile_load() 458 static ssize_t profile_replace(struct file *f, const char __user *buf, in profile_replace() 475 static ssize_t profile_remove(struct file *f, const char __user *buf, in profile_remove() 520 static int ns_revision_release(struct inode *inode, struct file *file) in ns_revision_release() argument 522 struct aa_revision *rev = file->private_data; in ns_revision_release() 532 static ssize_t ns_revision_read(struct file *file, char __user *buf, in ns_revision_read() argument 535 struct aa_revision *rev = file->private_data; in ns_revision_read() 544 if (file->f_flags & O_NONBLOCK) in ns_revision_read() 563 static int ns_revision_open(struct inode *inode, struct file *file) in ns_revision_open() argument 573 file->private_data = rev; in ns_revision_open() [all …]
|
D | lsm.c | 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() [all …]
|
D | domain.c | 104 state = aa_dfa_match(profile->file.dfa, state, "&"); in match_component() 106 return aa_dfa_match(profile->file.dfa, state, tp->base.hname); in match_component() 110 state = aa_dfa_match_len(profile->file.dfa, state, ":", 1); in match_component() 111 state = aa_dfa_match(profile->file.dfa, state, ns_name); in match_component() 112 state = aa_dfa_match_len(profile->file.dfa, state, ":", 1); in match_component() 113 return aa_dfa_match(profile->file.dfa, state, tp->base.hname); in match_component() 159 state = aa_dfa_match(profile->file.dfa, state, "//&"); in label_compound_match() 164 *perms = aa_compute_fperms(profile->file.dfa, state, &cond); in label_compound_match() 217 tmp = aa_compute_fperms(profile->file.dfa, state, &cond); in label_components_match() 226 tmp = aa_compute_fperms(profile->file.dfa, state, &cond); in label_components_match() [all …]
|
D | policy_unpack.c | 486 profile->file.trans.table = kcalloc(size, sizeof(char *), in unpack_trans_table() 488 if (!profile->file.trans.table) in unpack_trans_table() 491 profile->file.trans.size = size; in unpack_trans_table() 500 profile->file.trans.table[i] = str; in unpack_trans_table() 538 aa_free_domain_entries(&profile->file.trans); in unpack_trans_table() 847 profile->file.dfa = unpack_dfa(e); in unpack_profile() 848 if (IS_ERR(profile->file.dfa)) { in unpack_profile() 849 error = PTR_ERR(profile->file.dfa); in unpack_profile() 850 profile->file.dfa = NULL; in unpack_profile() 853 } else if (profile->file.dfa) { in unpack_profile() [all …]
|
/security/smack/ |
D | smackfs.c | 443 static ssize_t smk_write_rules_list(struct file *file, const char __user *buf, in smk_write_rules_list() argument 644 static int smk_open_load(struct inode *inode, struct file *file) in smk_open_load() argument 646 return seq_open(file, &load_seq_ops); in smk_open_load() 657 static ssize_t smk_write_load(struct file *file, const char __user *buf, in smk_write_load() argument 668 return smk_write_rules_list(file, buf, count, ppos, NULL, NULL, in smk_write_load() 815 static int smk_open_cipso(struct inode *inode, struct file *file) in smk_open_cipso() argument 817 return seq_open(file, &cipso_seq_ops); in smk_open_cipso() 831 static ssize_t smk_set_cipso(struct file *file, const char __user *buf, in smk_set_cipso() argument 929 static ssize_t smk_write_cipso(struct file *file, const char __user *buf, in smk_write_cipso() argument 932 return smk_set_cipso(file, buf, count, ppos, SMK_FIXED24_FMT); in smk_write_cipso() [all …]
|
D | smack_lsm.c | 214 static int smk_bu_file(struct file *file, int mode, int rc) in smk_bu_file() argument 218 struct inode *inode = file_inode(file); in smk_bu_file() 234 inode->i_sb->s_id, inode->i_ino, file, in smk_bu_file() 239 #define smk_bu_file(file, mode, RC) (RC) argument 243 static int smk_bu_credfile(const struct cred *cred, struct file *file, in smk_bu_credfile() argument 248 struct inode *inode = file_inode(file); in smk_bu_credfile() 264 inode->i_sb->s_id, inode->i_ino, file, in smk_bu_credfile() 269 #define smk_bu_credfile(cred, file, mode, RC) (RC) argument 908 struct inode *inode = file_inode(bprm->file); in smack_bprm_set_creds() 1536 static int smack_file_alloc_security(struct file *file) in smack_file_alloc_security() argument [all …]
|
/security/loadpin/ |
D | loadpin.c | 20 static void report_load(const char *origin, struct file *file, char *operation) in report_load() argument 24 pathname = kstrdup_quotable_file(file, GFP_KERNEL); in report_load() 119 static int loadpin_read_file(struct file *file, enum kernel_read_file_id id) in loadpin_read_file() argument 127 report_load(origin, file, "pinning-excluded"); in loadpin_read_file() 132 if (!file) { in loadpin_read_file() 142 load_root = file->f_path.mnt->mnt_sb; in loadpin_read_file() 160 report_load(origin, file, "pinned"); in loadpin_read_file() 167 report_load(origin, file, "pinning-ignored"); in loadpin_read_file() 171 report_load(origin, file, "denied"); in loadpin_read_file()
|
/security/safesetid/ |
D | securityfs.c | 30 static int parse_policy_line(struct file *file, char *buf, in parse_policy_line() argument 52 rule->src_uid = make_kuid(file->f_cred->user_ns, parsed_parent); in parse_policy_line() 53 rule->dst_uid = make_kuid(file->f_cred->user_ns, parsed_child); in parse_policy_line() 110 static ssize_t handle_policy_update(struct file *file, in handle_policy_update() argument 151 err = parse_policy_line(file, p, rule); in handle_policy_update() 195 static ssize_t safesetid_file_write(struct file *file, in safesetid_file_write() argument 200 if (!file_ns_capable(file, &init_user_ns, CAP_MAC_ADMIN)) in safesetid_file_write() 206 return handle_policy_update(file, buf, len); in safesetid_file_write() 209 static ssize_t safesetid_file_read(struct file *file, char __user *buf, in safesetid_file_read() argument
|
/security/selinux/ |
D | selinuxfs.c | 121 static ssize_t sel_read_enforce(struct file *filp, char __user *buf, in sel_read_enforce() 134 static ssize_t sel_write_enforce(struct file *file, const char __user *buf, in sel_write_enforce() argument 138 struct selinux_fs_info *fsi = file_inode(file)->i_sb->s_fs_info; in sel_write_enforce() 199 static ssize_t sel_read_handle_unknown(struct file *filp, char __user *buf, in sel_read_handle_unknown() 220 static int sel_open_handle_status(struct inode *inode, struct file *filp) in sel_open_handle_status() 233 static ssize_t sel_read_handle_status(struct file *filp, char __user *buf, in sel_read_handle_status() 245 static int sel_mmap_handle_status(struct file *filp, in sel_mmap_handle_status() 275 static ssize_t sel_write_disable(struct file *file, const char __user *buf, in sel_write_disable() argument 279 struct selinux_fs_info *fsi = file_inode(file)->i_sb->s_fs_info; in sel_write_disable() 327 static ssize_t sel_read_policyvers(struct file *filp, char __user *buf, in sel_read_policyvers() [all …]
|
D | hooks.c | 357 static int file_alloc_security(struct file *file) in file_alloc_security() argument 359 struct file_security_struct *fsec = selinux_file(file); in file_alloc_security() 1726 struct file *file, in file_path_has_perm() argument 1732 ad.u.file = file; in file_path_has_perm() 1733 return inode_has_perm(cred, file_inode(file), av, &ad); in file_path_has_perm() 1737 static int bpf_fd_pass(struct file *file, u32 sid); 1749 struct file *file, in file_has_perm() argument 1752 struct file_security_struct *fsec = selinux_file(file); in file_has_perm() 1753 struct inode *inode = file_inode(file); in file_has_perm() 1759 ad.u.file = file; in file_has_perm() [all …]
|
/security/keys/ |
D | big_key.c | 204 struct file *file; in big_key_preparse() local 247 file = shmem_kernel_file_setup("", enclen, 0); in big_key_preparse() 248 if (IS_ERR(file)) { in big_key_preparse() 249 ret = PTR_ERR(file); in big_key_preparse() 253 written = kernel_write(file, buf->virt, enclen, &pos); in big_key_preparse() 265 *path = file->f_path; in big_key_preparse() 267 fput(file); in big_key_preparse() 282 fput(file); in big_key_preparse() 366 struct file *file; in big_key_read() local 375 file = dentry_open(path, O_RDONLY, current_cred()); in big_key_read() [all …]
|
/security/apparmor/include/ |
D | file.h | 31 static inline struct aa_file_ctx *file_ctx(struct file *file) in file_ctx() argument 33 return file->f_security + apparmor_blob_sizes.lbs_file; in file_ctx() 199 int aa_file_perm(const char *op, struct aa_label *label, struct file *file, 216 static inline u32 aa_map_file_to_perms(struct file *file) in aa_map_file_to_perms() argument 218 int flags = file->f_flags; in aa_map_file_to_perms() 221 if (file->f_mode & FMODE_WRITE) in aa_map_file_to_perms() 223 if (file->f_mode & FMODE_READ) in aa_map_file_to_perms()
|
/security/ |
D | security.c | 528 static int lsm_file_alloc(struct file *file) in lsm_file_alloc() argument 531 file->f_security = NULL; in lsm_file_alloc() 535 file->f_security = kmem_cache_zalloc(lsm_file_cache, GFP_KERNEL); in lsm_file_alloc() 536 if (file->f_security == NULL) in lsm_file_alloc() 691 struct task_struct *to, struct file *file) in security_binder_transfer_file() argument 693 return call_int_hook(binder_transfer_file, 0, from, to, file); in security_binder_transfer_file() 1372 int security_file_permission(struct file *file, int mask) in security_file_permission() argument 1376 ret = call_int_hook(file_permission, 0, file, mask); in security_file_permission() 1380 return fsnotify_perm(file, mask); in security_file_permission() 1383 int security_file_alloc(struct file *file) in security_file_alloc() argument [all …]
|
/security/integrity/evm/ |
D | evm_secfs.c | 41 static ssize_t evm_read_key(struct file *filp, char __user *buf, in evm_read_key() 68 static ssize_t evm_write_key(struct file *file, const char __user *buf, in evm_write_key() argument 128 static ssize_t evm_read_xattrs(struct file *filp, char __user *buf, in evm_read_xattrs() 174 static ssize_t evm_write_xattrs(struct file *file, const char __user *buf, in evm_write_xattrs() argument
|
/security/integrity/ |
D | iint.c | 188 int integrity_kernel_read(struct file *file, loff_t offset, in integrity_kernel_read() argument 195 if (!(file->f_mode & FMODE_READ)) in integrity_kernel_read() 200 ret = __vfs_read(file, buf, count, &offset); in integrity_kernel_read()
|