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: <AANLkTimC6MqioV=6Ry=xvL9m4NeAEmZbkoOGQZ+66Duc@mail.gmail.com>
Date:	Wed, 23 Mar 2011 13:47:19 +0100
From:	Stephane Eranian <eranian@...gle.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	linux-kernel@...r.kernel.org, peterz@...radead.org,
	perfmon2-devel@...ts.sf.net, paulus@...ba.org, davem@...emloft.net
Subject: Re: [PATCH] perf_events: fix cgrp stale pointer in update_cgrp_time_from_cpuctx()

On Wed, Mar 23, 2011 at 12:36 PM, Ingo Molnar <mingo@...e.hu> wrote:
>
> * Stephane Eranian <eranian@...gle.com> wrote:
>
>> -     if (is_cgroup_event(event))
>> +     if (is_cgroup_event(event)) {
>>               ctx->nr_cgroups--;
>> +             cpuctx = __get_cpu_context(ctx);
>> +             /*
>> +              * if there are no more cgroup events
>> +              * then clear cgrp to avoid stale pointer
>> +              * in update_cgrp_time_from_cpuctx()
>> +              */
>> +             if (!ctx->nr_cgroups)
>> +                     cpuctx->cgrp = NULL;
>> +     }
>
> The ->cgrp pointer does not exist on !CGROUPS kernels. I suspect the cleanest
> approach would be to make those two cgrp fields available unconditionally in
> struct perf_event.
>
Argh, I forgot to test !CGROUP.
I tend to agree with you on making those fields unconditional. We
don't save that
much by not doing it.

> Thanks,
>
>        Ingo
>
--
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