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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 5 Nov 2006 17:53:32 -0500 (EST)
From:	Steven Rostedt <>
To:	Linus Torvalds <>
cc:	Oleg Nesterov <>,
	Thomas Gleixner <>,
	Andrew Morton <>,
Subject: Re: PATCH? hrtimer_wakeup: fix a theoretical race wrt rt_mutex_slowlock()

On Sun, 5 Nov 2006, Linus Torvalds wrote:

> That said, since "task->state" in only tested _inside_ the runqueue lock,
> there is no race that I can see. Since we've gotten the runqueue lock in
> order to even check task-state, the processor that _sets_ task state must
> not only have done the "spin_lock()", it must also have done the
> "spin_unlock()", and _that_ will not allow either the timeout or the task
> state to haev leaked out from under it (because that would imply that the
> critical region leaked out too).
> So I don't think the race exists anyway - the schedule() will return
> immediately (because it will see TASK_RUNNING), and we'll just retry.

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


    p->state = TASK_RUNNING;

                                      (from bottom of for loop)

                                    for (;;) {  (looping)

                                      if (timeout && !timeout->task)

   (now CPU implements)
   t->task = NULL


                                   schedule() (with state == TASK_INTERRUPTIBLE)

Again, this is very theoretical, and I don't even think that this can
happen if you tried to make it.  But I guess if hardware were to change in
the future with the same rules that we have today with barriers, that this
can be a race.

-- Steve

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists