Re: [PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-15 Thread Dr. David Alan Gilbert
* Alexey Dobriyan (adobri...@gmail.com) wrote: > On Sun, Apr 14, 2024 at 01:58:55PM -0700, Luis Chamberlain wrote: > > On Sun, Apr 14, 2024 at 10:05:05PM +0300, Alexey Dobriyan wrote: > > > --- a/include/linux/fs.h > > > +++ b/include/linux/fs.h > > > @@ -3616,4 +3616,12 @@ extern int

Re: [PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-15 Thread Alexey Dobriyan
On Sun, Apr 14, 2024 at 01:58:55PM -0700, Luis Chamberlain wrote: > On Sun, Apr 14, 2024 at 10:05:05PM +0300, Alexey Dobriyan wrote: > > --- a/include/linux/fs.h > > +++ b/include/linux/fs.h > > @@ -3616,4 +3616,12 @@ extern int vfs_fadvise(struct file *file, loff_t > > offset, loff_t len, > >

Re: [PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-15 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig

Re: [PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-14 Thread Matthew Wilcox
On Sun, Apr 14, 2024 at 10:05:05PM +0300, Alexey Dobriyan wrote: > Any other subsystem should use nice helper function aptly named > > string_is_vfs_ready() > > and apply additional restrictions if necessary. > > /proc/modules hints that newlines should be banned too, > and \x1f, and

Re: [PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-14 Thread Luis Chamberlain
On Sun, Apr 14, 2024 at 10:05:05PM +0300, Alexey Dobriyan wrote: > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -3616,4 +3616,12 @@ extern int vfs_fadvise(struct file *file, loff_t > offset, loff_t len, > extern int generic_fadvise(struct file *file, loff_t offset, loff_t len, >

[PATCH] module: ban '.', '..' as module names, ban '/' in module names

2024-04-14 Thread Alexey Dobriyan
As the title says, ban . .. and any name containing '/' as they show in sysfs as directory names: /sys/module/${mod.name} sysfs tries to mangle the name and make '/' into '!' which kind of work but not really. Corrupting simple module to have name '/est' and loading it