public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] proc: Report file name on detected read_proc overflow
@ 2010-04-01 13:09 Jan Kiszka
  2010-04-01 14:41 ` Frans Pop
  2010-04-02  6:28 ` [PATCH] " Alexey Dobriyan
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Kiszka @ 2010-04-01 13:09 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Andrew Morton, Alexey Dobriyan, Helight.Xu, Al Viro

This can help identifying the buggy read_proc handler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 fs/proc/generic.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 08f4d71..cc7e671 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -132,7 +132,9 @@ __proc_file_read(struct file *file, char __user *buf, size_t nbytes,
 		if (start == NULL) {
 			if (n > PAGE_SIZE) {
 				printk(KERN_ERR
-				       "proc_file_read: Apparent buffer overflow!\n");
+				       "proc_file_read: Apparent buffer "
+				       "overflow reading \"%s\"!\n",
+				       file->f_path.dentry->d_name.name);
 				n = PAGE_SIZE;
 			}
 			n -= *ppos;
@@ -144,7 +146,9 @@ __proc_file_read(struct file *file, char __user *buf, size_t nbytes,
 		} else if (start < page) {
 			if (n > PAGE_SIZE) {
 				printk(KERN_ERR
-				       "proc_file_read: Apparent buffer overflow!\n");
+				       "proc_file_read: Apparent buffer "
+				       "overflow reading \"%s\"!\n",
+				       file->f_path.dentry->d_name.name);
 				n = PAGE_SIZE;
 			}
 			if (n > count) {
@@ -159,7 +163,9 @@ __proc_file_read(struct file *file, char __user *buf, size_t nbytes,
 			unsigned long startoff = (unsigned long)(start - page);
 			if (n > (PAGE_SIZE - startoff)) {
 				printk(KERN_ERR
-				       "proc_file_read: Apparent buffer overflow!\n");
+				       "proc_file_read: Apparent buffer "
+				       "overflow reading \"%s\"!\n",
+				       file->f_path.dentry->d_name.name);
 				n = PAGE_SIZE - startoff;
 			}
 			if (n > count)


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

end of thread, other threads:[~2010-04-06 16:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-01 13:09 [PATCH] proc: Report file name on detected read_proc overflow Jan Kiszka
2010-04-01 14:41 ` Frans Pop
2010-04-01 16:16   ` [PATCH v2] " Jan Kiszka
2010-04-02  6:28 ` [PATCH] " Alexey Dobriyan
2010-04-06 16:48   ` Jan Kiszka

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