diff options
author | John Garry <john.garry@huawei.com> | 2019-07-30 21:29:52 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-06 10:23:45 +0200 |
commit | 94cfb33438e03f4c9abcc41f10dcd13b32c9d349 (patch) | |
tree | 4ca4fd3de4a14f9200793d3618f8d516f55264f7 /scripts/gcc-x86_64-has-stack-protector.sh | |
parent | e0e3650991cd69492258e1fcfb9731d86b4e38e9 (diff) | |
download | linux-stable-94cfb33438e03f4c9abcc41f10dcd13b32c9d349.tar.gz linux-stable-94cfb33438e03f4c9abcc41f10dcd13b32c9d349.tar.bz2 linux-stable-94cfb33438e03f4c9abcc41f10dcd13b32c9d349.zip |
lib: logic_pio: Fix RCU usage
commit 06709e81c668f5f56c65b806895b278517bd44e0 upstream.
The traversing of io_range_list with list_for_each_entry_rcu()
is not properly protected by rcu_read_lock() and rcu_read_unlock(),
so add them.
These functions mark the critical section scope where the list is
protected for the reader, it cannot be "reclaimed". Any updater - in
this case, the logical PIO registration functions - cannot update the
list until the reader exits this critical section.
In addition, the list traversing used in logic_pio_register_range()
does not need to use the rcu variant.
This is because we are already using io_range_mutex to guarantee mutual
exclusion from mutating the list.
Cc: stable@vger.kernel.org
Fixes: 031e3601869c ("lib: Add generic PIO mapping method")
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/gcc-x86_64-has-stack-protector.sh')
0 files changed, 0 insertions, 0 deletions