]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: x_tables: fix cgroup matching on non-full sks
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 27 Mar 2015 18:37:41 +0000 (19:37 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 1 Apr 2015 09:26:42 +0000 (11:26 +0200)
commit1d63599c78a13a78a1423e71e04910a71c226b3c
tree41dbbd1901d52632a4570bcd76f8506e9a0edf29
parenta387688ee8a90b7d8b6cee30d7f3b65b0d3e6f45
netfilter: x_tables: fix cgroup matching on non-full sks

While originally only being intended for outgoing traffic, commit
9de8944219f3 ("netfilter: x_tables: allow to use cgroup match for
LOCAL_IN nf hooks") enabled xt_cgroups for the NF_INET_LOCAL_IN hook
as well, in order to allow for nfacct accounting.

Besides being currently limited to early demuxes only, commit
9de8944219f3 forgot to add a check if we deal with full sockets,
i.e. in this case not with time wait sockets. TCP time wait sockets
do not have the same memory layout as full sockets, a lower memory
footprint and consequently also don't have a sk_classid member;
probing for sk_classid member there could potentially lead to a
crash.

Fixes: 9de8944219f3 ("netfilter: x_tables: allow to use cgroup match for LOCAL_IN nf hooks")
Cc: Alexey Perevalov <a.perevalov@samsung.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/xt_cgroup.c