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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 19 Nov 2008 20:20:52 +0100
From:	"stephane eranian" <eranian@...glemail.com>
To:	"Markus Metzger" <markus.t.metzger@...glemail.com>
Cc:	"Metzger, Markus T" <markus.t.metzger@...el.com>,
	"Ingo Molnar" <mingo@...e.hu>, "Andi Kleen" <andi@...stfloor.org>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: debugctl msr

Markus,


On Wed, Nov 19, 2008 at 7:27 PM, Markus Metzger
<markus.t.metzger@...glemail.com> wrote:
> On Wed, 2008-11-19 at 18:13 +0100, stephane eranian wrote:
>
>> I found another issue with ds_release(). You need to skip freeing the
>> buffer when it
>> is NULL, i.e., was already allocated by caller of ds_request_pebs().
>
> ds_release() is not robust with respect to double release, if that's
> what you mean. Is that desirable?
>
I don't think so.

> For a single ds_release() call matching a corresponding successful
> ds_request() call, the buffer is freed if and only if it had been
> allocated by ds.c.
>
> Kfree() itself handles NULL pointers and scripts/checkpatch.pl warns on
> a check for NULL around a kfree() call.
>
Yes, I have narrowed this down to the following lines:
        current->mm->total_vm  -= context->pages[qual];
        current->mm->locked_vm -= context->pages[qual];

I think this is again related to the problem of which thread call
ds_release(). In my test
case, this is the monitored thread as it exits. By the time it gets
there current->mm is NULL.

>> As for handling the interrupt is ds.c, not clear how this could work
>> with current perfmon.
>> I don't know how this work on the BTS side. On the PMU side, that is not because
>> I am using PEBS, that I don't also use other counters as well. Longer
>> term, I think, there
>> needs to be a lower-level PMU interrupt service where you would
>> register a callback
>> on PMU interrupts. It would be used by NMI watchdog, perfmon,
>> Oprofile, ds.c.
>
> That's even preferable to having the interrupt code itself in ds.c
>
Yes!

> The point I was trying to make is that buffer overflows should not be
> handled on higher levels (i.e. users of ds.c). That's why I am so
> reluctant to expose the interrupt threshold in the ds.c interface.
>
But the threshold is a characteristic of the buffer, not the interrupt handler.
Depending on the tool, it may be interesting to set the threshold earlier than
at the end of the buffer.
--
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