aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/ipmi
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2014-04-14 16:58:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-26 17:15:34 -0700
commit98afe6dfdef0ef9df6e21cdd9d977bfc6147b0a9 (patch)
tree8597f71a2954e658adb0907a316c50fcce140695 /drivers/char/ipmi
parentf512eefd5cde0ad21bd99bbfe4dc70b62805838e (diff)
user namespace: fix incorrect memory barriers
commit e79323bd87808fdfbc68ce6c5371bd224d9672ee upstream. smp_read_barrier_depends() can be used if there is data dependency between the readers - i.e. if the read operation after the barrier uses address that was obtained from the read operation before the barrier. In this file, there is only control dependency, no data dependecy, so the use of smp_read_barrier_depends() is incorrect. The code could fail in the following way: * the cpu predicts that idx < entries is true and starts executing the body of the for loop * the cpu fetches map->extent[0].first and map->extent[0].count * the cpu fetches map->nr_extents * the cpu verifies that idx < extents is true, so it commits the instructions in the body of the for loop The problem is that in this scenario, the cpu read map->extent[0].first and map->nr_extents in the wrong order. We need a full read memory barrier to prevent it. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char/ipmi')
0 files changed, 0 insertions, 0 deletions