From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Kevin Cernekee <cernekee@chromium.org>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL for 4.9 37/49] netfilter: xt_osf: Add missing permission checks
Date: Sun, 28 Jan 2018 22:27:59 +0000 [thread overview]
Message-ID: <20180128222727.22404-37-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180128222727.22404-1-alexander.levin@microsoft.com>
From: Kevin Cernekee <cernekee@chromium.org>
[ Upstream commit 916a27901de01446bcf57ecca4783f6cff493309 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
net/netfilter/xt_osf.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c
index 2455b69b5810..b589a62e68a2 100644
--- a/net/netfilter/xt_osf.c
+++ b/net/netfilter/xt_osf.c
@@ -19,6 +19,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
+#include <linux/capability.h>
#include <linux/if.h>
#include <linux/inetdevice.h>
#include <linux/ip.h>
@@ -69,6 +70,9 @@ static int xt_osf_add_callback(struct net *net, struct sock *ctnl,
struct xt_osf_finger *kf = NULL, *sf;
int err = 0;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
if (!osf_attrs[OSF_ATTR_FINGER])
return -EINVAL;
@@ -113,6 +117,9 @@ static int xt_osf_remove_callback(struct net *net, struct sock *ctnl,
struct xt_osf_finger *sf;
int err = -ENOENT;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
if (!osf_attrs[OSF_ATTR_FINGER])
return -EINVAL;
--
2.11.0
next prev parent reply other threads:[~2018-01-28 22:48 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-28 22:27 [PATCH AUTOSEL for 4.9 01/49] usb: build drivers/usb/common/ when USB_SUPPORT is set Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 02/49] ARM: OMAP2+: Fix SRAM virt to phys translation for save_secure_ram_context Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 03/49] ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 05/49] ARM: dts: logicpd-som-lv: Fix gpmc addresses for NAND and enet Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 04/49] ARM: dts: Fix omap4 hang with GPS connected to USB by using wakeupgen Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 06/49] ARM: dts: logicpd-somlv: Fix wl127x pinmux Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 07/49] ARM: dts: am4372: Correct the interrupts_properties of McASP Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 08/49] ARM: dts: am437x-cm-t43: Correct the dmas property of spi0 Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 09/49] perf top: Fix window dimensions change handling Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 11/49] media: s5k6aa: describe some function parameters Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 10/49] perf bench numa: Fixup discontiguous/sparse numa nodes Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 12/49] pinctrl: sunxi: Fix A80 interrupt pin bank Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 14/49] i40iw: Correct ARP index mask Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 13/49] pinctrl: sunxi: Fix A64 UART mux value Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 15/49] RDMA/cma: Make sure that PSN is not over max allowed Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 17/49] scripts/kernel-doc: Don't fail with status != 0 if error encountered with -none Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 16/49] sctp: only update outstanding_bytes for transmitted queue when doing prsctp_prune Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 18/49] ipvlan: Add the skb->mark as flow4's member to lookup route Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 19/49] m68k: add missing SOFTIRQENTRY_TEXT linker section Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 20/49] powerpc/perf: Fix oops when grouping different pmu events Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 21/49] s390/dasd: prevent prefix I/O error Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 22/49] ARM: dts: Fix elm interrupt compiler warning Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 23/49] gianfar: fix a flooded alignment reports because of padding issue Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 24/49] net_sched: red: Avoid devision by zero Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 25/49] net_sched: red: Avoid illegal values Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 26/49] dccp: CVE-2017-8824: use-after-free in DCCP code Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 27/49] btrfs: Fix possible off-by-one in btrfs_search_path_in_tree Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 28/49] brcmfmac: Avoid build error with make W=1 Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 29/49] net: ethernet: arc: fix error handling in emac_rockchip_probe Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 30/49] 509: fix printing uninitialized stack memory when OID is empty Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 32/49] dmaengine: ioat: Fix error handling path Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 31/49] gianfar: Disable EEE autoneg by default Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 33/49] dmaengine: at_hdmac: fix potential NULL pointer dereference in atc_prep_dma_interleaved Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 35/49] netfilter: nfnetlink_cthelper: Add missing permission checks Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 34/49] xfrm: Fix stack-out-of-bounds read on socket policy lookup Sasha Levin
2018-01-28 22:27 ` [PATCH AUTOSEL for 4.9 36/49] clk: fix a panic error caused by accessing NULL pointer Sasha Levin
2018-01-28 22:27 ` Sasha Levin [this message]
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 38/49] ASoC: rockchip: disable clock on error Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 39/49] spi: sun4i: disable clocks in the remove function Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 40/49] xfrm: Fix stack-out-of-bounds with misconfigured transport mode policies Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 41/49] drm/armada: fix leak of crtc structure Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 42/49] dmaengine: jz4740: disable/unprepare clk if probe fails Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 43/49] usb: dwc3: gadget: Wait longer for controller to end command processing Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 44/49] usb: dwc3: of-simple: fix missing clk_disable_unprepare Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 45/49] mm/early_ioremap: Fix boot hang with earlyprintk=efi,keep Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 46/49] x86/mm/kmmio: Fix mmiotrace for page unaligned addresses Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 48/49] xen: XEN_ACPI_PROCESSOR is Dom0-only Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 47/49] platform/x86: dell-laptop: Fix keyboard max lighting for Dell Latitude E6410 Sasha Levin
2018-01-28 22:28 ` [PATCH AUTOSEL for 4.9 49/49] hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180128222727.22404-37-alexander.levin@microsoft.com \
--to=alexander.levin@microsoft.com \
--cc=cernekee@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®