• Alex Elder's avatar
    net: ipa: verify table sizes fit in commands early · 5444b0ea
    Alex Elder authored
    We currently verify the table size and offset fit in the immediate
    command fields that must encode them in ipa_table_valid_one().  We
    can now make this check earlier, in ipa_table_mem_valid().
    
    The non-hashed IPv4 filter and route tables will always exist, and
    their sizes will match the IPv6 tables, as well as the hashed tables
    (if supported).  So it's sufficient to verify the offset and size of
    the IPv4 non-hashed tables fit into these fields.
    
    Rename the function ipa_cmd_table_init_valid(), to reinforce that
    it is the TABLE_INIT immediate command fields we're checking.
    Signed-off-by: default avatarAlex Elder <elder@linaro.org>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    5444b0ea
ipa_table.c 24.1 KB