[PATCH v2 0/2] Fix a race condition vulnerability in "_show" functions

From: Kimberly Brown
Date: Thu Feb 21 2019 - 22:47:01 EST


This patchset fixes a race condition vulnerability in the "_show"
functions that access a channel ring buffer.

Changes in v2:
- In v1, I proposed using âvmbus_connection.channel_mutexâ in the
â_showâ functions to prevent the race condition. However, using this
mutex could result in a deadlock, so a new approach is needed.

- Patch 1 is new and consists of a code refactor.

- Patch 2 introduces a new mutex lock in the âvmbus_channelâ struct,
and the new mutex is used to eliminate the race condition.

Kimberly Brown (2):
Drivers: hv: vmbus: Refactor chan->state if statement
Drivers: hv: vmbus: Add a channel ring buffer mutex lock

drivers/hv/channel.c | 5 ++
drivers/hv/channel_mgmt.c | 1 +
drivers/hv/ring_buffer.c | 11 +++-
drivers/hv/vmbus_drv.c | 118 ++++++++++++++++++++++++++------------
include/linux/hyperv.h | 10 +++-
5 files changed, 104 insertions(+), 41 deletions(-)

--
2.17.1