All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nominal Animal <kernel@nominal-animal.net>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] fs/proc/task_mmu.c: Include backslash when escaping file names
Date: Mon, 30 May 2016 22:50:30 +0300	[thread overview]
Message-ID: <574C9986.8090706@nominal-animal.net> (raw)

Files named "foo\nbar" and "foo\\012bar" are
both shown as "foo\\012bar" in /proc/PID files,
because show_map_vma() and show_numa_map() in fs/proc/task_mmu.c
do not include backslash in the escaped set when calling seq_file_path().
Fix this by including backslash in the escaped set.

diff -Nabpur linux-4.6/fs/proc/task_mmu.c linux-new/fs/proc/task_mmu.c
--- linux-4.6/fs/proc/task_mmu.c	2016-05-16 01:43:13.000000000 +0300
+++ linux-new/fs/proc/task_mmu.c	2016-05-30 19:55:42.247297498 +0300
@@ -329,7 +329,7 @@ show_map_vma(struct seq_file *m, struct
 	 */
 	if (file) {
 		seq_pad(m, ' ');
-		seq_file_path(m, file, "\n");
+		seq_file_path(m, file, "\n\\");
 		goto done;
 	}

@@ -1647,7 +1647,7 @@ static int show_numa_map(struct seq_file

 	if (file) {
 		seq_puts(m, " file=");
-		seq_file_path(m, file, "\n\t= ");
+		seq_file_path(m, file, "\n\t= \\");
 	} else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) {
 		seq_puts(m, " heap");
 	} else if (is_stack(proc_priv, vma, is_pid)) {

Regards,
  Nominal Animal

             reply	other threads:[~2016-05-30 19:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30 19:50 Nominal Animal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-05-30 17:58 [PATCH 1/1] fs/proc/task_mmu.c: Include backslash when escaping file names Nominal Animal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=574C9986.8090706@nominal-animal.net \
    --to=kernel@nominal-animal.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.