linux-uconsole/include/net/tc_act
Davide Caratti 2b0e6d6bf0 net/sched: don't dereference a->goto_chain to read the chain index
[ Upstream commit fe384e2fa3 ]

callers of tcf_gact_goto_chain_index() can potentially read an old value
of the chain index, or even dereference a NULL 'goto_chain' pointer,
because 'goto_chain' and 'tcfa_action' are read in the traffic path
without caring of concurrent write in the control path. The most recent
value of chain index can be read also from a->tcfa_action (it's encoded
there together with TC_ACT_GOTO_CHAIN bits), so we don't really need to
dereference 'goto_chain': just read the chain id from the control action.

Fixes: e457d86ada ("net: sched: add couple of goto_chain helpers")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
2019-05-04 09:20:18 +02:00
..
tc_bpf.h net_sched: get rid of struct tcf_common 2016-07-25 21:49:20 -07:00
tc_connmark.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tc_csum.h net/sched: act_csum: fix NULL dereference when 'goto chain' is used 2018-07-07 22:01:08 +09:00
tc_defact.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tc_gact.h net/sched: don't dereference a->goto_chain to read the chain index 2019-05-04 09:20:18 +02:00
tc_ife.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
tc_ipt.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tc_mirred.h act_mirred: get rid of tcfm_ifindex from struct tcf_mirred 2017-12-06 14:50:13 -05:00
tc_nat.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tc_pedit.h net sched actions: fix coding style in pedit headers 2018-06-28 22:12:03 +09:00
tc_sample.h act_sample: get rid of tcf_sample_cleanup_rcu() 2017-11-30 10:19:17 -05:00
tc_skbedit.h net/sched: act_skbedit: don't use spinlock in the data path 2018-07-12 14:54:12 -07:00
tc_skbmod.h net_sched: Introduce skbmod action 2016-09-15 19:33:47 -04:00
tc_tunnel_key.h net/sched: act_tunnel_key: fix NULL dereference when 'goto chain' is used 2018-07-07 22:01:08 +09:00
tc_vlan.h act_vlan: VLAN action rewrite to use RCU lock/unlock and update 2017-11-10 15:32:20 +09:00