Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270809

[PATCH 01/37] uprobes: dont pass around current->mm

From Dave Hansen <dave@sr71.net>
Newsgroups linux.kernel
Subject [PATCH 01/37] uprobes: dont pass around current->mm
Date 2015-11-17 04:40 +0100
Message-ID <qvFhF-7YL-43@gated-at.bofh.it> (permalink)
References <qvFhE-7YL-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Dave Hansen <dave.hansen@linux.intel.com>

It doesn't make a whole lot of sense to pass around 'mm' when
there is only one call path and that path passes current->mm in
all sitautions.

Remove 'mm' from one such path in uprobes.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

 b/kernel/events/uprobes.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN kernel/events/uprobes.c~uprobes-dont-pass-around-current-mm kernel/events/uprobes.c
--- a/kernel/events/uprobes.c~uprobes-dont-pass-around-current-mm	2015-11-16 12:35:34.870150592 -0800
+++ b/kernel/events/uprobes.c	2015-11-16 12:35:34.874150773 -0800
@@ -1685,7 +1685,7 @@ static void mmf_recalc_uprobes(struct mm
 	clear_bit(MMF_HAS_UPROBES, &mm->flags);
 }
 
-static int is_trap_at_addr(struct mm_struct *mm, unsigned long vaddr)
+static int is_trap_at_addr(unsigned long vaddr)
 {
 	struct page *page;
 	uprobe_opcode_t opcode;
@@ -1699,7 +1699,7 @@ static int is_trap_at_addr(struct mm_str
 	if (likely(result == 0))
 		goto out;
 
-	result = get_user_pages(NULL, mm, vaddr, 1, 0, 1, &page, NULL);
+	result = get_user_pages(NULL, current->mm, vaddr, 1, 0, 1, &page, NULL);
 	if (result < 0)
 		return result;
 
@@ -1727,7 +1727,7 @@ static struct uprobe *find_active_uprobe
 		}
 
 		if (!uprobe)
-			*is_swbp = is_trap_at_addr(mm, bp_vaddr);
+			*is_swbp = is_trap_at_addr(bp_vaddr);
 	} else {
 		*is_swbp = -EFAULT;
 	}
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 01/37] uprobes: dont pass around current->mm Dave Hansen <dave@sr71.net> - 2015-11-17 04:40 +0100

csiph-web