Bug in mountpoint applet?
Rich Felker
dalias at aerifal.cx
Tue Aug 14 17:33:28 UTC 2012
On Tue, Aug 14, 2012 at 03:51:51PM +0200, Harald Becker wrote:
> Hi Rich !
>
> >What happens when you mount to a pathname containing embedded spaces
> >and newlines?
>
> Ugly thing to have newlines within pathname ... have not tried but
> beside this: Try the grep on /proc/self/mountinfo ... if you find a
> complete match of your path within output of mountinfo you hit a
> mountpoint. Ok, may be you need to extend the regex to check from
> start of a line till end of line. Gives even better result than current
> Busybox mountpoint.
No, the point is that you can have a mountpoint whose name looks like
a whole embedded line in mountinfo for another mount that does not
exist, and trick programs parsing the file. This is a fundamental
design flaw in the kernel that can't be fixed without changing the
format to use a delimiter that won't appear in pathnames (e.g.
multiple consecutive slashes or null bytes).
Rich
More information about the busybox
mailing list