Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2488819pxb; Mon, 11 Jan 2021 10:53:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzB1Ng+utk7LFFdVRd8byeiHdAgY0+VvmaBnZU7CQfxS5evUAqKpq7AlPyn7p6FljMn1Rbz X-Received: by 2002:a05:6402:1692:: with SMTP id a18mr533059edv.321.1610391201846; Mon, 11 Jan 2021 10:53:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610391201; cv=none; d=google.com; s=arc-20160816; b=vBPzHAp0xYKKiHmEX8KjC7hQOvcBljr5mzDrg5GJs2K478C9leUzebNIhQqBQok1Fl q2cNBeZqTTnr5CjhJz1VKdDXQc69xy075ol6rk3u3i7yROXvkiTh0Ls/wRkWduGoFy4J sSgteXf/rdm/g40eE5UsrTDYMJSihsjpHu7lbzmjKx6UpYmkY/pesxSNJXaP/XUkT5ef SqkdgaCdkb6OoKpxaTP/yB2CR/SoeJp6UROk0pS3noRgpb3u2h2cWoef4JvA7yYyOyRp VXbEHRdQaBjA1+AGpdNBns1fAafz1BaemukF+nD5tvVrfWcVxkakBMSymYo5Q9hTymwN Sn+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SbhuREbiT8CAfSW1TBp3F5IOgukIz3P7viu5LusfC9o=; b=X/4v3KnIrP1R/r7GGz26d+a96ln7X5rUbZ0I1tivLrf229wZUXDS4Xo4hBEfq9bTVL +NVZTQhlNr5f6Ty/6iNZjZPWEajPeX61V2Rf7dyldz55HUCY7dQ3vN3wJ58hYCIuK00x rmWOXxDVe9Zngl8rcLwabxBALlxmykHaky/rkmzlqlWoPPAeq/KMRU9anNXhdbwrEMHy UkZ4VKPdaqo9tXD/n9rBHGfa4RTA0VulplS89bNxbFPvhYlzhB1k2KxBlkaBJc+B24qs QeUlC2k6x3R/9MrSiTrNJfm7BxWGbjYIHcoVXObx79VqqrCIhpesgQ0FXRYqA+J5Ts+8 k5Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eyow4n+T; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t20si265468edw.31.2021.01.11.10.52.54; Mon, 11 Jan 2021 10:53:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eyow4n+T; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390410AbhAKSwC (ORCPT + 99 others); Mon, 11 Jan 2021 13:52:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:42936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730372AbhAKSwC (ORCPT ); Mon, 11 Jan 2021 13:52:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB635223C8; Mon, 11 Jan 2021 18:51:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610391080; bh=GnqAIDT2zbdj2sD4nrMIzONtU2qQ++gboXNZ4jbXnbg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eyow4n+Tm1Qa2vnaxd/nnds4Ey+nUFCfUKSGjaa9gVasDwovgU2xIqhqE9w5W51WP xky64IPEBJ1Ztkpeq+nAAktWRR+yD2ZakEYpA+jHBm0dIKZcrALP27aNOODZnNNpYo 2PKzHhIlQPl9T22U4Evks5d0NXXpeJEcHS37bkvLZnJNREIGkwrF3pr6Z++udcDbsV VDu17uLIMLJIeo5BbX2xVErLNXWWBFC+w3K376Cv+eOVh6IZeG2n04VUYMeR9DHWU5 nMPPtKZFj/8WB9ZqWXX9ZxsLOm4J8XxIN/Apzxe1gvTihQKdrnjQTTdikDVr4oRzGP oucwhJl4Flncg== Date: Mon, 11 Jan 2021 10:51:20 -0800 From: "Darrick J. Wong" To: Pavel Machek Cc: "Theodore Y. Ts'o" , Josh Triplett , "Darrick J. Wong" , Linus Torvalds , Andreas Dilger , Jan Kara , Linux Kernel Mailing List , linux-ext4@vger.kernel.org Subject: Re: Malicious fs images was Re: ext4 regression in v5.9-rc2 from e7bfb5c9bb3d on ro fs with overlapped bitmaps Message-ID: <20210111185120.GA1164237@magnolia> References: <20201006031834.GA5797@mit.edu> <20201006050306.GA8098@localhost> <20201006133533.GC5797@mit.edu> <20201007080304.GB1112@localhost> <20201007143211.GA235506@mit.edu> <20201007201424.GB15049@localhost> <20201008021017.GD235506@mit.edu> <20201008222259.GA45658@localhost> <20201009143732.GJ235506@mit.edu> <20210110184101.GA4625@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210110184101.GA4625@amd> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sun, Jan 10, 2021 at 07:41:02PM +0100, Pavel Machek wrote: > Hi! > > On Fri 2020-10-09 10:37:32, Theodore Y. Ts'o wrote: > > On Thu, Oct 08, 2020 at 03:22:59PM -0700, Josh Triplett wrote: > > > > > > I wasn't trying to make a *new* general principle or policy. I was under > > > the impression that this *was* the policy, because it never occurred to > > > me that it could be otherwise. It seemed like a natural aspect of the > > > kernel/userspace boundary, to the point that the idea of it *not* being > > > part of the kernel's stability guarantees didn't cross my mind. > > > > >From our perspective (and Darrick and I discussed this on this week's > > ext4 video conference, so it represents the ext4 and xfs maintainer's > > position) is that the file system format is different. First, the > > on-disk format is not an ABI, and it is several orders more complex > > than a system call interface. Second, we make no guarantees about > > what the file system created by malicious tools will do. For example, > > XFS developers reject bug reports from file system fuzzers, because My recollection of this is quite different -- sybot was sending multiple zeroday exploits per week to the public xfs list, and nobody at Google was helping us to /fix/ those bugs. Each report took hours of developer time to extract the malicious image (because Dmitry couldn't figure out how to add that ability to syzbot) and syscall sequence from the reproducer program, plus whatever time it took to craft a patch, test it, and push it through review. Dave and I complained to Dmitry about how the community had zero input into the rate at which syzbot was allowed to look for xfs bugs. Nobody at Google would commit to helping fix any of the XFS bugs, and Dmitry would not give us better choices than (a) Google AI continuing to create zerodays and leaving the community to clean up the mess, or (b) shutting off syzbot entirely. At the time I said I would accept letting syzbot run against xfs until it finds something, and turning it off until we resolve the issue. That wasn't acceptable, because (I guess) nobody at Google wants to put /any/ staff time into XFS at all. TLDR: XFS /does/ accept bug reports about fuzzed and broken images. What we don't want is make-work Google AIs spraying zeroday code in public places and the community developers having to clean up the mess. > > the v5 format has CRC checks, so randomly corrupted file systems > > won't > > crash the kernel. Yes, this doesn't protect against maliciously > > created file systems where the attacker makes sure the checksums are > > valid, but only crazy people who think containers are just as secure > > Well, it is not just containers. It is also USB sticks. And people who > believe secure boot is good idea and try to protect kernel against > root. And crazy people who encrypt pointers in dmesg. And... > > People want to use USB sticks from time to time. And while I > understand XFS is so complex it is unsuitable for such use, I'd still > expect bugs to be fixed there. > > I hope VFAT to be safe to mount, because that is very common on USB. > > I also hope ext2/3/4 is safe in that regard. None of them are, that's why you can't mount local filesystems as an unprivileged user by default. At a bare minimum you'd have to audit the fs driver code to make sure it's robust against unexpected metadata; and since filesystems store complex relational data across multiple indices, you end up needing to hoist a full fsck into the mount process. Or retain the current behavior, which is to delegate the trust decision to the sysadmin. It's not just an XFS thing. --D > Anyway it would be nice to have documentation explaining this. If I'm > wrong about VFAT being safe, it would be good to know, and I guess > many will be surprised that XFS is using different rules. > > Best regards, > Pavel > -- > http://www.livejournal.com/~pavelmachek