elf_validity_cache_index(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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->sechdrs and load_info->secstrings must 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 at uapi/linux/module.h if 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_info
  • elf_validity_cache_index_mod
  • elf_validity_cache_index_sym
  • elf_validity_cache_index_str
  • elf_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 ⭐

  • 0 on 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:


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