From patchwork Wed Dec 2 15:40:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 7748701 Return-Path: X-Original-To: patchwork-selinux@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EA2529F387 for ; Wed, 2 Dec 2015 16:37:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D5A32205B5 for ; Wed, 2 Dec 2015 16:37:09 +0000 (UTC) Received: from emvm-gh1-uea08.nsa.gov (emvm-gh1-uea08.nsa.gov [63.239.67.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11FCC20503 for ; Wed, 2 Dec 2015 16:37:08 +0000 (UTC) X-TM-IMSS-Message-ID: <2386e7d900017ef6@nsa.gov> Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by nsa.gov ([10.208.42.193]) with ESMTP (TREND IMSS SMTP Service 7.1) id 2386e7d900017ef6 ; Wed, 2 Dec 2015 11:35:13 -0500 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id tB2GZ0MY012270; Wed, 2 Dec 2015 11:35:02 -0500 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id tB2FggjM185619 for ; Wed, 2 Dec 2015 10:42:42 -0500 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id tB2FgWlM006648 for ; Wed, 2 Dec 2015 10:42:42 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1CrAAA0EF9WlK7VVdFeGQEBAQEPAQEBAYRMu3CDAoEUhg4CghgBAQEBAQESAQEBAQcLCwkfhGUBAQEDEhUZAQE3AQ9RNAEFARwGARIiiA2hFYExPjGKV4VUAQWMIwEBAQEGAgEaBgqEOoIQiSWFEY4giEGWTIYhi2s2gReCZyOBfFMBhCSBSgEBAQ X-IPAS-Result: A1CrAAA0EF9WlK7VVdFeGQEBAQEPAQEBAYRMu3CDAoEUhg4CghgBAQEBAQESAQEBAQcLCwkfhGUBAQEDEhUZAQE3AQ9RNAEFARwGARIiiA2hFYExPjGKV4VUAQWMIwEBAQEGAgEaBgqEOoIQiSWFEY4giEGWTIYhi2s2gReCZyOBfFMBhCSBSgEBAQ X-IronPort-AV: E=Sophos;i="5.20,373,1444708800"; d="scan'208";a="4986128" Received: from emvm-gh1-uea08.nsa.gov ([10.208.42.193]) by goalie.tycho.ncsc.mil with ESMTP; 02 Dec 2015 10:42:33 -0500 X-TM-IMSS-Message-ID: <2356cebd00015ef8@nsa.gov> Received: from mail-ig0-f174.google.com (mail-ig0-f174.google.com [209.85.213.174]) by nsa.gov ([10.208.42.193]) with ESMTP (TREND IMSS SMTP Service 7.1; TLSv1/SSLv3 AES128-SHA (128/128)) id 2356cebd00015ef8 ; Wed, 2 Dec 2015 10:42:41 -0500 Received: by igbxm8 with SMTP id xm8so35036728igb.1 for ; Wed, 02 Dec 2015 07:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZxVPIgbl0hgdDJtTRCxu8BbBNkKIJXkB80Uioshk3Fs=; b=W8uApuc+XdIPECqRzA5nwM6agJGpLRkjFoodYncAGQn1TmFCq5sXdY30foDs5ahVO2 ZaNsXjzBE6ZDzuyWAaimaT20GwK3IooWCX7iv9KKwnKiscORnpz1k+npjdknUW54VZzY U1yaqWhqeEmDAjbuPxjRu7gGQU7yPDLsCeZYAvPtTDprb35+4QcIZFbRrpvitk5Ta72x kU3CmX5BPZUSPtwA8X37raI7maQLfPXhymE17nPJcFD3CyO2pqUTGYXZnNRnFaWKgxQZ lLZ7YiG3/NbFayiygdb6MQQOMVSD+kwiHFRcFfJvENOlC4xtwfcbu1oHxqbFnMGANvjJ d3Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZxVPIgbl0hgdDJtTRCxu8BbBNkKIJXkB80Uioshk3Fs=; b=aYIBtUUHJBUmIXW1x9CBMsCxsgtFlR0i/ZuvHisfXt3b/UM51dwrAR1jSS6SfjGsyc 249rNX/Jo/P1aeLOvaKck/9QpuiDAM1YMw1Q0Jk3ppd/cZFnCg1fO5WyJeD3z7Xf+BKR LCRgDbBPGVpdj9Ht7KYpXQHxXqGVIpy+ovn82dn5Tlr7GTSgjd7RIskDOBboU6lkZvBi +1eK9mczUOJA0ToKqLgREDc/DJ0ffzNe91+iEDdW4HO8YQMzc1IuTJLdmpyGZXjm+vti rIUY/KNdgOuMyYWZ2tqmKgbAk4dMZVnCno6Tl+oWU0DeHGMELp6nrtbYeqztEyMeZuBz ywfw== X-Gm-Message-State: ALoCoQnn4MKW6fZ0W/kLrcAJJJm3tV5AU1b3rnO7610njGQzHKB4W9esm0NLtwQhxYLqxdX823H+ X-Received: by 10.50.66.231 with SMTP id i7mr4487068igt.55.1449070951602; Wed, 02 Dec 2015 07:42:31 -0800 (PST) Received: from localhost (199-87-125-144.dyn.kc.surewest.net. [199.87.125.144]) by smtp.gmail.com with ESMTPSA id e3sm11450767igx.0.2015.12.02.07.42.31 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 02 Dec 2015 07:42:31 -0800 (PST) From: Seth Forshee To: "Eric W. Biederman" , Alexander Viro Subject: [PATCH 14/19] fs: Permit FIBMAP for users with CAP_SYS_RAWIO in s_user_ns Date: Wed, 2 Dec 2015 09:40:14 -0600 Message-Id: <1449070821-73820-15-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449070821-73820-1-git-send-email-seth.forshee@canonical.com> References: <1449070821-73820-1-git-send-email-seth.forshee@canonical.com> X-TM-AS-MML: disable X-Mailman-Approved-At: Wed, 02 Dec 2015 11:15:49 -0500 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: Serge Hallyn , Seth Forshee , dm-devel@redhat.com, Miklos Szeredi , Richard Weinberger , linux-security-module@vger.kernel.org, linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, fuse-devel@lists.sourceforge.net, Austin S Hemmelgarn , linux-mtd@lists.infradead.org, selinux@tycho.nsa.gov, linux-fsdevel@vger.kernel.org MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Seth Forshee Acked-by: Serge Hallyn --- fs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ioctl.c b/fs/ioctl.c index 5d01d2638ca5..45c371bed7ee 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -55,7 +55,7 @@ static int ioctl_fibmap(struct file *filp, int __user *p) /* do we support this mess? */ if (!mapping->a_ops->bmap) return -EINVAL; - if (!capable(CAP_SYS_RAWIO)) + if (!ns_capable(filp->f_inode->i_sb->s_user_ns, CAP_SYS_RAWIO)) return -EPERM; res = get_user(block, p); if (res)