Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-08 Thread Dave Chinner
On Fri, Oct 06, 2017 at 07:57:01AM -0700, Matthew Wilcox wrote: > 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 > > >

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-08 Thread Dave Chinner
On Fri, Oct 06, 2017 at 07:57:01AM -0700, Matthew Wilcox wrote: > 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 > > >

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-06 Thread Theodore Ts'o
On Fri, Oct 06, 2017 at 07:57:01AM -0700, Matthew Wilcox wrote: > > 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

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-06 Thread Theodore Ts'o
On Fri, Oct 06, 2017 at 07:57:01AM -0700, Matthew Wilcox wrote: > > 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

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-06 Thread Matthew Wilcox
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

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-06 Thread Matthew Wilcox
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

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-06 Thread Matthew Wilcox
On Thu, Oct 05, 2017 at 12:07:57PM +0200, Olivier Galibert wrote: > On Tue, Oct 3, 2017 at 5:22 AM, Adam Borowski wrote: > > Well, what about just \n then? Unlike all the others which are relatively > > straightforward, \n requires -print0 which not all programs implement,

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-06 Thread Matthew Wilcox
On Thu, Oct 05, 2017 at 12:07:57PM +0200, Olivier Galibert wrote: > On Tue, Oct 3, 2017 at 5:22 AM, Adam Borowski wrote: > > Well, what about just \n then? Unlike all the others which are relatively > > straightforward, \n requires -print0 which not all programs implement, and > > way too many

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-06 Thread J. Bruce Fields
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

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-06 Thread J. Bruce Fields
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

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-05 Thread Dave Chinner
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

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-05 Thread Dave Chinner
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

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-05 Thread J. Bruce Fields
On Tue, Oct 03, 2017 at 02:58:52PM -0400, Theodore Ts'o wrote: > The argument for making it be configurable is that if it does break > things in way we can't foresee, it's a lot easier to back it out. And > like what we've done with relatime, if the distro's all run with it as > the default for a

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-05 Thread J. Bruce Fields
On Tue, Oct 03, 2017 at 02:58:52PM -0400, Theodore Ts'o wrote: > The argument for making it be configurable is that if it does break > things in way we can't foresee, it's a lot easier to back it out. And > like what we've done with relatime, if the distro's all run with it as > the default for a

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-05 Thread Alan Cox
> For malformed Unicode or such, it'd make sense, yeah. Not really. It's legitimate to have bad unicode in a directory, or have a file system where some users are still in 8bit Russian encoding and some are unicode for example. The fix for this has always been the same - don't use shell script

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-05 Thread Alan Cox
> For malformed Unicode or such, it'd make sense, yeah. Not really. It's legitimate to have bad unicode in a directory, or have a file system where some users are still in 8bit Russian encoding and some are unicode for example. The fix for this has always been the same - don't use shell script

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-05 Thread Alexey Dobriyan
> Anything with bytes 1-31,127 will get -EACCES. You're making a mistake of catering to Unix shells which are pure garbage as programming languages instead of fixing them or switching to saner alternatives and then "fixing" kernel to sort-of workaround Unix shells deficiencies. Formally, you

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-05 Thread Alexey Dobriyan
> Anything with bytes 1-31,127 will get -EACCES. You're making a mistake of catering to Unix shells which are pure garbage as programming languages instead of fixing them or switching to saner alternatives and then "fixing" kernel to sort-of workaround Unix shells deficiencies. Formally, you

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-05 Thread Olivier Galibert
On Tue, Oct 3, 2017 at 5:22 AM, Adam Borowski wrote: > Well, what about just \n then? Unlike all the others which are relatively > straightforward, \n requires -print0 which not all programs implement, and > way too many people consider too burdensome to use. If you don't

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-05 Thread Olivier Galibert
On Tue, Oct 3, 2017 at 5:22 AM, Adam Borowski wrote: > Well, what about just \n then? Unlike all the others which are relatively > straightforward, \n requires -print0 which not all programs implement, and > way too many people consider too burdensome to use. If you don't use -print0, you're

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-03 Thread Casey Schaufler
On 10/3/2017 11:58 AM, Theodore Ts'o wrote: > On Tue, Oct 03, 2017 at 07:32:15PM +0200, Adam Borowski wrote: >> But Al has a good point that if most people were protected, they won't >> bother escaping badness anymore -- leaving those whose systems allow control >> chars vulnerable if they run a

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-03 Thread Casey Schaufler
On 10/3/2017 11:58 AM, Theodore Ts'o wrote: > On Tue, Oct 03, 2017 at 07:32:15PM +0200, Adam Borowski wrote: >> But Al has a good point that if most people were protected, they won't >> bother escaping badness anymore -- leaving those whose systems allow control >> chars vulnerable if they run a

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-03 Thread Theodore Ts'o
On Tue, Oct 03, 2017 at 07:32:15PM +0200, Adam Borowski wrote: > > But Al has a good point that if most people were protected, they won't > bother escaping badness anymore -- leaving those whose systems allow control > chars vulnerable if they run a script that doesn't do quoting. If we look at

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-03 Thread Theodore Ts'o
On Tue, Oct 03, 2017 at 07:32:15PM +0200, Adam Borowski wrote: > > But Al has a good point that if most people were protected, they won't > bother escaping badness anymore -- leaving those whose systems allow control > chars vulnerable if they run a script that doesn't do quoting. If we look at

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-03 Thread Adam Borowski
On Tue, Oct 03, 2017 at 12:40:12PM -0400, Theodore Ts'o wrote: > On Tue, Oct 03, 2017 at 03:07:24AM +0100, Al Viro wrote: > > That essay is full of shit, and you've even mentioned parts of that just > > above... > > NAK; you'd _still_ need proper quoting (or a shell with something > > resembling

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-03 Thread Adam Borowski
On Tue, Oct 03, 2017 at 12:40:12PM -0400, Theodore Ts'o wrote: > On Tue, Oct 03, 2017 at 03:07:24AM +0100, Al Viro wrote: > > That essay is full of shit, and you've even mentioned parts of that just > > above... > > NAK; you'd _still_ need proper quoting (or a shell with something > > resembling

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-03 Thread Theodore Ts'o
On Tue, Oct 03, 2017 at 03:07:24AM +0100, Al Viro wrote: > That essay is full of shit, and you've even mentioned parts of that just > above... > NAK; you'd _still_ need proper quoting (or a shell with something resembling > an > actual syntax, rather than the "more or less what srb had ended up

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-03 Thread Theodore Ts'o
On Tue, Oct 03, 2017 at 03:07:24AM +0100, Al Viro wrote: > That essay is full of shit, and you've even mentioned parts of that just > above... > NAK; you'd _still_ need proper quoting (or a shell with something resembling > an > actual syntax, rather than the "more or less what srb had ended up

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-02 Thread Adam Borowski
On Tue, Oct 03, 2017 at 03:07:24AM +0100, Al Viro wrote: > On Tue, Oct 03, 2017 at 02:50:42AM +0200, Adam Borowski wrote: > > Anything with bytes 1-31,127 will get -EACCES. > > > > Especially \n is bad: instead of natural file-per-line, you need an > > user-unfriendly feature of -print0 added to

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-02 Thread Adam Borowski
On Tue, Oct 03, 2017 at 03:07:24AM +0100, Al Viro wrote: > On Tue, Oct 03, 2017 at 02:50:42AM +0200, Adam Borowski wrote: > > Anything with bytes 1-31,127 will get -EACCES. > > > > Especially \n is bad: instead of natural file-per-line, you need an > > user-unfriendly feature of -print0 added to

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-02 Thread Al Viro
On Tue, Oct 03, 2017 at 02:50:42AM +0200, Adam Borowski wrote: > Anything with bytes 1-31,127 will get -EACCES. > > Especially \n is bad: instead of natural file-per-line, you need an > user-unfriendly feature of -print0 added to every producer and consumer; > a good part of users either don't

Re: [PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-02 Thread Al Viro
On Tue, Oct 03, 2017 at 02:50:42AM +0200, Adam Borowski wrote: > Anything with bytes 1-31,127 will get -EACCES. > > Especially \n is bad: instead of natural file-per-line, you need an > user-unfriendly feature of -print0 added to every producer and consumer; > a good part of users either don't

[PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-02 Thread Adam Borowski
Anything with bytes 1-31,127 will get -EACCES. Especially \n is bad: instead of natural file-per-line, you need an user-unfriendly feature of -print0 added to every producer and consumer; a good part of users either don't know or don't feel the need to bother with escaping this snowflake, thus

[PATCH] vfs: hard-ban creating files with control characters in the name

2017-10-02 Thread Adam Borowski
Anything with bytes 1-31,127 will get -EACCES. Especially \n is bad: instead of natural file-per-line, you need an user-unfriendly feature of -print0 added to every producer and consumer; a good part of users either don't know or don't feel the need to bother with escaping this snowflake, thus