From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751731AbdJFO5J (ORCPT ); Fri, 6 Oct 2017 10:57:09 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:44699 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbdJFO5I (ORCPT ); Fri, 6 Oct 2017 10:57:08 -0400 Date: Fri, 6 Oct 2017 07:57:01 -0700 From: Matthew Wilcox To: Dave Chinner Cc: "J. Bruce Fields" , "Theodore Ts'o" , Adam Borowski , Al Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vfs: hard-ban creating files with control characters in the name Message-ID: <20171006145701.GB18373@bombadil.infradead.org> References: <20171003005042.16470-1-kilobyte@angband.pl> <20171003020724.GH21978@ZenIV.linux.org.uk> <20171003164012.r4qnn5cr5kzmnft6@thunk.org> <20171003173215.axcwmd4ynmvgkyym@angband.pl> <20171003185852.2o7w4tst6q7xchfe@thunk.org> <20171005161619.GA16482@fieldses.org> <20171006020942.GS15067@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171006020942.GS15067@dastard> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 06, 2017 at 01:09:42PM +1100, Dave Chinner wrote: > On Thu, Oct 05, 2017 at 12:16:19PM -0400, J. Bruce Fields wrote: > > This kind of restriction sounds more like a permanent feature of the > > filesystem--something you'd set at mkfs time. > > > > We already have filesystems with these kinds of restrictions, don't we? > > In general, no. Filename storage typically defined in the > filesystem on-disk formats as an opaque string of bytes - the > filesystem has no business parsing them to determine validity of the > bytes. Think encrypted filenames and the like - control characters > in the on-disk format are most definitely necessary and therefore > must be legal. Umm. But filenames still can't have / or \0 in them, so your encryption already has to avoid at least two special characters. I agree with your main point though; there is no advantage to doing this in each individual filesystem.