security/integrity/platform_certs/load_uefi.c
Source file repositories/reference/linux-study-clean/security/integrity/platform_certs/load_uefi.c
File Facts
- System
- Linux kernel
- Corpus path
security/integrity/platform_certs/load_uefi.c- Extension
.c- Size
- 6869 bytes
- Lines
- 239
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/sched.hlinux/cred.hlinux/dmi.hlinux/err.hlinux/efi.hlinux/slab.hlinux/ima.hkeys/asymmetric-type.hkeys/system_keyring.h../integrity.hkeyring_handler.h
Detected Declarations
function uefi_check_ignore_dbfunction load_moklist_certsfunction load_uefi_certs
Annotated Snippet
if (!db) {
if (status == EFI_NOT_FOUND)
pr_debug("MODSIGN: db variable wasn't found\n");
else
pr_err("MODSIGN: Couldn't get UEFI db list\n");
} else {
rc = parse_efi_signature_list("UEFI:db",
db, dbsize, get_handler_for_db);
if (rc)
pr_err("Couldn't parse db signatures: %d\n",
rc);
kfree(db);
}
}
dbx = get_cert_list(L"dbx", &secure_var, &dbxsize, &status);
if (!dbx) {
if (status == EFI_NOT_FOUND)
pr_debug("dbx variable wasn't found\n");
else
pr_info("Couldn't get UEFI dbx list\n");
} else {
rc = parse_efi_signature_list("UEFI:dbx",
dbx, dbxsize,
get_handler_for_dbx);
if (rc)
pr_err("Couldn't parse dbx signatures: %d\n", rc);
kfree(dbx);
}
/* the MOK/MOKx can not be trusted when secure boot is disabled */
if (!arch_get_secureboot())
return 0;
mokx = get_cert_list(L"MokListXRT", &mok_var, &mokxsize, &status);
if (!mokx) {
if (status == EFI_NOT_FOUND)
pr_debug("mokx variable wasn't found\n");
else
pr_info("Couldn't get mokx list\n");
} else {
rc = parse_efi_signature_list("UEFI:MokListXRT",
mokx, mokxsize,
get_handler_for_dbx);
if (rc)
pr_err("Couldn't parse mokx signatures %d\n", rc);
kfree(mokx);
}
/* Load the MokListRT certs */
rc = load_moklist_certs();
return rc;
}
late_initcall(load_uefi_certs);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/sched.h`, `linux/cred.h`, `linux/dmi.h`, `linux/err.h`, `linux/efi.h`, `linux/slab.h`, `linux/ima.h`.
- Detected declarations: `function uefi_check_ignore_db`, `function load_moklist_certs`, `function load_uefi_certs`.
- 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.