Re: [PATCH] proc: Escape more characters in /proc/mounts output

2020-12-14 Thread Siddhesh Poyarekar
On 12/15/20 11:40 AM, Al Viro wrote: On Tue, Dec 15, 2020 at 09:54:54AM +0530, Siddhesh Poyarekar wrote: + get_user(byte, (const char __user *)data); + + return byte ? strndup_user(data, PATH_MAX) : NULL; } No. Not to mention anything else, you * fetch the same data twi

Re: [PATCH] proc: Escape more characters in /proc/mounts output

2020-12-14 Thread Al Viro
On Tue, Dec 15, 2020 at 09:54:54AM +0530, Siddhesh Poyarekar wrote: > + get_user(byte, (const char __user *)data); > + > + return byte ? strndup_user(data, PATH_MAX) : NULL; > } No. Not to mention anything else, you * fetch the same data twice * fail to check the get_use

[PATCH] proc: Escape more characters in /proc/mounts output

2020-12-14 Thread Siddhesh Poyarekar
When a filesystem is mounted with a blank name like so: # mount '' bad -t tmpfs its name entry in /proc/mounts is blank causing the line to start with a space. /mnt/bad tmpfs rw,seclabel,relatime,inode64 0 0 Further, the name could start with a hash, causing the entry to look like this (leadi