History

[PATCH] futex: PI state locking fix

Testing of -rt by IBM uncovered a locking bug in wake_futex_pi(): the PI state needs to be locked before we access it.

Ingo Molnar committed 19 years ago

Commit 21778861 parent d3a7b6d1 file · +2 −0Browse files

Unified · Split

kernel/futex.c+2−0
@@ -565,6 +565,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) · 564 unmodified lines
565 if (!pi_state)565 if (!pi_state)
566 return -EINVAL;566 return -EINVAL;
567 567
568 spin_lock(&pi_state->pi_mutex.wait_lock);
568 new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);569 new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);
569 570
570 /*571 /*
@@ -604,6 +605,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) · 33 unmodified lines
604 pi_state->owner = new_owner;605 pi_state->owner = new_owner;
605 spin_unlock_irq(&new_owner->pi_lock);606 spin_unlock_irq(&new_owner->pi_lock);
606 607
608 spin_unlock(&pi_state->pi_mutex.wait_lock);
607 rt_mutex_unlock(&pi_state->pi_mutex);609 rt_mutex_unlock(&pi_state->pi_mutex);
608 610
609 return 0;611 return 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t