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:	Mon, 15 Feb 2010 10:12:06 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	paulmck@...ux.vnet.ibm.com
Cc:	linux-kernel@...r.kernel.org
Subject: Re: rcu_dereference() without protection in select_task_rq_fair()

On Sun, 2010-02-14 at 09:04 -0800, Paul E. McKenney wrote:

> OK, but doesn't the "preempt_count() != 0" that is in the current version
> of rcu_read_lock_sched_held() already cover this check?

Hmm, yes it should.

> In other words, I believe that I have located a usage of for_each_domain()
> that violates the rule that it may only be called within preempt-disabled
> sections.

>>From the trace:

>  [<ffffffff81033ec4>] select_task_rq_fair+0xc1/0x686
>  [<ffffffff810353f4>] wake_up_new_task+0x1e/0x13e

Which reads like:

void wake_up_new_task(...)
{
	...

        int cpu __maybe_unused = get_cpu();

#ifdef CONFIG_SMP
        /*
         * Fork balancing, do it here and not earlier because:
         *  - cpus_allowed can change in the fork path
         *  - any previously selected cpu might disappear through hotplug
         *
         * We still have TASK_WAKING but PF_STARTING is gone now, meaning
         * ->cpus_allowed is stable, we have preemption disabled, meaning
         * cpu_online_mask is stable.
         */
        cpu = select_task_rq(p, SD_BALANCE_FORK, 0);
        set_task_cpu(p, cpu);
#endif

	...

	put_cpu()
}

I cannot see how we can get there without preemption disabled.

--
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