In case of invalid sub channel, release cpu lock before returning.
Signed-off-by: Saurabh Sengar <[email protected]>
---
drivers/hv/channel_mgmt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 280b529..5b12040 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -639,6 +639,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
*/
if (newchannel->offermsg.offer.sub_channel_index == 0) {
mutex_unlock(&vmbus_connection.channel_mutex);
+ cpus_read_unlock();
/*
* Don't call free_channel(), because newchannel->kobj
* is not initialized yet.
--
1.8.3.1
From: Saurabh Sengar <[email protected]> Sent: Thursday, June 9, 2022 10:17 AM
>
> In case of invalid sub channel, release cpu lock before returning.
>
> Signed-off-by: Saurabh Sengar <[email protected]>
> ---
> drivers/hv/channel_mgmt.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
> index 280b529..5b12040 100644
> --- a/drivers/hv/channel_mgmt.c
> +++ b/drivers/hv/channel_mgmt.c
> @@ -639,6 +639,7 @@ static void vmbus_process_offer(struct vmbus_channel
> *newchannel)
> */
> if (newchannel->offermsg.offer.sub_channel_index == 0) {
> mutex_unlock(&vmbus_connection.channel_mutex);
> + cpus_read_unlock();
> /*
> * Don't call free_channel(), because newchannel->kobj
> * is not initialized yet.
> --
> 1.8.3.1
Reviewed-by: Michael Kelley <[email protected]>
On Thu, Jun 09, 2022 at 05:39:06PM +0000, Michael Kelley (LINUX) wrote:
> From: Saurabh Sengar <[email protected]> Sent: Thursday, June 9, 2022 10:17 AM
> >
> > In case of invalid sub channel, release cpu lock before returning.
> >
> > Signed-off-by: Saurabh Sengar <[email protected]>
> > ---
> > drivers/hv/channel_mgmt.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
> > index 280b529..5b12040 100644
> > --- a/drivers/hv/channel_mgmt.c
> > +++ b/drivers/hv/channel_mgmt.c
> > @@ -639,6 +639,7 @@ static void vmbus_process_offer(struct vmbus_channel
> > *newchannel)
> > */
> > if (newchannel->offermsg.offer.sub_channel_index == 0) {
> > mutex_unlock(&vmbus_connection.channel_mutex);
> > + cpus_read_unlock();
> > /*
> > * Don't call free_channel(), because newchannel->kobj
> > * is not initialized yet.
> > --
> > 1.8.3.1
>
> Reviewed-by: Michael Kelley <[email protected]>
>
The bug comes from a949e86c0d780.
Added a Fixes tag and applied to hyperv-fixes. Thanks.