[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20151117033512.80B0F505@viggo.jf.intel.com>
Date: Mon, 16 Nov 2015 19:35:12 -0800
From: Dave Hansen <dave@...1.net>
To: linux-kernel@...r.kernel.org
Cc: x86@...nel.org, Dave Hansen <dave@...1.net>,
dave.hansen@...ux.intel.com
Subject: [PATCH 01/37] uprobes: dont pass around current->mm
From: Dave Hansen <dave.hansen@...ux.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@...ux.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists