Kevin Cernekee d01ceb4722 netfilter: xt_osf: Add missing permission checks
commit 916a27901de01446bcf57ecca4783f6cff493309 upstream.

The capability check in nfnetlink_rcv() verifies that the caller
has CAP_NET_ADMIN in the namespace that "owns" the netlink socket.
However, xt_osf_fingers is shared by all net namespaces on the
system.  An unprivileged user can create user and net namespaces
in which he holds CAP_NET_ADMIN to bypass the netlink_net_capable()
check:

    vpnns -- nfnl_osf -f /tmp/pf.os

    vpnns -- nfnl_osf -f /tmp/pf.os -d

These non-root operations successfully modify the systemwide OS
fingerprint list.  Add new capable() checks so that they can't.

Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-31 12:06:11 +01:00
..
2017-11-15 17:13:11 +01:00
2015-11-23 14:56:15 -05:00
2018-01-31 12:06:10 +01:00
2018-01-31 12:06:10 +01:00
2015-10-07 04:27:43 -07:00
2015-10-21 00:49:24 +02:00
2018-01-02 20:33:24 +01:00
2017-10-08 10:14:18 +02:00