• Masahiro Yamada's avatar
    modpost: add array range check to sec_name() · 125ed24a
    Masahiro Yamada authored
    The section index is always positive, so the argument, secindex, should
    be unsigned.
    
    Also, inserted the array range check.
    
    If sym->st_shndx is a special section index (between SHN_LORESERVE and
    SHN_HIRESERVE), there is no corresponding section header.
    
    For example, if a symbol specifies an absolute value, sym->st_shndx is
    SHN_ABS (=0xfff1).
    
    The current users do not cause the out-of-range access of
    info->sechddrs[], but it is better to avoid such a pitfall.
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    125ed24a
modpost.c 66.6 KB