This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug uprobes/10595] uprobe probes causes selinux failures
- From: "mjw at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 3 Sep 2009 20:13:24 -0000
- Subject: [Bug uprobes/10595] uprobe probes causes selinux failures
- References: <20090903122458.10595.mjw@redhat.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From mjw at redhat dot com 2009-09-03 20:13 -------
Roland made the observation that a private mapping of a file as executable is
allowed and that you can create one through shmem_file_setup (which has as an
extra benefit that /proc/<pid>/maps shows the mapping as /uprobes/ssol). That
seems to work.
Currently testing this patch:
diff --git a/runtime/uprobes2/uprobes.c b/runtime/uprobes2/uprobes.c
index 07ad398..195a79b 100644
--- a/runtime/uprobes2/uprobes.c
+++ b/runtime/uprobes2/uprobes.c
@@ -1387,6 +1387,7 @@ static noinline unsigned long
uprobe_setup_ssol_vma(unsigned long nbytes)
unsigned long addr;
struct mm_struct *mm;
struct vm_area_struct *vma;
+ struct file *file;
BUG_ON(nbytes & ~PAGE_MASK);
if ((addr = find_old_ssol_vma()) != 0)
@@ -1403,8 +1404,8 @@ static noinline unsigned long
uprobe_setup_ssol_vma(unsigned long nbytes)
*/
vma = rb_entry(rb_last(&mm->mm_rb), struct vm_area_struct, vm_rb);
addr = vma->vm_end + PAGE_SIZE;
- addr = do_mmap_pgoff(NULL, addr, nbytes, PROT_EXEC,
- MAP_PRIVATE|MAP_ANONYMOUS, 0);
+ file = shmem_file_setup("uprobes/ssol", nbytes, VM_NORESERVE);
+ addr = do_mmap_pgoff(file, addr, nbytes, PROT_EXEC, MAP_PRIVATE, 0);
if (addr & ~PAGE_MASK) {
up_write(&mm->mmap_sem);
mmput(mm);
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10595
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.