]> git.ipfire.org Git - thirdparty/man-pages.git/commit - man5/proc.5
proc.5: Describe ambiguities in /proc/<pid>/maps
authorElvira Khabirova <lineprinter@altlinux.org>
Thu, 19 Jul 2018 01:40:04 +0000 (04:40 +0300)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 13 Aug 2018 14:46:07 +0000 (16:46 +0200)
commitb654747951280f8222056e5d382ab7d2a293825a
treec2e69e503fbdb333af4f48184a99e678bb64d320
parent43cc0d8ab174b53aca9d33245e4869127ac71b54
proc.5: Describe ambiguities in /proc/<pid>/maps

Pathname escaping is not done properly in /proc/<pid>/maps;
because of this, different pathnames may appear the same
(verified by experiment and reading the source code).

Further details from Elvira about the relevant location in
the kernel code:

    show_map_vma() from fs/proc/task_mmu.c uses seq_file_path()
    from fs/seq_file.c to print the dentry name, which in turn
    calls seq_path() from the same file.  seq_path() uses
    d_path() from fs/d_path.c to get the path name; this is
    where the " (deleted)" part comes from. This is followed by
    mangling the string with mangle_path() (fs/seq_file.c); this
    function only replaces those characters that were supplied
    in the "esc" argument and does not bother with escaping
    anything else ('\\', for example).  The value of this
    argument comes without modifications from the initial call
    of seq_file_path() by show_map_vma(), and that is "\n".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man5/proc.5