net_sched: fix backward compatibility for TCA_ACT_KIND
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 7 Oct 2019 20:26:29 +0000 (13:26 -0700)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 8 Oct 2019 23:29:35 +0000 (16:29 -0700)
commit4b793feccae3b06764268377a4030eb774ed924e
tree06e59399c389a2151fb56b0c937315e95393f51e
parent6f96c3c6904c26cea9ca2726d5d8a9b0b8205b3c
net_sched: fix backward compatibility for TCA_ACT_KIND

For TCA_ACT_KIND, we have to keep the backward compatibility too,
and rely on nla_strlcpy() to check and terminate the string with
a NUL.

Note for TC actions, nla_strcmp() is already used to compare kind
strings, so we don't need to fix other places.

Fixes: 199ce850ce11 ("net_sched: add policy validation for action attributes")
Reported-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
net/sched/act_api.c