lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTimcvVyLRBQbCmePLrrNyC01KBHIpZ873hXQcYf4@mail.gmail.com>
Date:	Wed, 9 Jun 2010 15:53:13 +0300
From:	Pekka Enberg <penberg@...helsinki.fi>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	mingo@...hat.com, hpa@...or.com, anton@...ba.org, acme@...hat.com,
	paulus@...ba.org, linux-kernel@...r.kernel.org, efault@....de,
	fweisbec@...il.com, ebmunson@...ibm.com, rostedt@...dmis.org,
	tglx@...utronix.de, mingo@...e.hu,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/core] perf: Add non-exec mmap() tracking

On Wed, Jun 9, 2010 at 3:22 PM, Peter Zijlstra <peterz@...radead.org> wrote:
> On Wed, 2010-06-09 at 13:44 +0300, Pekka Enberg wrote:
>> > @@ -3830,6 +3834,14 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
>> >                if (!vma->vm_mm) {
>> >                        name = strncpy(tmp, "[vdso]", sizeof(tmp));
>> >                        goto got_name;
>> > +               } else if (vma->vm_start <= vma->vm_mm->start_brk &&
>> > +                               vma->vm_end >= vma->vm_mm->brk) {
>> > +                       name = strncpy(tmp, "[heap]", sizeof(tmp));
>> > +                       goto got_name;
>> > +               } else if (vma->vm_start <= vma->vm_mm->start_stack &&
>> > +                               vma->vm_end >= vma->vm_mm->start_stack) {
>> > +                       name = strncpy(tmp, "[stack]", sizeof(tmp));
>> > +                       goto got_name;
>> >                }
>> >
>> >                name = strncpy(tmp, "//anon", sizeof(tmp));
>>
>> Doesn't this change here break the JIT generated code region detection
>> in map__new() of tools/perf/util/map.c? We generate a new
>> "/tmp/perf-<pid>.map" filename for anonymous memory regions and check
>> for that in dso__load() of tools/perf/util/symbol.c.
>
> Not unless you stick your executable code in the heap or on the stack.

Right, I misread the patch. Thanks for the clarification, Peter!

> If you use something like mmap(NULL, size, PROT_READ|PROT_WRITE|
> PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); to allocate your memory
> everything should be fine.

Sure, that's what I do.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ