Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp418265imm; Fri, 10 Aug 2018 13:48:06 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxNhsl2kBbE9s5xT82qY0//TYIEWdfGRh9WBKu5ss3o9BlHfqAblUf8Ih1Y5xuztKGbD/cj X-Received: by 2002:a62:9bc5:: with SMTP id e66-v6mr8546040pfk.84.1533934086368; Fri, 10 Aug 2018 13:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533934086; cv=none; d=google.com; s=arc-20160816; b=tbRu7vU1OvVu9nt6+Vz6DfETbpiterUEbm7/FA20vcrhMblhhSI1XA0tly1Kk6kq2H wDcPEA7qSSjxQ0PHbch5okobnJ3NwenJyna0pxmsTStISzXc9/oRpg0zxUqoU/pN7VhS imd3m/KZp23fWOfzNB+up36PYIyaj5aYcuSihacn2BZ6Vau2+qpwav8t4eGKEB1wWShA R1RtQ0/5v/e4flo73m9dXlwv+jdWpdILhPKrDYPIslvU8kYu7aytAJhSawM97sml7IaV yCCFKndIl3If+OrTpik/E9puM5uAQi1nAjTI24Ap7ayLH0bZjSa2vGlF207kHSxQwH2K 0L7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=f8MqLZr8j8egydhRejH/u5NxsaJ1gbHp3+lA4oY/Xvw=; b=EBL6IGJrsE/fOoYzlFgVbGHcf19QuBFLkGXivDRyZFKd6Bz0f5OV37z5X3VvUJYoLR YtPlDh9ls4ohdTf2RW4SMoHpTH6d4GmJFxZApI2ROU1Yb/XpqgktMOwOum/LERrGJ+uc UV+kmsjs8jSr0Da+V4wozqbRlqwCvJkv3Pbey9olqxBLNwmeTCtk9pxt4GK+PsMPNq83 rcSHWeVBdgOwcHL7QSLiUvy0Pj6sBqhpoS0qysiqvGOZRZOixVWToHbqC+TZTXGEiC+6 bl1YNo1qeqxq4qyhzoy/On4Q7EBp00k5F/9736JiR+Cd7AhiKuAeDb5DK/KmrwtWOyB/ iVEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=I1Cm6FUE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e66-v6si11073939pfk.198.2018.08.10.13.47.51; Fri, 10 Aug 2018 13:48:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=I1Cm6FUE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727395AbeHJXSb (ORCPT + 99 others); Fri, 10 Aug 2018 19:18:31 -0400 Received: from imap.thunk.org ([74.207.234.97]:60686 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727167AbeHJXSb (ORCPT ); Fri, 10 Aug 2018 19:18:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=f8MqLZr8j8egydhRejH/u5NxsaJ1gbHp3+lA4oY/Xvw=; b=I1Cm6FUEm/jW9ZytxJXTtRIASB jlnKKVg5ww1ZDUKYS6bf8EGKZKAljrNxoLvyxFPAWmRvHD0dkvl0MFdtuNltg9YU26c33UNr8PB/L YqGvqq6jtQ5HZs+YIcRHePxyC1FYEk8v1Gz3AttByc0o68iBfPKWMUG1Zou9WnOM1/Q8=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1foEIy-00046p-16; Fri, 10 Aug 2018 20:46:40 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 5A8417A570B; Fri, 10 Aug 2018 16:46:39 -0400 (EDT) Date: Fri, 10 Aug 2018 16:46:39 -0400 From: "Theodore Y. Ts'o" To: Andy Lutomirski Cc: David Howells , "Eric W. Biederman" , Al Viro , John Johansen , Tejun Heo , SELinux-NSA , Paul Moore , Li Zefan , Linux API , apparmor@lists.ubuntu.com, Casey Schaufler , Fenghua Yu , Greg Kroah-Hartman , Eric Biggers , LSM List , Tetsuo Handa , Johannes Weiner , Stephen Smalley , tomoyo-dev-en@lists.sourceforge.jp, "open list:CONTROL GROUP (CGROUP)" , Linus Torvalds , Linux FS Devel , LKML , Miklos Szeredi Subject: Re: BUG: Mount ignores mount options Message-ID: <20180810204639.GI627@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Andy Lutomirski , David Howells , "Eric W. Biederman" , Al Viro , John Johansen , Tejun Heo , SELinux-NSA , Paul Moore , Li Zefan , Linux API , apparmor@lists.ubuntu.com, Casey Schaufler , Fenghua Yu , Greg Kroah-Hartman , Eric Biggers , LSM List , Tetsuo Handa , Johannes Weiner , Stephen Smalley , tomoyo-dev-en@lists.sourceforge.jp, "open list:CONTROL GROUP (CGROUP)" , Linus Torvalds , Linux FS Devel , LKML , Miklos Szeredi References: <20180810153902.GH21087@thunk.org> <87d0uqpba5.fsf@xmission.com> <153313703562.13253.5766498657900728120.stgit@warthog.procyon.org.uk> <22361.1533913891@warthog.procyon.org.uk> <28045.1533916438@warthog.procyon.org.uk> <20180810161400.GA627@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 10, 2018 at 01:06:54PM -0700, Andy Lutomirski wrote: > If the same block device is visible, with rw access, in two different > containers, I don't see any anything good can happen. It's worse than that. I've fixed a lot of bugs which cause the kernel to crash, and a few that might be levered into a privilege escalationh attack, when you mount a maliciously corrupted file system using ext4. I'm told told the security researcher filed similar reports with the XFS community, and he was told, "that's what metadata checksums are for; go away". Given how much time it takes to work with these security researchers, I don't blame them. But in light of that, I'd make a somewhat stronger statement. If you let an untrusted container mount arbitrary block devices where they have rw acccess to the underlying block device, nothing good can happen. Period. :-) Which is why I don't think the lack of being able to reject "conflicting mount options" is really all that important. It certainly shouldn't block the fsopen patch series. #1, it's a problem we have today, and #2, I'm really not all sure supporting bind mounts via specifying block device was ever a good idea to begin with. And #3, while I've been fixing ext4 against security issues caused by maliciously corrupted file system images, I'm still sure that allowing untrusted containers access to mount *any* file system via a block device for which they have r/w access is a Really Bad Idea. > It seems to me that the current approach mostly involves crossing our fingers. Agreed! - Ted