]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: fix backward compatibility for TCA_KIND
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 7 Oct 2019 20:26:28 +0000 (13:26 -0700)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 8 Oct 2019 23:21:58 +0000 (16:21 -0700)
commitaceeb709a548c6099ce39af110aa7e19db870494
tree9f626d3ab135a6964b4c96699694db5a1891d91d
parent8337e8be2394b29a8ed6a233efd6c3af38f572c5
net_sched: fix backward compatibility for TCA_KIND

Marcelo noticed a backward compatibility issue of TCA_KIND
after we move from NLA_STRING to NLA_NUL_STRING, so it is probably
too late to change it.

Instead, to make everyone happy, we can just insert a NUL to
terminate the string with nla_strlcpy() like we do for TC actions.

Fixes: a655edeaa17a ("net_sched: add max len check for TCA_KIND")
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/cls_api.c
net/sched/sch_api.c