]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
netfilter: xt_osf: Add missing permission checks
authorKevin Cernekee <cernekee@chromium.org>
Wed, 31 Jan 2018 13:04:51 +0000 (14:04 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 14 Mar 2018 10:40:57 +0000 (11:40 +0100)
commitd74b514ac9fa93c0f070ec177c90b43e36a0c800
treeb341a41e4f5e30346c56d0d2c9d6085c62fedaca
parent126a371a56e3653cdeb4d208ee231548d4b9932d
netfilter: xt_osf: Add missing permission checks

CVE-2017-17450

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>
(cherry picked from commit 916a27901de01446bcf57ecca4783f6cff493309)
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/netfilter/xt_osf.c