Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1625682imm; Wed, 23 May 2018 20:58:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqHISHOagvQ1hKn/+KPBtefTFXuMkwAwtTQ0vha10WH6mG35zv/C0dKj+NRiLEvif20rptq X-Received: by 2002:a62:e04c:: with SMTP id f73-v6mr5543717pfh.88.1527134283719; Wed, 23 May 2018 20:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527134283; cv=none; d=google.com; s=arc-20160816; b=q0u2hTDhLF6VigZBhTalDrWaP1bbJxH52o1pcV1E1bapKif1Y0kuzoRoM/ZQZBaYLB csDtJfpeIpUQVr4Nq/oaXzxF5SdA7HNrSHyN2iYrAUaOttpa3fGY7/9wz2tmNSbofeEO TUpFrBYVtY+kH0BrS6Ge0T3rDItwO8H+G0dBu390AHZAAgsQ4mE7r/7hW5FSHhG2Mzkv 0ue0p7m3zmilpcTbE/lUbRZmHhCDbSRGLB9pp9plgOhyRPwBB3PfYBuzqWVagg9B8UMu 7xxIqiS1jBU9g5TClevosExsO9vwbAJ2PXSLM3TonOnpgHJNJAkZ/RQmGPlWsy/xXmaM ahDw== 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:message-id:subject:to :from:date:arc-authentication-results; bh=5/QPFpxxiGYbThPiegpJyd7zcgDbqbJuEDjiqwfRWS4=; b=fdYJdGe672Nxs5xDsolhsInptonYiH41Eh20m0ZTM/XpEHhUgzcWweCe6VzzgILuWC cTen55LBuwrRsp/wX6RSSNNeEbfNOX2c4KCOBImxRT9+1a+u8V16L6dApaL0nM0CbNft FH81M7VlYdr/NbTvzWO+a/AxnbqTmNvbvJRKJ708h4Z7EHWDpljRUiCrpKELB9yR3txm dCcOkdztyJyB2Db357It8wdhF9ao8lX7bDMDmZ6id5dazivnlLXb+xZDZsevrdKkl4YB WorxDKm/NAG5cmyqZjA0xn54pm/Y8imfBr1RnbG8C6ysOvApO+zTltiFBfI3bGb6iuwv +D6g== ARC-Authentication-Results: i=1; mx.google.com; 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 a68-v6si21035393pli.158.2018.05.23.20.57.33; Wed, 23 May 2018 20:58:03 -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; 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 S935502AbeEXDzh (ORCPT + 99 others); Wed, 23 May 2018 23:55:37 -0400 Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:31543 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935171AbeEXDzg (ORCPT ); Wed, 23 May 2018 23:55:36 -0400 Received: from ppp59-167-129-252.static.internode.on.net (HELO dastard) ([59.167.129.252]) by ipmail06.adl6.internode.on.net with ESMTP; 24 May 2018 13:25:34 +0930 Received: from dave by dastard with local (Exim 4.80) (envelope-from ) id 1fLhLg-0000zo-D6; Thu, 24 May 2018 13:55:32 +1000 Date: Thu, 24 May 2018 13:55:32 +1000 From: Dave Chinner To: "Theodore Y. Ts'o" , Eric Sandeen , Eric Biggers , "Darrick J. Wong" , Brian Foster , linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: Bugs involving maliciously crafted file system Message-ID: <20180524035532.GC23861@dastard> References: <000000000000457b2d056cbb0044@google.com> <20180522123107.GC3751@bfoster.bfoster> <20180522222620.GW23861@dastard> <20180522225208.GB658@sol.localdomain> <20180523074425.GM14384@magnolia> <20180523162015.GA3684@sol.localdomain> <20180523234114.GA3434@thunk.org> <20180524004931.GB23861@dastard> <20180524005906.GC3434@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180524005906.GC3434@thunk.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 23, 2018 at 08:59:06PM -0400, Theodore Y. Ts'o wrote: > On Thu, May 24, 2018 at 10:49:31AM +1000, Dave Chinner wrote: > > > > We've learnt this lesson the hard way over and over again: don't > > parse untrusted input in privileged contexts. How many times do we > > have to make the same mistakes before people start to learn from > > them? > > Good question. For how many years (or is it decades, now) has Fedora > auto-mounted USB sticks? :-) Let me know when you successfully get > Fedora to turn of a feature which appears to have great user appeal. They'll do that when we provide them with a safe, easy to use solution to the problem. This is our problem to solve, not blame-shift it away. > And I'll note that Eric Beiderman just posted a patch series allowing > unprivileged processes to mount file systems in containers. Yup, that's to make it easy for virtual kernel filesystems to be mounted inside containers, and to solve some of FUSEs security issues caused by needing root permissions to mount FUSE filesystems. Enabling unprivileged mounts requires an opt-in flag in the filesystem fs-type definition, and we most certainly won't be setting that flag on XFS. I also doubt it will ever get set on any other existing block device based filesystem because of the trust model problems it exposes. > And remember the mantra which the containner people keep chanting. > Containers are just as secure as VM's. Hahahaha..... So your solution is to have VM guests and container users spin up sandboxed VMs to access filesystem images safely? That's not really a practical solution. :/ > > User automounting of removable storage should be done via a > > privilege separation mechanism and hence avoid this whole class of > > security problems. We can get this separation by using FUSE in these > > situations, right? > > FUSE is a pretty terrible security boundary. That may be true, but it's so much better than using the kernel to parse untrusted filesystem metadata. > And not all file systems > have FUSE support. Except there is now fusefs-lkl, so all kernel filesystem are fully accessible through FUSE. > > Bugs don't have to be exploitable to be a "security issue". Detected > > filesystem corruptions on a errors=panic mount, or undetected > > problems that cause a x/NULL deref are still a user-triggerable > > kernel crash (i.e. a DOS) and therefore considered a security > > problem. > > I disagree here. I think it's worth it to disambiguate the two. Been trying to get security people to understand this for years. I've given up because there's always some new security person who follows The Process and simply does not understand that there is a difference. Cheers, Dave. -- Dave Chinner david@fromorbit.com