ENUM FAIL_DUP_MOD_REASON(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… enum fail_dup_mod_reason(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual ✨ this page is about enum fail_dup_mod_reason and it's literally the story of that one moment when the kernel is like "wait… didn't I just see you?!" πŸ‘€ no cap, it's the state at which a duplicate module was detected. main character energy for sure πŸŽ€


✨ NAME ✨

enum fail_dup_mod_reason β€” the state at which a duplicate module was detected. that's the whole vibe check πŸ’…


✨ SYNOPSIS ✨

enum fail_dup_mod_reason {
    FAIL_DUP_MOD_BECOMING ,
    FAIL_DUP_MOD_LOAD

};

✨ Constants ✨

  • FAIL_DUP_MOD_BECOMING β€” okay so picture this: the module has been read properly 🌸 and it passes all the checks, but then we determine that another module with the same name is already loaded, or is being processed on our modules list 😭. this happens on early_mod_check right before layout_and_allocate. and like β€” the kernel would have already vmalloc'd space for the entire module through finit_module at this point πŸ™ˆ. if decompression was used, two vmap spaces were used. these failures can happen when userspace has not seen the module present on the kernel and tries to load the module multiple times at same time. messy, but it happens πŸ’€
  • FAIL_DUP_MOD_LOAD β€” highkey the more dramatic sibling 🫢. the module has been read properly, passes all validation checks, and the kernel determines that the module was unique β€” and because of this allocated yet another private kernel copy of the module space in layout_and_allocate β€” but after this, determined in add_unformed_module that another module with the same name is already loaded or being processed πŸ¦‹. these failures should be mitigated as much as possible and are indicative of really fast races in loading modules πŸ”₯. without module decompression they waste twice as much vmap space. with module decompression, three times the module's size vmap space is wasted 😭😭
bestie. wasted vmap space is not the aesthetic. mitigate these races fr fr πŸ’œ

✨ SEE ALSO ✨

  • Kernel file ./kernel/module/internal.h ⭐

kisses, bestie πŸ’– this icon of a page lives in ./kernel/module, dated October 2026, and it ATE πŸ‘‘ go forth and never load the same module twice at the same time 🧚✨

πŸ“¦ where this page comes from