elf_validity_cache_index(9)
π elf_validity_cache_index β like, the index girlie of the ELF validity saga (this is a page from the Kernel API Manual, bestie, section 9)
okay so picture this: you've got a module, you've got sections, and somebody has to actually go through and resolve all the section indices, validate them, and cache them so nobody has to do it twice. That somebody? This function. She's the main character of index caching and she does NOT miss. β¨
πΈ SYNOPSIS πΈ
int elf_validity_cache_index (struct load_info *info , int flags );
π ARGUMENTS π
infoβ the load info you're reading from and updating, bestie. Heads up though:load_info->sechdrsandload_info->secstringsmust be populated before you call this. No cap, if they're not there she cannot cook. πflagsβ load flags. These matter for suppressing version loading, so go peek atuapi/linux/module.hif you wanna know the deets. iykyk.
π¦ DESCRIPTION π¦
She populates load_info->index, and she's validating the whole way through β like a vibe check but for every field, one at a time. π«Ά
For the per-field validation specifics, the actual receipts live in the child functions:
elf_validity_cache_index_infoelf_validity_cache_index_modelf_validity_cache_index_symelf_validity_cache_index_strelf_validity_cache_index_versions
Also!! If CONFIG_SMP is enabled, she loads the percpu section by name β and ngl, with no validation. That's just how it is, that's the bit. π
β RETURN β
0on success β we love a clean win π- a negative error code if any index failed validation π (the vibe check did NOT pass, unfortunately)
π SEE ALSO π
okay this is the whole friend group, gather round:
Kernel file ./kernel/module/main.c is the home base, and then:
find_any_unique_sec(9)is_module_percpu_address(9)module_refcount(9)verify_module_namespace(9)elf_validity_ehdr(9)elf_validity_cache_sechdrs(9)elf_validity_cache_secstrings(9)elf_validity_cache_index_info(9)elf_validity_cache_index_mod(9)elf_validity_cache_index_sym(9)elf_validity_cache_index_str(9)elf_validity_cache_index_versions(9)elf_validity_cache_strtab(9)is_module_address(9)__module_address(9)is_module_text_address(9)__module_text_address(9)
mwah π that's the whole page, go forth and cache your indices responsibly. This lil beauty lives in ./kernel/module and it's dated October 2026 β yes, she's from the future, and yes, she ate. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms