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:	Sun, 5 Nov 2006 19:08:35 -0800 (PST)
From:	Linus Torvalds <torvalds@...l.org>
To:	Steven Rostedt <rostedt@...dmis.org>
cc:	Oleg Nesterov <oleg@...sign.ru>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...l.org>, linux-kernel@...r.kernel.org
Subject: Re: PATCH? hrtimer_wakeup: fix a theoretical race wrt rt_mutex_slowlock()



On Sun, 5 Nov 2006, Steven Rostedt wrote:
> 
> This whole situation is very theoretical, but I think this actually can
> happen *theoretically*.
> 
> OK, the spin_lock doesn't do any serialization, but the unlock does. But
> the problem can happen before the unlock. Because of the loop.
> 
> CPU 1                                    CPU 2
> 
>     task_rq_lock()
> 
>     p->state = TASK_RUNNING;
> 
> 
>                                       (from bottom of for loop)
>                                       set_current_state(TASK_INTERRUPTIBLE);
> 
>                                     for (;;) {  (looping)
> 
>                                       if (timeout && !timeout->task)
> 
> 
>    (now CPU implements)
>    t->task = NULL
> 
>    task_rq_unlock();
> 
>                                    schedule() (with state == TASK_INTERRUPTIBLE)

Yeah, that seems a real bug. You _always_ need to actually do the thing 
that you wait for _before_ you want it up. That's what all the scheduling 
primitives depend on - you can't wake people up first, and then set the 
condition variable.

So if a rt_mutex depeds on something that is set inside the rq-lock, it 
needs to get the task rw-lock in order to check it.

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