Bug 799391 - Tasks waiting on a state change of another task may get wrong result
Summary: Tasks waiting on a state change of another task may get wrong result
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: realtime-kernel
Version: 2.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 2.2
: ---
Assignee: John Kacur
QA Contact: David Sommerseth
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-02 16:19 UTC by Steven Rostedt
Modified: 2016-05-22 23:34 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: wait_task_interactive() ignores the rt_spin_locks state Consequence: wait_task_interactive() can return with an incorrect result if the task it is waiting for is blocked on a rt_spin_lock() and is waking up. Fix: wait_task_interactive() must also test the saved_state field saved by rt_spin_locks Result: The correct result is returned from wait_task_interactive()
Clone Of:
Environment:
Last Closed: 2012-09-19 18:03:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Have wait_task_interactive() check saved state of task (1.53 KB, patch)
2012-03-02 16:23 UTC, Steven Rostedt
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:1282 0 normal SHIPPED_LIVE Moderate: kernel-rt security, bug fix, and enhancement update 2012-09-19 22:02:30 UTC

Description Steven Rostedt 2012-03-02 16:19:59 UTC
When a task calls the function wait_task_interactive(), it waits on the task to change its tasks state. But it does not take into account that spin_locks() in RT will change the real state of the task, but keep a mirror copy of the state, that it resets to when the task unlocks the spin lock.

The wait_task_interactive() may get the wrong result because it sees the temporary state caused by the RT spin lock and not the real state.

Comment 1 Steven Rostedt 2012-03-02 16:23:40 UTC
Created attachment 567100 [details]
Have wait_task_interactive() check saved state of task

In RT, spin locks store the task's state in a shadow copy because the wakeup of the spin lock will change it. On unlock the shadow copy is moved to the original tasks state. But this can confuse wait_task_interactive() because it doesn't see the copy of it. This patch makes wait_task_interactive() aware of the copy as well.

Comment 2 John Kacur 2012-05-23 13:00:43 UTC
The fix here is equivalent to c7004d0
git describe --contains c7004d0
v3.2.14-rt24~8

Documenting this in the changelog section of kernel-rt.spec

Comment 6 John Kacur 2012-06-20 22:08:16 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: wait_task_interactive() ignores the rt_spin_locks state
Consequence: wait_task_interactive() can return with an incorrect result if the task it is waiting for is blocked on a rt_spin_lock() and is waking up.
Fix: wait_task_interactive() must also test the saved_state field saved by rt_spin_locks
Result: The correct result is returned from wait_task_interactive()

Comment 10 errata-xmlrpc 2012-09-19 18:03:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-1282.html


Note You need to log in before you can comment on or make changes to this bug.