]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Feb 2017 14:11:41 +0000 (15:11 +0100)
commit6c8556f6e11441c52f9593381c8be50f922f911f
tree3584e03f081eec80ede5f7e3efcae93a8e720277
parent64cc7ef5cf1d53ee084231b451d4c73c0cab3012
net/sched: matchall: Fix configuration race

[ Upstream commit fd62d9f5c575f0792f150109f1fd24a0d4b3f854 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/cls_matchall.c