]> git.baikalelectronics.ru Git - kernel.git/commit
net/sched: flower: Fix null pointer dereference when run tc vlan command
authorJianbo Liu <jianbol@mellanox.com>
Mon, 9 Jul 2018 02:26:20 +0000 (02:26 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Jul 2018 05:48:13 +0000 (22:48 -0700)
commita11a3abb00a911f5198253206f96345b47673f0c
tree83330d5b0d83102a537bbbff24a825748dcf5c5a
parent93e996ee3838c40b632d607eda35e7fb75d695df
net/sched: flower: Fix null pointer dereference when run tc vlan command

Zahari issued tc vlan command without setting vlan_ethtype, which will
crash kernel. To avoid this, we must check tb[TCA_FLOWER_KEY_VLAN_ETH_TYPE]
is not null before use it.
Also we don't need to dump vlan_ethtype or cvlan_ethtype in this case.

Fixes: 0936bf6ac33b ('net/sched: flower: Add supprt for matching on QinQ vlan headers')
Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Reported-by: Zahari Doychev <zahari.doychev@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_flower.c