Lines Matching refs:f
65 static void audit_free_lsm_field(struct audit_field *f) in audit_free_lsm_field() argument
67 switch (f->type) { in audit_free_lsm_field()
78 kfree(f->lsm_str); in audit_free_lsm_field()
79 security_audit_rule_free(f->lsm_rule); in audit_free_lsm_field()
154 struct audit_field *f) in audit_to_inode() argument
159 (f->op != Audit_equal && f->op != Audit_not_equal)) in audit_to_inode()
162 krule->inode_f = f; in audit_to_inode()
327 static int audit_field_valid(struct audit_entry *entry, struct audit_field *f) in audit_field_valid() argument
329 switch (f->type) { in audit_field_valid()
347 switch(f->type) { in audit_field_valid()
357 switch (f->type) { in audit_field_valid()
391 if (f->op == Audit_bitmask || f->op == Audit_bittest) in audit_field_valid()
411 if (f->op != Audit_not_equal && f->op != Audit_equal) in audit_field_valid()
420 switch (f->type) { in audit_field_valid()
422 if ((f->val != 0) && (f->val != 1)) in audit_field_valid()
426 if (f->val & ~15) in audit_field_valid()
430 if (f->val & ~S_IFMT) in audit_field_valid()
434 if (f->val > AUDIT_MAX_FIELD_COMPARE) in audit_field_valid()
438 if (f->val >= AF_MAX) in audit_field_valid()
466 struct audit_field *f = &entry->rule.fields[i]; in audit_data_to_entry() local
471 f->op = audit_to_op(data->fieldflags[i]); in audit_data_to_entry()
472 if (f->op == Audit_bad) in audit_data_to_entry()
475 f->type = data->fields[i]; in audit_data_to_entry()
479 if ((f->type == AUDIT_LOGINUID) && (f_val == AUDIT_UID_UNSET)) { in audit_data_to_entry()
480 f->type = AUDIT_LOGINUID_SET; in audit_data_to_entry()
485 err = audit_field_valid(entry, f); in audit_data_to_entry()
490 switch (f->type) { in audit_data_to_entry()
497 f->uid = make_kuid(current_user_ns(), f_val); in audit_data_to_entry()
498 if (!uid_valid(f->uid)) in audit_data_to_entry()
506 f->gid = make_kgid(current_user_ns(), f_val); in audit_data_to_entry()
507 if (!gid_valid(f->gid)) in audit_data_to_entry()
511 f->val = f_val; in audit_data_to_entry()
512 entry->rule.arch_f = f; in audit_data_to_entry()
530 f->lsm_str = str; in audit_data_to_entry()
531 err = security_audit_rule_init(f->type, f->op, str, in audit_data_to_entry()
532 (void **)&f->lsm_rule); in audit_data_to_entry()
548 err = audit_to_watch(&entry->rule, str, f_val, f->op); in audit_data_to_entry()
561 err = audit_make_tree(&entry->rule, str, f->op); in audit_data_to_entry()
568 f->val = f_val; in audit_data_to_entry()
569 err = audit_to_inode(&entry->rule, f); in audit_data_to_entry()
602 f->val = f_val; in audit_data_to_entry()
650 struct audit_field *f = &krule->fields[i]; in audit_krule_to_data() local
652 data->fields[i] = f->type; in audit_krule_to_data()
653 data->fieldflags[i] = audit_ops[f->op]; in audit_krule_to_data()
654 switch(f->type) { in audit_krule_to_data()
666 audit_pack_string(&bufp, f->lsm_str); in audit_krule_to_data()
687 if (krule->pflags & AUDIT_LOGINUID_LEGACY && !f->val) { in audit_krule_to_data()
694 data->values[i] = f->val; in audit_krule_to_data()
1339 struct audit_field *f = &e->rule.fields[i]; in audit_filter() local
1343 switch (f->type) { in audit_filter()
1346 result = audit_comparator(pid, f->op, f->val); in audit_filter()
1349 result = audit_uid_comparator(current_uid(), f->op, f->uid); in audit_filter()
1352 result = audit_gid_comparator(current_gid(), f->op, f->gid); in audit_filter()
1356 f->op, f->uid); in audit_filter()
1360 f->op, f->val); in audit_filter()
1363 result = audit_comparator(msgtype, f->op, f->val); in audit_filter()
1370 if (f->lsm_rule) { in audit_filter()
1373 f->type, f->op, f->lsm_rule); in audit_filter()
1378 if (f->op == Audit_not_equal) in audit_filter()