From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933576AbcE3Tue (ORCPT ); Mon, 30 May 2016 15:50:34 -0400 Received: from 8.mo1.mail-out.ovh.net ([178.33.110.239]:48389 "EHLO 8.mo1.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933361AbcE3Tud (ORCPT ); Mon, 30 May 2016 15:50:33 -0400 X-Greylist: delayed 1662 seconds by postgrey-1.27 at vger.kernel.org; Mon, 30 May 2016 15:50:33 EDT From: Nominal Animal Subject: [PATCH 1/1] fs/proc/task_mmu.c: Include backslash when escaping file names To: linux-kernel@vger.kernel.org Message-ID: <574C9986.8090706@nominal-animal.net> Date: Mon, 30 May 2016 22:50:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 11062529536955253527 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekledrheefgddufeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenuc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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