]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:55:36 +0000 (19:55 -0600)
commit94e492decb97d4c787dc4019f45bf3613002a216
tree9d5250bbe12fa96eba07d6e1449f37f47feebe40
parentab3b68a941853d5f738683eb2b2ecd0a272bfff3
net/sched: cls_api: add missing validation of netlink attributes

BugLink: https://bugs.launchpad.net/bugs/1836654
[ Upstream commit e331473fee3d500bb0d2582a1fe598df3326d8cd ]

Similarly to what has been done in 8b4c3cdd9dd8 ("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: 5bc1701881e39 ("net: sched: introduce multichain support for filters")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
net/sched/cls_api.c