]> git.baikalelectronics.ru Git - kernel.git/commit
net/sched: cls_api: add missing validation of netlink attributes
authorDavide Caratti <dcaratti@redhat.com>
Wed, 10 Oct 2018 20:00:58 +0000 (22:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Oct 2018 04:48:44 +0000 (21:48 -0700)
commit3ce236a0bc72d4df787aec5de30b80a2028af5c9
tree5233db75fb1b9795b27e8cca5c5981a076f8427e
parentc4fbd0e4380c556aa32ca91f4bca0af97c8c4299
net/sched: cls_api: add missing validation of netlink attributes

Similarly to what has been done in 5e953f771b15 ("net: sched: Add policy
validation for tc attributes"), fix classifier code to add validation of
TCA_CHAIN and TCA_KIND netlink attributes.

tested with:
 # ./tdc.py -c filter

v2: Let sch_api and cls_api share nla_policy they have in common, thanks
    to David Ahern.
v3: Avoid EXPORT_SYMBOL(), as validation of those attributes is not done
    by TC modules, thanks to Cong Wang.
    While at it, restore the 'Delete / get qdisc' comment to its orginal
    position, just above tc_get_qdisc() function prototype.

Fixes: 78526a0e48a9a ("net: sched: introduce multichain support for filters")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c
net/sched/sch_api.c