From: Oleg Nesterov <oleg@redhat.com>
To: Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Anton Arapov <anton@redhat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/6] uprobes: no need to re-check vma_address() in write_opcode()
Date: Wed, 13 Jun 2012 20:50:30 +0200 [thread overview]
Message-ID: <20120613185030.GC13878@redhat.com> (raw)
In-Reply-To: <20120613184933.GA13870@redhat.com>
write_opcode() is called by register_for_each_vma() and uprobe_mmap()
paths. In both cases the caller has already verified this vaddr under
mmap_sem, no need to re-check.
Note also that this check is wrong anyway, we should not truncate
loff_t returned by vma_address() if we do not trust this mapping.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
kernel/events/uprobes.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 9bb5571..799d6ed 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -211,7 +211,6 @@ static int write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm,
struct vm_area_struct *vma;
struct uprobe *uprobe;
unsigned long pgoff;
- loff_t addr;
int ret;
retry:
/* Read the page with vaddr into memory */
@@ -235,10 +234,6 @@ retry:
if (mapping != vma->vm_file->f_mapping)
goto put_out;
- addr = vma_address(vma, uprobe->offset);
- if (vaddr != (unsigned long)addr)
- goto put_out;
-
ret = -ENOMEM;
new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, vaddr);
if (!new_page)
--
1.5.5.1
next prev parent reply other threads:[~2012-06-13 18:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-13 18:49 [PATCH 0/6] uprobes: misc cleanups Oleg Nesterov
2012-06-13 18:49 ` [PATCH 1/6] uprobes: copy_insn() shouldn't depend on mm/vma/vaddr Oleg Nesterov
2012-06-13 18:50 ` [PATCH 2/6] uprobes: copy_insn() should not return -ENOMEM if __copy_insn() fails Oleg Nesterov
2012-06-13 18:50 ` Oleg Nesterov [this message]
2012-06-13 18:50 ` [PATCH 4/6] uprobes: move BUG_ON(UPROBE_SWBP_INSN_SIZE) from write_opcode() to install_breakpoint() Oleg Nesterov
2012-06-13 18:51 ` [PATCH 5/6] uprobes: don't use loff_t for the valid virtual address Oleg Nesterov
2012-06-14 5:24 ` Ananth N Mavinakayanahalli
2012-06-14 8:38 ` Ingo Molnar
2012-06-14 8:43 ` Ananth N Mavinakayanahalli
2012-06-14 10:58 ` Anton Arapov
2012-06-14 11:05 ` [PATCH v2 " Anton Arapov
2012-06-14 17:39 ` [PATCH " Oleg Nesterov
2012-06-13 18:51 ` [PATCH 6/6] uprobes: __copy_insn() needs "loff_t offset" Oleg Nesterov
2012-06-14 5:25 ` [PATCH 0/6] uprobes: misc cleanups Ananth N Mavinakayanahalli
2012-06-14 14:54 ` Srikar Dronamraju
2012-06-14 17:44 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120613185030.GC13878@redhat.com \
--to=oleg@redhat.com \
--cc=ananth@in.ibm.com \
--cc=anton@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=srikar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox