public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] fs/proc/task_mmu.c: Include backslash when escaping file names
@ 2016-05-30 17:58 Nominal Animal
  0 siblings, 0 replies; 2+ messages in thread
From: Nominal Animal @ 2016-05-30 17:58 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] fs/proc/task_mmu.c: Include backslash when escaping file names
@ 2016-05-30 19:50 Nominal Animal
  0 siblings, 0 replies; 2+ messages in thread
From: Nominal Animal @ 2016-05-30 19:50 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-30 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-30 19:50 [PATCH 1/1] fs/proc/task_mmu.c: Include backslash when escaping file names Nominal Animal
  -- strict thread matches above, loose matches on Subject: below --
2016-05-30 17:58 Nominal Animal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox