security/ipe/policy_tests.c
Source file repositories/reference/linux-study-clean/security/ipe/policy_tests.c
File Facts
- System
- Linux kernel
- Corpus path
security/ipe/policy_tests.c- Extension
.c- Size
- 6951 bytes
- Lines
- 298
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/slab.hlinux/types.hlinux/list.hkunit/test.hpolicy.h
Detected Declarations
struct policy_casefunction pol_to_descfunction ipe_parser_unsigned_testfunction ipe_parser_widestring_test
Annotated Snippet
struct policy_case {
const char *const policy;
int errno;
const char *const desc;
};
static const struct policy_case policy_cases[] = {
{
"policy_name=allowall policy_version=0.0.0\n"
"DEFAULT action=ALLOW",
0,
"basic",
},
{
"policy_name=trailing_comment policy_version=152.0.0 #This is comment\n"
"DEFAULT action=ALLOW",
0,
"trailing comment",
},
{
"policy_name=allowallnewline policy_version=0.2.0\n"
"DEFAULT action=ALLOW\n"
"\n",
0,
"trailing newline",
},
{
"policy_name=carriagereturnlinefeed policy_version=0.0.1\n"
"DEFAULT action=ALLOW\n"
"\r\n",
0,
"clrf newline",
},
{
"policy_name=whitespace policy_version=0.0.0\n"
"DEFAULT\taction=ALLOW\n"
" \t DEFAULT \t op=EXECUTE action=DENY\n"
"op=EXECUTE boot_verified=TRUE action=ALLOW\n"
"# this is a\tcomment\t\t\t\t\n"
"DEFAULT \t op=KMODULE\t\t\t action=DENY\r\n"
"op=KMODULE boot_verified=TRUE action=ALLOW\n",
0,
"various whitespaces and nested default",
},
{
"policy_name=boot_verified policy_version=-1236.0.0\n"
"DEFAULT\taction=ALLOW\n",
-EINVAL,
"negative version",
},
{
"policy_name=$@!*&^%%\\:;{}() policy_version=0.0.0\n"
"DEFAULT action=ALLOW",
0,
"special characters",
},
{
"policy_name=test policy_version=999999.0.0\n"
"DEFAULT action=ALLOW",
-ERANGE,
"overflow version",
},
{
"policy_name=test policy_version=255.0\n"
"DEFAULT action=ALLOW",
-EBADMSG,
"incomplete version",
},
{
"policy_name=test policy_version=111.0.0.0\n"
"DEFAULT action=ALLOW",
-EBADMSG,
"extra version",
},
{
"",
-EBADMSG,
"0-length policy",
},
{
"policy_name=test\0policy_version=0.0.0\n"
"DEFAULT action=ALLOW",
-EBADMSG,
"random null in header",
},
{
"policy_name=test policy_version=0.0.0\n"
"\0DEFAULT action=ALLOW",
-EBADMSG,
"incomplete policy from NULL",
Annotation
- Immediate include surface: `linux/slab.h`, `linux/types.h`, `linux/list.h`, `kunit/test.h`, `policy.h`.
- Detected declarations: `struct policy_case`, `function pol_to_desc`, `function ipe_parser_unsigned_test`, `function ipe_parser_widestring_test`.
- Atlas domain: Core OS / Security And Isolation.
- Implementation status: source implementation candidate.
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.