security/ipe/eval.c
Source file repositories/reference/linux-study-clean/security/ipe/eval.c
File Facts
- System
- Linux kernel
- Corpus path
security/ipe/eval.c- Extension
.c- Size
- 10566 bytes
- Lines
- 394
- Domain
- Core OS
- Bucket
- Security And Isolation
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/fs.hlinux/types.hlinux/slab.hlinux/file.hlinux/sched.hlinux/rcupdate.hlinux/moduleparam.hlinux/fsverity.hipe.heval.hpolicy.haudit.hdigest.h
Detected Declarations
function build_ipe_sb_ctxfunction build_ipe_bdev_ctxfunction build_ipe_bdev_ctxfunction build_ipe_inode_blob_ctxfunction build_ipe_inode_ctxfunction evaluate_boot_verifiedfunction evaluate_dmv_roothashfunction evaluate_dmv_roothashfunction evaluate_dmv_sig_falsefunction evaluate_dmv_sig_truefunction evaluate_dmv_sig_falsefunction evaluate_dmv_sig_truefunction evaluate_fsv_digestfunction evaluate_fsv_digestfunction evaluate_fsv_sig_falsefunction evaluate_fsv_sig_truefunction evaluate_fsv_sig_falsefunction evaluate_fsv_sig_truefunction evaluate_propertyfunction ipe_evaluate_eventfunction list_for_each_entryfunction list_for_each_entry
Annotated Snippet
if (pol->parsed->global_default_action == IPE_ACTION_INVALID) {
WARN(1, "no default rule set for unknown op, ALLOW it");
action = IPE_ACTION_ALLOW;
} else {
action = pol->parsed->global_default_action;
}
match_type = IPE_MATCH_GLOBAL;
goto eval;
}
rules = &pol->parsed->rules[ctx->op];
list_for_each_entry(rule, &rules->rules, next) {
match = true;
list_for_each_entry(prop, &rule->props, next) {
match = evaluate_property(ctx, prop);
if (!match)
break;
}
if (match)
break;
}
if (match) {
action = rule->action;
match_type = IPE_MATCH_RULE;
} else if (rules->default_action != IPE_ACTION_INVALID) {
action = rules->default_action;
match_type = IPE_MATCH_TABLE;
} else {
action = pol->parsed->global_default_action;
match_type = IPE_MATCH_GLOBAL;
}
eval:
ipe_audit_match(ctx, match_type, action, rule);
rcu_read_unlock();
if (action == IPE_ACTION_DENY)
rc = -EACCES;
if (!READ_ONCE(enforce))
rc = 0;
return rc;
}
/* Set the right module name */
#ifdef KBUILD_MODNAME
#undef KBUILD_MODNAME
#define KBUILD_MODNAME "ipe"
#endif
module_param(success_audit, bool, 0400);
MODULE_PARM_DESC(success_audit, "Start IPE with success auditing enabled");
module_param(enforce, bool, 0400);
MODULE_PARM_DESC(enforce, "Start IPE in enforce or permissive mode");
Annotation
- Immediate include surface: `linux/fs.h`, `linux/types.h`, `linux/slab.h`, `linux/file.h`, `linux/sched.h`, `linux/rcupdate.h`, `linux/moduleparam.h`, `linux/fsverity.h`.
- Detected declarations: `function build_ipe_sb_ctx`, `function build_ipe_bdev_ctx`, `function build_ipe_bdev_ctx`, `function build_ipe_inode_blob_ctx`, `function build_ipe_inode_ctx`, `function evaluate_boot_verified`, `function evaluate_dmv_roothash`, `function evaluate_dmv_roothash`, `function evaluate_dmv_sig_false`, `function evaluate_dmv_sig_true`.
- Atlas domain: Core OS / Security And Isolation.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.