From 70b9ebae63ce7e6f9911bdfbcf47a6d18f24159a Mon Sep 17 00:00:00 2001 From: Pedro Tammela Date: Fri, 24 Feb 2023 14:57:56 -0300 Subject: [PATCH] tc: m_action: fix parsing of TCA_EXT_WARN_MSG 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 Signed-off-by: Pedro Tammela Signed-off-by: Stephen Hemminger --- tc/m_action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/m_action.c b/tc/m_action.c index 0400132ce..6c91af2ce 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -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; -- 2.47.3