]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: allow logging from non-init namespaces
authorMichal Kubeček <mkubecek@suse.cz>
Tue, 31 Jan 2017 09:30:06 +0000 (10:30 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 2 Feb 2017 13:31:58 +0000 (14:31 +0100)
commit26dfb12abb0a15bfc6ba789cdef1781b9c08e074
tree0fe2bf02a3125fc7a13800ded0d34812fda92e60
parent90c128f13e44b71071b03720c7287e82095c5cf9
netfilter: allow logging from non-init namespaces

Commit 21ce55f7512e ("netfilter: xt_LOG: add net namespace support for
xt_LOG") disabled logging packets using the LOG target from non-init
namespaces. The motivation was to prevent containers from flooding
kernel log of the host. The plan was to keep it that way until syslog
namespace implementation allows containers to log in a safe way.

However, the work on syslog namespace seems to have hit a dead end
somewhere in 2013 and there are users who want to use xt_LOG in all
network namespaces. This patch allows to do so by setting

  /proc/sys/net/netfilter/nf_log_all_netns

to a nonzero value. This sysctl is only accessible from init_net so that
one cannot switch the behaviour from inside a container.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Documentation/networking/netfilter-sysctl.txt [new file with mode: 0644]
include/net/netfilter/nf_log.h
net/bridge/netfilter/ebt_log.c
net/ipv4/netfilter/nf_log_arp.c
net/ipv4/netfilter/nf_log_ipv4.c
net/ipv6/netfilter/nf_log_ipv6.c
net/netfilter/nf_log.c