]> git.karo-electronics.de Git - linux-beck.git/commit
net/sched: matchall: Fix configuration race
authorYotam Gigi <yotamg@mellanox.com>
Tue, 31 Jan 2017 13:14:29 +0000 (15:14 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Feb 2017 16:57:33 +0000 (11:57 -0500)
commitfd62d9f5c575f0792f150109f1fd24a0d4b3f854
treed040d634401cf38fcb447c13aff26d0f492a82a1
parent4993b39ab04b083ff6ee1147e7e7f120feb6bf7f
net/sched: matchall: Fix configuration race

In the current version, the matchall internal state is split into two
structs: cls_matchall_head and cls_matchall_filter. This makes little
sense, as matchall instance supports only one filter, and there is no
situation where one exists and the other does not. In addition, that led
to some races when filter was deleted while packet was processed.

Unify that two structs into one, thus simplifying the process of matchall
creation and deletion. As a result, the new, delete and get callbacks have
a dummy implementation where all the work is done in destroy and change
callbacks, as was done in cls_cgroup.

Fixes: bf3994d2ed31 ("net/sched: introduce Match-all classifier")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_matchall.c