[PATCH] proc: fix /proc/*/pagemap some more

From: Alexey Dobriyan
Date: Wed Jul 16 2008 - 12:02:40 EST


On Wed, Jul 16, 2008 at 07:36:28PM +0400, Alexey Dobriyan wrote:
> On Wed, Jul 16, 2008 at 05:20:25PM +0200, Eric Sesterhenn wrote:
> > with current -git a "cat /proc/4260/pagemap"
> > gives me the following oops:
>
> reproduced

Oh, wow!

[PATCH] proc: fix /proc/*/pagemap some more

struct pagemap_walk was placed on stack, some hooks are initialized, the rest
(->pgd_entry, ->pud_entry, ->pte_entry) are valid but junk.

Reported by Eric Sesterhenn.

Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---

fs/proc/task_mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -636,7 +636,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
struct pagemapread pm;
int pagecount;
int ret = -ESRCH;
- struct mm_walk pagemap_walk;
+ struct mm_walk pagemap_walk = {};
unsigned long src;
unsigned long svpfn;
unsigned long start_vaddr;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/