Merge tag 'locking_urgent_for_v6.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fixes from Borislav Petkov: - Make sure sanity checks down in the mutex lock path happen on the correct type of task so that they don't trigger falsely - Use the write unsafe user access pairs when writing a futex value to prevent an error on PowerPC which does user read and write accesses differently * tag 'locking_urgent_for_v6.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking: Fix __clear_task_blocked_on() warning from __ww_mutex_wound() path futex: Use user_write_access_begin/_end() in futex_put_value()
This commit is contained in:
@@ -319,13 +319,13 @@ static __always_inline int futex_put_value(u32 val, u32 __user *to)
|
||||
{
|
||||
if (can_do_masked_user_access())
|
||||
to = masked_user_access_begin(to);
|
||||
else if (!user_read_access_begin(to, sizeof(*to)))
|
||||
else if (!user_write_access_begin(to, sizeof(*to)))
|
||||
return -EFAULT;
|
||||
unsafe_put_user(val, to, Efault);
|
||||
user_read_access_end();
|
||||
user_write_access_end();
|
||||
return 0;
|
||||
Efault:
|
||||
user_read_access_end();
|
||||
user_write_access_end();
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
|
||||
@@ -342,8 +342,12 @@ static bool __ww_mutex_wound(struct MUTEX *lock,
|
||||
* When waking up the task to wound, be sure to clear the
|
||||
* blocked_on pointer. Otherwise we can see circular
|
||||
* blocked_on relationships that can't resolve.
|
||||
*
|
||||
* NOTE: We pass NULL here instead of lock, because we
|
||||
* are waking the mutex owner, who may be currently
|
||||
* blocked on a different mutex.
|
||||
*/
|
||||
__clear_task_blocked_on(owner, lock);
|
||||
__clear_task_blocked_on(owner, NULL);
|
||||
wake_q_add(wake_q, owner);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user