All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] uprobes: Fix the wrong usage of current->utask in uprobe_copy_process()
@ 2013-11-08 15:57 Oleg Nesterov
  2013-11-08 15:57 ` [PATCH 1/1] " Oleg Nesterov
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2013-11-08 15:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Anton Arapov, David Smith, Frank Ch. Eigler, Srikar Dronamraju,
	linux-kernel

Ingo,

I am stupid. aa59c53fd459 "uprobes: Change uprobe_copy_process()
to dup xol_area" needs the trivial fix, see 1/1. Sorry.

Perhaps I should add this patch to my tree and ask you to pull
this one-liner? Probably I can also add another "uprobes: Fix
the memory out of bound overwrite in copy_insn()" fix I sent
yesterday...

Oleg.


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

* [PATCH 1/1] uprobes: Fix the wrong usage of current->utask in uprobe_copy_process()
  2013-11-08 15:57 [PATCH 0/1] uprobes: Fix the wrong usage of current->utask in uprobe_copy_process() Oleg Nesterov
@ 2013-11-08 15:57 ` Oleg Nesterov
  0 siblings, 0 replies; 2+ messages in thread
From: Oleg Nesterov @ 2013-11-08 15:57 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Anton Arapov, David Smith, Frank Ch. Eigler, Srikar Dronamraju,
	linux-kernel

Commit aa59c53fd459 "uprobes: Change uprobe_copy_process() to dup
xol_area" has a stupid typo, we need to setup t->utask->vaddr but
the code wrongly uses current->utask.

Even with this bug dup_xol_work() works "in practice", but only
because get_unmapped_area(NULL, TASK_SIZE - PAGE_SIZE) likely
returns the same address every time.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 kernel/events/uprobes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 26fdd65..847201f 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1446,7 +1446,7 @@ void uprobe_copy_process(struct task_struct *t, unsigned long flags)
 	if (!work)
 		return uprobe_warn(t, "dup xol area");
 
-	utask->vaddr = area->vaddr;
+	t->utask->vaddr = area->vaddr;
 	init_task_work(work, dup_xol_work);
 	task_work_add(t, work, true);
 }
-- 
1.5.5.1



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

end of thread, other threads:[~2013-11-08 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08 15:57 [PATCH 0/1] uprobes: Fix the wrong usage of current->utask in uprobe_copy_process() Oleg Nesterov
2013-11-08 15:57 ` [PATCH 1/1] " Oleg Nesterov

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.