diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2024-09-05 20:27:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-09-18 19:25:12 +0200 |
commit | 5dfb716fdb7de4a980e60fa970bf65f7dc01614c (patch) | |
tree | 5427c9f8c49620f0d24415cb254dbb7220346076 /drivers/clocksource/hyperv_timer.c | |
parent | 327f0792ca04f28e409f3982eff539b339db6a30 (diff) |
dm-integrity: fix a race condition when accessing recalc_sector
commit f8e1ca92e35e9041cc0a1bc226ef07a853a22de4 upstream.
There's a race condition when accessing the variable
ic->sb->recalc_sector. The function integrity_recalc writes to this
variable when it makes some progress and the function
dm_integrity_map_continue may read this variable concurrently.
One problem is that on 32-bit architectures the 64-bit variable is not
read and written atomically - it may be possible to read garbage if read
races with write.
Another problem is that memory accesses to this variable are not guarded
with memory barriers.
This commit fixes the race - it moves reading ic->sb->recalc_sector to an
earlier place where we hold &ic->endio_wait.lock.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/clocksource/hyperv_timer.c')
0 files changed, 0 insertions, 0 deletions