tools/testing/selftests/lsm/lsm_list_modules_test.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/lsm/lsm_list_modules_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/lsm/lsm_list_modules_test.c- Extension
.c- Size
- 2959 bytes
- Lines
- 147
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
linux/lsm.hstring.hstdio.hunistd.hsys/types.hkselftest_harness.hcommon.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
switch (syscall_lsms[i]) {
case LSM_ID_CAPABILITY:
name = "capability";
break;
case LSM_ID_SELINUX:
name = "selinux";
break;
case LSM_ID_SMACK:
name = "smack";
break;
case LSM_ID_TOMOYO:
name = "tomoyo";
break;
case LSM_ID_APPARMOR:
name = "apparmor";
break;
case LSM_ID_YAMA:
name = "yama";
break;
case LSM_ID_LOADPIN:
name = "loadpin";
break;
case LSM_ID_SAFESETID:
name = "safesetid";
break;
case LSM_ID_LOCKDOWN:
name = "lockdown";
break;
case LSM_ID_BPF:
name = "bpf";
break;
case LSM_ID_LANDLOCK:
name = "landlock";
break;
case LSM_ID_IMA:
name = "ima";
break;
case LSM_ID_EVM:
name = "evm";
break;
case LSM_ID_IPE:
name = "ipe";
break;
default:
name = "INVALID";
break;
}
ASSERT_EQ(0, strncmp(cp, name, strlen(name)));
cp += strlen(name) + 1;
}
free(sysfs_lsms);
free(syscall_lsms);
}
TEST_HARNESS_MAIN
Annotation
- Immediate include surface: `linux/lsm.h`, `string.h`, `stdio.h`, `unistd.h`, `sys/types.h`, `kselftest_harness.h`, `common.h`.
- Atlas domain: Support Tooling And Documentation / tools.
- 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.