Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932081AbcCJSd6 (ORCPT ); Thu, 10 Mar 2016 13:33:58 -0500 Received: from mail-ig0-f194.google.com ([209.85.213.194]:35419 "EHLO mail-ig0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754028AbcCJSdu (ORCPT ); Thu, 10 Mar 2016 13:33:50 -0500 MIME-Version: 1.0 In-Reply-To: <56E18B9B.5070503@gmail.com> References: <20160302040947.16685.42926.stgit@birch.djwong.org> <20160302225601.GB21890@birch.djwong.org> <20160303180924.GA4116@infradead.org> <20160303223952.GE24012@thunk.org> <20160303231050.GU29057@dastard> <20160309230819.GB3949@thunk.org> <56E18B9B.5070503@gmail.com> Date: Thu, 10 Mar 2016 10:33:49 -0800 X-Google-Sender-Auth: QYk46wrZV0G3pe7jYkRWJF7Qm5o Message-ID: Subject: Re: [PATCH 2/2] block: create ioctl to discard-or-zeroout a range of blocks From: Linus Torvalds To: Ric Wheeler Cc: "Theodore Ts'o" , Gregory Farnum , Dave Chinner , "Martin K. Petersen" , Christoph Hellwig , "Darrick J. Wong" , Jens Axboe , Andrew Morton , Linux API , Linux Kernel Mailing List , shane.seymour@hpe.com, Bruce Fields , linux-fsdevel , Jeff Layton , Eric Sandeen Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1060 Lines: 23 On Thu, Mar 10, 2016 at 6:58 AM, Ric Wheeler wrote: > > What was objectionable at the time this patch was raised years back (not > just to me, but to pretty much every fs developer at LSF/MM that year) > centered on the concern that this would be viewed as a "performance" mode > and we get pressure to support this for non-priveleged users. It gives any > user effectively the ability to read the block device content for previously > allocated data without restriction. The sane way to do it would be to just check permissions of the underlying block device. That way, people can just set the permissions for that to whatever they want. If google right now uses some magical group for this, they could make the underlying block device be writable for that group. We can do the security check at the filesystem level, because we have sb->s_bdev->bd_inode, and if you have read and write permissions to that inode, you might as well have permission to create a unsafe hole. That doesn't sound very hacky to me. Linus