]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: m_action: fix parsing of TCA_EXT_WARN_MSG
authorPedro Tammela <pctammela@mojatatu.com>
Fri, 24 Feb 2023 17:57:56 +0000 (14:57 -0300)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 24 Feb 2023 18:09:18 +0000 (10:09 -0800)
It should sit within the TCA_ACT_TAB hierarchy, otherwise the access to
tb is out of bounds:
./tc action ls action csum
total acts 1

        action order 0: csum (?empty) action pass
        index 1 ref 1 bind 0
        not_in_hw
Segmentation fault (core dumped)

Fixes: 60359956 ("tc: add new attr TCA_EXT_WARN_MSG")
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/m_action.c

index 0400132ceff63480003b18ed52699d3b8d83d18a..6c91af2ce0ad57255313d78d567ba5920b13090e 100644 (file)
@@ -586,7 +586,7 @@ int print_action(struct nlmsghdr *n, void *arg)
 
        open_json_object(NULL);
        tc_dump_action(fp, tb[TCA_ACT_TAB], tot_acts ? *tot_acts:0, false);
-       print_ext_msg(tb);
+       print_ext_msg(&tb[TCA_ACT_TAB]);
        close_json_object();
 
        return 0;