• Ard Biesheuvel's avatar
    arm64: module: don't BUG when exceeding preallocated PLT count · 5e8307b9
    Ard Biesheuvel authored
    When PLTs are emitted at relocation time, we really should not exceed
    the number that we counted when parsing the relocation tables, and so
    currently, we BUG() on this condition. However, even though this is a
    clear bug in this particular piece of code, we can easily recover by
    failing to load the module.
    
    So instead, return 0 from module_emit_plt_entry() if this condition
    occurs, which is not a valid kernel address, and can hence serve as
    a flag value that makes the relocation routine bail out.
    Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    5e8307b9
module.c 11.7 KB